|
[求助]dllmain函数发生Access violation错误
确实是全局变量没有执行权限的原因,我用了virtualalloc,确实可以解决这个问题。 |
|
[求助]dllmain函数发生Access violation错误
我想学习一下从汇编的层次上对程序进行修改。所以就拿了MessageBox试了一下.... |
|
[求助]dllmain函数出现0xC0000005: Access violation
我自己也找到了一种解决方式。g_bytecode是全局变量,那么就存放于dll文件的data节区。只要用ultraedit将data节区的属性改为e0 00 00 40既可以了,增加了可执行属性。当然这是一种取巧的行为,并不规范,所以还是推荐第一种方法。 |
|
[求助]dllmain函数出现0xC0000005: Access violation
第一次上传的代码这里出错了 hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)&g_InjectionCode,(LPVOID)&pFunc,0,NULL); (LPVOID)&pFunc改为(LPVOID)pFunc pFunc本来就是函数MessageBox的地址,按我第一次写的,就是取函数地址的地址了。 这是我改正后的代码。我给传一下 #include "windows.h" #include "iostream" #ifdef __cplusplus extern "C" { #endif __declspec(dllexport) void dummy() { return; } #ifdef __cplusplus } #endif//dll对外提供的函数 BYTE g_InjectionCode[] = { 0x55,0x8b,0xec,0x8b,0x45,0x08,0x6a,0x00,0xe8,0x0c,0x00,0x00,0x00, 0x52,0x65,0x76,0x65,0x72,0x73,0x65,0x43,0x6f,0x72,0x65,0x00,0xe8, 0x14,0x00,0x00,0x00,0x77,0x77,0x77,0x2e,0x72,0x65,0x76,0x65,0x72, 0x73,0x65,0x63,0x6f,0x72,0x65,0x2e,0x63,0x6f,0x6d,0x00,0x6a,0x00, 0xff,0xd0,0x33,0xc0, 0x8b,0xe5,0x5d,0xc3 }; /* 004010ED 55 PUSH EBP 004010EE 8BEC MOV EBP,ESP 004010F0 8B75 08 MOV EAX,DWORD PTR SS:[EBP+8] ; EAX = pParam 004011F3 6A 00 PUSH 0 ; - MB_OK (0) 004011F5 E8 0C000000 CALL 0040112C 004011FA <ASCII> ; - "ReverseCore", 0 00401201 E8 14000000 CALL 00401145 00401206 <ASCII> ; - "www.reversecore.com", 0 00401215 6A 00 PUSH 0 ; - hWnd (0) 00401217 FFD0 CALL EAX ; MessageBoxA(0, "www.reversecore.com", "ReverseCore", 0) 00401219 33C0 XOR EAX,EAX 0040121B 8BE5 MOV ESP,EBP 0040121D 5D POP EBP 0040121E C3 RETN */ BOOL APIENTRY DllMain(HANDLE hMoudle,DWORD reason,LPVOID lpReserved) //dllmain函数 { HANDLE hThread = NULL; HMODULE hMod = NULL; FARPROC pFunc; hMod = LoadLibraryA("user32.dll"); pFunc = GetProcAddress(hMod,"MessageBoxA"); PVOID pvMem = VirtualAlloc(NULL,sizeof(g_InjectionCode),MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE); WriteProcessMemory(INVALID_HANDLE_VALUE,pvMem,(LPVOID)&g_InjectionCode,sizeof(g_InjectionCode),NULL); switch(reason) { case DLL_PROCESS_ATTACH: hThread = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)pvMem,(LPVOID)pFunc,0,NULL); return TRUE; default: return TRUE; } } 先使用virtualalloc申请内存页,然后使用writevritualmem向内存页写汇编代码。内存页属性一定要是Page_Execute_ReadWrite |
|
[求助]dllmain函数出现0xC0000005: Access violation
确实是这样,按照你说的我解决了这个问题,谢谢。 |
|
[求助]dllmain函数出现0xC0000005: Access violation
因为我是想增加一个节区,然后对节区进行操作。所以才打算用汇编完成。这个数据段我要怎么给它执行的属性呢?在dll的节区里面增加可执行属性?在代码里面如何增加可执行属性呢? |
|
[原创]一条诈骗短信引发的APK破解
等楼主放图,看看骗子是怎么骗人的。 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值