|
[已解决]VC内嵌汇编时抛异常的问题
问题解决了! 我把正确的写法帖出来! void CCallTestPlgDlg::InjectToProcess(DWORD (*FunName)()) { HANDLE TmpHandle; DWORD dwThreadId; DWORD dwProcessId; CString sClassName= ""; m_hPwnd = ::FindWindow("TForm1","游戏找CALL练习实例one");//得到窗口句柄 if(m_hPwnd == NULL) { MessageBox("没有找到主程序,请先运行主程序"); } int hFunc=GetClassName(m_hPwnd,sClassName.GetBuffer(0),2000); if(hFunc != 0 && 0 <= sClassName.Find("TForm1")) { if( dwThreadId = ::GetWindowThreadProcessId(m_hPwnd, &dwProcessId)) { m_hProcess = ::OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcessId); if(m_hProcess != NULL) { //在目标进程建立内存空间 LPVOID ThreadAdd = ::VirtualAllocEx(m_hProcess, NULL,0x1024, MEM_COMMIT, PAGE_EXECUTE_READWRITE); ::WriteProcessMemory(m_hProcess,ThreadAdd ,FunName,0x1024,NULL); TmpHandle = CreateRemoteThread(m_hProcess, NULL, 0, (LPTHREAD_START_ROUTINE)ThreadAdd, NULL, CREATE_SUSPENDED, NULL);//获得注入后过程的句柄ID if(WaitForSingleObject(TmpHandle,INFINITE) != WAIT_OBJECT_0)//就在这里死了!程序失去响应! { CString StrTmp; StrTmp.Format("%d",GetLastError()); MessageBox(StrTmp); } CloseHandle(TmpHandle); CloseHandle(m_hProcess); VirtualFreeEx(m_hProcess,ThreadAdd,0x1024,MEM_RELEASE); } } } } DWORD tmpHP() { _asm{ pushad mov eax,4549992 mov eax,[eax] mov edx,4534336 mov ebx,4533912 call ebx popad ret } return 0; } void CCallTestPlgDlg::OnHp() { InjectToProcess(tmpHP); } 不好意思哦,这么久来过来补充,还好,今天想起来了~~ |
|
|
|
[讨论]反逆向学习(2)
越来越精彩了` |
|
[讨论]反逆向学习(2)
本来昨天晚上就应该发出来,可惜学校停电了~~ 今天早晨起来看了笨笨雄老大的程序,真让人自叹不如哦~~~~ 看来我们还要继续努力了~~~~ 我还是帖出来我的方法吧,大家别笑话我`~~ #include <windows.h> #include<stdio.h> #include<stdafx.h> //...由于难度增加可以适当在这里加些代码 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { char* str="hello world\n"; //...这里添加代码,让IDA打开后不能直接看到调用的是MessageBoxA这个函数 (*(int (__cdecl *)(HWND,LPCTSTR,LPCTSTR,UINT))((DWORD)MoveWindow+0x3299E))(0,str,0,0); return 0; } 这样写程序会有异常,我也没有找到问题在哪里,可能是我用函数指针的时候,转换的有问题吧`~(C没有学好,丢人了~~ ) 所以,我用汇编写了一个没有问题的: #include <windows.h> #include<stdio.h> #include<stdafx.h> //...由于难度增加可以适当在这里加些代码 int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { char* str="hello world\n"; //...这里添加代码,让IDA打开后不能直接看到调用的是MessageBoxA这个函数 _asm{ pushad; mov eax,MoveWindow; add eax,0x3299E; push 0; push 0; push str; push 0; call eax; } return 0; } 方法是这样的! 我先用OD调了USER32.DLL,纪录了下面的信息: 名称位于 USER32, 条目 676于是就有了上面的程序~ |
|
|
|
[调查]想找本好的汇编书 帮推荐下
个人感觉,清华的X86汇编看前八章,真的很好! 你也可以配合着中山大学的视频教程看!视频讲的非常的详细! 然后再看老罗的WIN32汇编! 我建议是这样的,当然,或许别人有更好的方法! |
|
|
|
[求助]关于最后一次异常法的脱壳问题??
我来回答~ 首先,我来做个名词解释:“异常”就是“不正常”的意思! 对于加壳的程序来说,正常情况下是没有异常的,换句话说,就是正常情况下是没有不正常的! 而如果你要给这个正常的加壳程序脱壳的话,就是让它不正常了!也就是让它异常了! 反之,即是:异常就能达到脱壳目的了! 明白了不? |
|
|
|
[讨论]反逆向学习(1)
一直没有人来玩吗? 那我就不客气了,我来抛砖引玉! 现丑了,大家别笑话我哦~~~ #include <windows.h> #include<stdio.h> #include<stdafx.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { char *str="hello world\n"; //...在这里添加代码,让IDA打开后开不能直接看到"hello world\n"这样的字符串 DWORD addrStr = (DWORD)str; str = NULL; addrStr += 11; char *tmp = (char *)addrStr; char tmpstr[10]; int itmp = 1; for(int i = 10;i>=0;i--) { tmpstr[i] = *(tmp-itmp); itmp ++; } str = tmpstr; ::MessageBox(0,str,0,0); return 0; } 不知道用IDA能不能看到哦,我不会用IDA |
|
|
|
|
|
[分享]《加密与解密(第三版)》学习指引(第三章)静态分析技术
坚决支持!!! |
|
[已解决]学习代码远程注入的时候遇到问题了
应该不是这个问题吧,我已经把这个错误改了,大小改成0X1024也不可以,我的函数远没有0x1024这么大~ |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值