|
[求助]IDA反编译的伪代码中如何实现switch语句
在哪里操作,才能将伪代码中令人头晕的 if 转换为switch? 源代码: LRESULT CALLBACK WinSunProc( HWND hwnd, // handle to window UINT uMsg, // message identifier WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { switch(uMsg) { case WM_CHAR: char szChar[20]; sprintf(szChar,"Char is %d",wParam); MessageBox(hwnd,szChar,"字符",0); break; case WM_LBUTTONDOWN: MessageBox(hwnd,"谁让你单击鼠标左键?","鼠标",0); HDC hdc; hdc=GetDC(hwnd); TextOut(hdc,0,50,"编程",strlen("编程")); ReleaseDC(hwnd,hdc); break; case WM_PAINT: HDC hdcpaint; PAINTSTRUCT ps; hdcpaint=BeginPaint(hwnd,&ps); TextOut(hdcpaint,0,100,"我爱你",strlen("我爱你")); EndPaint(hwnd,&ps); ReleaseDC(hwnd,hdcpaint); break; case WM_CLOSE: if(IDYES==MessageBox(hwnd,"退出吗?","确认",MB_YESNO)) { DestroyWindow(hwnd); } break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hwnd,uMsg,wParam,lParam); // } return 0; } 生成的伪代码: LRESULT __stdcall WinSunProc(HWND hwnd, UINT uMsg, WPARAM wparam, LPARAM lparam) { HWND Hwnd; // esi@7 HWND hWnd; // esi@5 HDC hdcpaint; // ebx@5 HWND HWnd; // esi@12 HDC hdc; // ebx@12 struct tagPAINTSTRUCT ps; // [sp+20h] [bp-40h]@5 char szChar; // [sp+Ch] [bp-54h]@13 if ( uMsg <= (unsigned int)WM_CLOSE ) { if ( uMsg != WM_CLOSE ) { if ( uMsg == WM_DESTROY ) { PostQuitMessage(0); return 0; } if ( uMsg == 15 ) { hWnd = hwnd; // 顺便问一句:这2个变量能合而为一吗? hdcpaint = BeginPaint(hwnd, &ps); TextOutA(hdcpaint, 0, 100, "我爱你", strlen("我爱你") - 1); EndPaint(hWnd, &ps); ReleaseDC(hWnd, hdcpaint); return 0; } return DefWindowProcA(hwnd, uMsg, wparam, lparam); } Hwnd = hwnd; if ( MessageBoxA(hwnd, "退出吗?", "确认", MB_YESNO) == IDYES ) { DestroyWindow(Hwnd); return 0; } return 0; } if ( uMsg == WM_CHAR ) { sprintf(&szChar, "Char is %d", wparam); MessageBoxA(hwnd, &szChar, "字符", 0); return 0; } if ( uMsg != 513 ) return DefWindowProcA(hwnd, uMsg, wparam, lparam); HWnd = hwnd; MessageBoxA(hwnd, "谁让你单击鼠标左键?", "鼠标", 0); hdc = GetDC(HWnd); TextOutA(hdc, 0, 50, "编程", strlen("编程") - 1); ReleaseDC(HWnd, hdc); return 0; } |
|
[求助]IDA反编译的伪代码中如何实现switch语句
谢谢wyfe的回答。 我用的就是Hex-Rays插件,v1.0.071108版本。 就是它生成的伪代码,把switch换成了 if 。 能转换回switch吗?如何转换? |
|
|
|
[求助]网游如何刷币
1. 如是新手,请看 提问的智慧 和 论坛常见问题 2. 先搜索本论坛或用Google引擎找找答案 3. 谨慎选择相关主题的论坛 4. 使用含义丰富,描述准确的标题 5. 勿重复帖 6. 勿点将 7. 别要求私下答复 8. 问题解决后,加个简短说明 9. 不得请求破解、有偿交易帖、散发注册机 10.不欢迎要求留Email的跟帖方式散发你的资料或作品 上面是看雪的规则,我应该没犯规吧?? |
|
[求助]请问NP是什么意思?已解决
受教了,谢谢NpKiller。 |
|
|
|
你们学习破解的动力是什么呵
电脑没什么知识可学的了,除了破解。 |
|
[求助]Ollydbg的一个操作问题
多读了几遍,发现是我误会2位了,不好意思。 |
|
|
|
如何一次性提取断点之间的代码?
谢谢楼上的回答,我现在就是用的Asm2ClipBoard 插件。 复制少数代码是很方便,但有时2个断点之间代码较多时,尤其是之间有N个call、jump,甚至有call ebx之类不断变化的,要跟踪程序执行过的代码,复制起来就麻烦了。 |
|
[求助]第一次碰这种奇怪的程序,求入手点
用OD的附加功能载入程序试试。 |
|
如何一次性提取断点之间的代码?
我就是不知道OD有没有这个功能啊,所以向各位请教。 |
|
[求助]Ollydbg的一个操作问题
哈哈,楼上2位大大没理解楼主的意思。我为这个问题曾经也琢磨了好久,最后自己想通了。 举个例子吧,假设以下是壳代码,00401200是call到OEP的: 00401000 push XXX 。。。 004011FD XXX 00401200 call XXX 00401205 XXX 我目前运行到004011FD处,然后光标指向00401205处,按F4。 此时程序运行,并不会运行到光标所在的00401205位置,因为00401200的call已经使程序完全运行了。 |
|
[求助]是否能把 [Overlay] 附加數據 脫掉?有詳細的操作教學嗎?可否提供教學?
大致来说,两大步: 一.通过PE编辑工具修改最后一个区段的范围,使它包含overlay数据. 二.这样修改后程序是不能运行的,还要通过OD等工具修改程序中指向overlay数据段的指针. 完成以上2步,程序可以正常运行,peid会显示Microsoft Visual C++ 6.0或Borland Delphi 6.0 - 7.0 |
|
如何一次性提取断点之间的代码?
嗯,自己顶一次,期盼回复ing...... |
|
[求助]段地址:必须被16整除?
这个问题其实不是很重要,没弄懂也不怎么影响逆向分析. 现在反汇编的代码,地址都是直接用8位16进制数表示了, 如:00401000 push ebp 也就是说,每个进程都有独立的4G寻址空间(理论上). |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值