|
[求助]点击堆栈窗口,高亮显示文本,怎么下断点
我把黄条弄下面去了 |
|
[求助]点击堆栈窗口,高亮显示文本,怎么下断点
指的什么?说的很玄妙 |
|
[求助]关于堆栈平衡问题?
如果要nop掉的是一个call指令,如何保持堆栈平衡呢? 只要按ENTER“跟随”进入被call的函数,看一下函数的返回指令,如果是retn,就直接用Nop替换;如果是retn XXX,就把call替换成为add esp, XXX; 就这样。具体请查阅指令手册关于retn指令的说明。 这种方法不知道怎么做,不知道我上面说的歪方法正确不? |
|
[求助]关于堆栈平衡问题?
sub esp,1 在堆栈中留出局部变量的空间 看看下面的文章对你的汇编语言一定有帮助! 汇编中参数的传递和堆栈修正 在 Win32汇编中,我们经常要和 Api 打交道,另外也会常常使用自己编制的类似于 Api 的带参数的子程序,本文要讲述的是在子程序调用的过程中进行参数传递的概念和分析。一般在程序中,参数的传递是通过堆栈进行的,也就是说,调用者把要传递给子程序(或者被调用者)的参数压入堆栈,子程序在堆栈取出相应的值再使用,比如说,如果你要调用 SubRouting(Var1,Var2,Var3),编译后的最终代码可能是 push Var3 push Var2 push Var1 call SubRouting add esp,12 也就是说,调用者首先把参数压入堆栈,然后调用子程序,在完成后,由于堆栈中先前压入的数不再有用,调用者或者被调用者必须有一方把堆栈指针修正到调用前的状态。参数是最右边的先入堆栈还是最左边的先入堆栈、还有由调用者还是被调用者来修正堆栈都必须有个约定,不然就会产生不正确的结果,这就是我在前面使用“可能”这两个字的原因:各种语言中调用子程序的约定是不同的,它们的不同点见下表: C SysCall StdCall Basic Fortran Pascal 参数从左到右 是 是 是 参数从右到左 是 是 是 调用者清除堆栈 是 允许使用:VARARG 是 是 是 VARARG 表示参数的个数可以是不确定的,有一个例子就是 C 中的 printf 语句,在上表中,StdCall 的定义有个要说明的地方,就是如果 StdCall 使用 :VARARG 时,是由调用者清除堆栈的,而在没有:VARARG时是由被调用者清除堆栈的。 在 Win32 汇编中,约定使用 StdCall 方式,所以我们要在程序开始的时候使用 .model stdcall 语句。也就是说,在 API 或子程序中,最右边的参数先入堆栈,然后子程序在返回的时候负责校正堆栈,举例说明,如果我们要调用 MessageBox 这个 API,因为它的定义是 MessageBox(hWnd,lpText,lpCaption,UType) 所以在程序中要这样使用: push MB_OK push offset szCaption push offset szText push hWnd call MessageBox ... 我们不必在 API 返回的时候加上一句 add sp,4*4 来修正堆栈,因为这已经由 MessageBox 这个子程序做了。在 Windows API 中,唯一一个特殊的 API 是 wsprintf,这个 API 是 C 约定的,它的定义是 wsprintf(lpOut,lpFormat,Var1,Var2...),所以在使用时就要: push 1111 push 2222 push 3333 push offset szFormat push offset szOut call wsprintf add esp,4*5 下面要讲的是子程序如何存取参数,因为缺省对堆栈操作的寄存器有 ESP 和 EBP,而 ESP是堆栈指针,无法暂借使用,所以一般使用 EBP 来存取堆栈,假定在一个调用中有两个参数,而且在 push 第一个参数前的堆栈指针 ESP 为 X,那么压入两个参数后的 ESP 为 X-8,程序开始执行 call 指令,call 指令把返回地址压入堆栈,这时候 ESP 为 X-C,这时已经在子程序中了,我们可以开始使用 EBP 来存取参数了,但为了在返回时恢复 EBP 的值,我们还是再需要一句 push ebp 来先保存 EBP 的值,这时 ESP 为 X-10,再执行一句 mov ebp,esp,根据右图可以看出,实际上这时候 [ebp + 8] 就是参数1,[ebp + c]就是参数2。另外,局部变量也是定义在堆栈中的,它们的位置一般放在 push ebp 保存的 EBP 数值的后面,局部变量1、2对应的地址分别是 [ebp-4]、[ebp-8],下面是一个典型的子程序,可以完成第一个参数减去第二个参数,它的定义是: MyProc proto Var1,Var2 ;有两个参数 local lVar1,lVar2 ;有两个局部变量 注意,这里的两个 local 变量实际上没有被用到,只是为了演示用,具体实现的代码是: MyProc proc push ebp mov ebp,esp sub esp,8 mov eax,dword ptr [ebp + 8] sub eax,dword ptr [ebp + c] add esp,8 pop ebp ret 8 MyProc endp 现在对这个子程序分析一下,push ebp/mov ebp,esp 是例行的保存和设置 EBP 的代码,sub esp,8 在堆栈中留出两个局部变量的空间,mov /add 语句完成相加,add esp,8 修正两个局部变量使用的堆栈,ret 8 修正两个参数使用的堆栈,相当于 ret / add esp,8 两句代码的效果。可以看出,这是一个标准的 Stdcall 约定的子程序,使用时最后一个参数先入堆栈,返回时由子程序进行堆栈修正。当然,这个子程序为了演示执行过程,使用了手工保存 ebp 并设置局部变量的方法,实际上,386 处理器有两条专用的指令是完成这个功能用的,那就是 Enter 和 Leave,Enter 语句的作用就是 push ebp/mov ebp,esp/sub esp,xxx,这个 xxx 就是 Enter 的,Leave 则完成 add esp,xxx/pop ebp 的功能,所以上面的程序可以改成: MyPorc proc enter 8,0 mov eax,dword ptr [ebp + 8] sub eax,dword ptr [ebp + c] leave ret 8 MyProc endp 好了,说到这儿,参数传递的原理也应该将清楚了,还要最后说的是,在使用 Masm32 编 Win32 汇编程序的时候,我们并不需要记住 [ebp + xx] 等麻烦的地址,或自己计算局部变量需要预留的堆栈空间,还有在 ret 时计算要加上的数值,Masm32 的宏指令都已经把这些做好了,如在 Masm32 中,上面的程序只要写成为: MyProc proc Var1,Var2 local lVar1,lVar2 mov eax,Var1 sub eax,Var2 ret MyProc endp 编译器会自动的在 mov eax,Var1 前面插上一句 Enter 语句,它的参数会根据 local 定义的局部变量的多少自动指定,在 ret 前会自动加上一句 Leave,同样,编译器会根据参数的多少把 ret 替换成 ret xxx,把 mov eax,Var1 换成 mov eax,dword ptr [ebp + 8] 等等。 最后是使用 Masm32 的 invoke 宏指令,在前面可以看到,调用带参数的子程序时,我们需要用 push 把参数压入堆栈,如果不小心把参数个数搞错了,就会使堆栈不平衡,从而使程序从堆栈中取出错误的返回地址引起不可预料的后果,所以有必要有一条语句来完成自动检验的任务,invoke 就是这样的语句,实际上,它是自动 push 所有参数,检测参数个数、类型是否正确,并使用 call 来调用的一个宏指令,对于上面的 push/push/call MyProc 的指令,可以用一条指令完成就是: invoke MyProc,Var1,Var2 当然,当程序编译好以后你去看机器码会发现它被正确地换成了同样的 push/push/call 指令。但是,在使用 invoke 之前,为了让它进行正确的参数检验,你需要对函数进行申明,就象在 C 中一样,申明的语句是: MyProc proto :DWORD,:DWORD 语句中 proto 是关键字,表示申明,:DWORD 表示参数的类型是 double word 类型的,有几个就表示有几个参数,在 Win32 中参数都是 double word 型的,申明语句要写在 invoke 之前,所以我们一般把它包括在 include 文件中,好了,综合一下,在 Masm32 中使用一个带参数的子程序或者 Api ,我们只需用: ... MyProc proto :dword,:dword ... .data x dd ? y dd ? dwResult dd ? ... mov x,1 mov y,2 invoke MyProc x,y mov dwResult,eax |
|
[求助]关于堆栈平衡问题?
哈哈哈哈哈哈~! 简单问题复杂化了我~! |
|
|
|
[感谢]感谢书呆彭版主的热心帮助[其他大大们来看看新的问题]
谢谢你们的支持和鼓励~! |
|
[求助]OllyDBG的标题汉化问题[附带目前网上很少的非标汉化工具破解版]
不好意思发表愚见~! |
|
[感谢]感谢书呆彭版主的热心帮助[其他大大们来看看新的问题]
不好意思,惹大哥生气了,以后不会了~! |
|
询问修改OD子窗口大小的方法[如何永久指定程序打开后的窗口大小]
这个帖子就不需要回复了,手动让它最大化,然后关闭OD重新开就是最大化了; 如果打开其他窗口,CPU窗口就缩小,那是因为你打开的其他窗口不是最大化的; CPU最大化,不可能再显示其他窗口的。 |
|
[求助]OllyDBG的标题汉化问题[附带目前网上很少的非标汉化工具破解版]
达文西,好!我试过了,他的修改方法不一样吧!而且他这个是修改好了的,在下断点bp SetWindowTextA [esp+4]==xxxxxxxx断不下来,因为主窗口标题不会变化! 另外一个问题是LEA EDX, DWORD PTR DS:[ESI+1808]在他那里是LEA EDX, DWORD PTR DS:[ESI+C019],但是我计算的偏移是6619,汇编中输入LEA EDX, DWORD PTR DS:[ESI+6619]提示“未知标识符”。 |
|
询问修改OD子窗口大小的方法[如何永久指定程序打开后的窗口大小]
我是直接对CreateWindowEx下断的,堆栈中反汇编窗口跟随来到下面的代码段: 00435E5A . 68 0000CF02 push 2CF0000 ; |Style = WS_OVERLAPPED|WS_MINIMIZEBOX|WS_MAXIMIZEBOX|WS_CLIPCHILDREN|WS_SYSMENU|WS_THICKFRAME|WS_CAPTION 00435E5F . 52 push edx ; |WindowName => "☆终结者☆" 00435E60 . 51 push ecx ; |Class 00435E61 . 6A 10 push 10 ; |ExtStyle = WS_EX_ACCEPTFILES [COLOR="Red"]00435E63 . E8 34950700 call <jmp.&USER32.CreateWindowExA> ; \CreateWindowExA[/COLOR] 00435E68 . A3 7C3B4D00 mov dword ptr ds:[4D3B7C],eax 00435E6D . 833D 7C3B4D00>cmp dword ptr ds:[4D3B7C],0 00435E74 . 75 21 jnz short OD加强版.00435E97 00435E76 . 68 10200000 push 2010 ; /Style = MB_OK|MB_ICONHAND|MB_TASKMODAL 00435E7B . 8D86 08180000 lea eax,dword ptr ds:[esi+1808] ; | 00435E81 . 50 push eax ; |Title 00435E82 . 8D96 3A180000 lea edx,dword ptr ds:[esi+183A] ; | 00435E88 . 52 push edx ; |Text 00435E89 . 6A 00 push 0 ; |hOwner = NULL 00435E8B . E8 86960700 call <jmp.&USER32.MessageBoxA> ; \MessageBoxA 00435E90 . 33C0 xor eax,eax 00435E92 . E9 9E590000 jmp OD加强版.0043B835 00435E97 > 837D DC 00 cmp dword ptr ss:[ebp-24],0 00435E9B . 74 10 je short OD加强版.00435EAD 00435E9D . 6A 03 push 3 ; /ShowState = SW_SHOWMAXIMIZED 00435E9F . 8B15 7C3B4D00 mov edx,dword ptr ds:[4D3B7C] ; | 00435EA5 . 52 push edx ; |hWnd => NULL 00435EA6 . E8 25970700 call <jmp.&USER32.ShowWindow> ; \ShowWindow 00435EAB . EB 0E jmp short OD加强版.00435EBB 00435EAD > 6A 09 push 9 ; /ShowState = SW_RESTORE 00435EAF . 8B0D 7C3B4D00 mov ecx,dword ptr ds:[4D3B7C] ; | 00435EB5 . 51 push ecx ; |hWnd => NULL 00435EB6 . E8 15970700 call <jmp.&USER32.ShowWindow> ; \ShowWindow 我知道一般情况下打开其他窗口,CPU子窗口会自动变小,要能修改成不自动变化就好了,比如初始化状态为最大化,在我没点关闭或者最小化的情况下,打开其他窗口,CPU窗口不变化;如果我点击了中等化CPU窗口大小,它就永远是中等化窗口大小。 接下来不知道怎么做! |
|
[求助]OllyDBG的标题汉化问题[附带目前网上很少的非标汉化工具破解版]
我按照修改插件的方法下断点“bp SetWindowTextA [esp+4]==xxxxxxxx”,但是出现了新问题,其他修改都不出现这个问题,不知道是不是我的堆栈平衡没选好,问题是点“快速加载程序”的时候,头一次没问题,第二次就弹出错误提示,如图: 00475BA5 |. 890D 785A4D00 mov dword ptr ds:[4D5A78],ecx 00475BAB |. E8 687AFBFF call OD加强版._Setcpu 00475BB0 |. 83C4 14 add esp,14 00475BB3 |. E8 54830100 call OD加强版.0048DF0C 00475BB8 |. A1 7C3B4D00 mov eax,dword ptr ds:[4D3B7C] 00475BBD |. 85C0 test eax,eax 00475BBF |. 74 0B je short OD加强版.00475BCC 00475BC1 |. 68 911A4C00 push OD加强版.004C1A91 ; /Text = "终结Θ者" 00475BC6 |. 50 push eax ; |hWnd => 006E03D2 ('☆终结者☆ - [PYG]',class='1212121') [COLOR="Red"]00475BC7 E8 F2990300 call <jmp.&USER32.SetWindowTextA>[/COLOR] 00475BCC |> 6A 00 push 0 跟随到地址: [COLOR="Red"]004AF5BE $- FF25 6CD95000 jmp dword ptr ds:[<&USER32.SetWindowText>; USER32.SetWindowTextA[/COLOR] 004AF5C4 $- FF25 70D95000 jmp dword ptr ds:[<&USER32.ShowCaret>] ; USER32.ShowCaret 004AF5CA $- FF25 74D95000 jmp dword ptr ds:[<&USER32.ShowScrollBar>; USER32.ShowScrollBar 004AF5D0 $- FF25 78D95000 jmp dword ptr ds:[<&USER32.ShowWindow>] ; USER32.ShowWindow 004AF5D6 $- FF25 7CD95000 jmp dword ptr ds:[<&USER32.SystemParamet>; USER32.SystemParametersInfoA 004AF5DC $- FF25 80D95000 jmp dword ptr ds:[<&USER32.TrackPopupMen>; USER32.TrackPopupMenu 004AF5E2 $- FF25 84D95000 jmp dword ptr ds:[<&USER32.TranslateMDIS>; USER32.TranslateMDISysAccel 004AF5E8 $- FF25 88D95000 jmp dword ptr ds:[<&USER32.TranslateMess>; USER32.TranslateMessage 004AF5EE $- FF25 8CD95000 jmp dword ptr ds:[<&USER32.UnregisterCla>; USER32.UnregisterClassA 004AF5F4 $- FF25 90D95000 jmp dword ptr ds:[<&USER32.UpdateWindow>>; USER32.UpdateWindow 004AF5FA $- FF25 94D95000 jmp dword ptr ds:[<&USER32.WinHelpA>] ; USER32.WinHelpA 004AF600 $- FF25 98D95000 jmp dword ptr ds:[<&USER32.WindowFromPoi>; USER32.WindowFromPoint 004AF606 $- FF25 9CD95000 jmp dword ptr ds:[<&USER32.wsprintfA>] ; USER32.wsprintfA 004AF60C $- FF25 A0D95000 jmp dword ptr ds:[<&USER32.wsprintfW>] ; USER32.wsprintfW 004AF612 CC int3 004AF613 CC int3 004AF614 $- FF25 B8D95000 jmp dword ptr ds:[<&OLE32.CoCreateInstan>; OLE32.CoCreateInstance 004AF61A $- FF25 BCD95000 jmp dword ptr ds:[<&OLE32.CoInitialize>] ; OLE32.CoInitialize 004AF620 $- FF25 C0D95000 jmp dword ptr ds:[<&OLE32.CoUninitialize>; OLE32.CoUninitialize 004AF626 CC int3 004AF627 CC int3 004AF628 . 33 32 2D 62 6>ascii "32-bit analysing" 004AF638 . 20 64 65 62 7>ascii " debugger",0 004AF642 00 db 00 004AF643 00 db 00 004AF644 > 51 push ecx 004AF645 . 50 push eax 004AF646 . 57 push edi 004AF647 . 8B7C24 0C mov edi,dword ptr ss:[esp+C] 004AF64B . 8B4C24 14 mov ecx,dword ptr ss:[esp+14] 004AF64F . B8 25000000 mov eax,25 004AF654 > F2:AE repne scas byte ptr es:[edi] 004AF656 . 83F9 00 cmp ecx,0 004AF659 . 74 06 je short OD加强版.004AF661 004AF65B . C647 FF 20 mov byte ptr ds:[edi-1],20 004AF65F .^ EB F3 jmp short OD加强版.004AF654 004AF661 > 5F pop edi 004AF662 . 58 pop eax 004AF663 . 59 pop ecx 004AF664 . 83C4 10 add esp,10 004AF667 . 3BC3 cmp eax,ebx 004AF669 .^ E9 E31CF8FF jmp OD加强版.00431351 004AF66E 00 db 00 004AF66F . 70 6C 75 67 6>ascii "plugin",0 004AF676 55444400 dd OD加强版.00444455 004AF67A > 60 pushad 004AF67B . BF 68384D00 mov edi,OD加强版.004D3868 004AF680 . 33C0 xor eax,eax 004AF682 . 33C9 xor ecx,ecx 004AF684 . 49 dec ecx 004AF685 . F2:AE repne scas byte ptr es:[edi] 004AF687 . F7D9 neg ecx 004AF689 . 49 dec ecx 004AF68A . 51 push ecx 004AF68B . BF 00AE5000 mov edi,OD加强版.0050AE00 004AF690 . 68 68384D00 push OD加强版.004D3868 ; /String2 = "C:\Documents and Settings\Xinwm\桌面\OllyDbg" 004AF695 . 57 push edi ; |String1 => OD加强版.0050AE00 004AF696 . E8 93FBFFFF call <jmp.&KERNEL32.lstrcpyA> ; \lstrcpyA 004AF69B . 59 pop ecx 004AF69C . C64439 FF 5C mov byte ptr ds:[ecx+edi-1],5C 004AF6A1 . C60439 00 mov byte ptr ds:[ecx+edi],0 004AF6A5 . 81C7 00010000 add edi,100 004AF6AB . 51 push ecx 004AF6AC . 68 00AE5000 push OD加强版.0050AE00 ; /String2 = "" 004AF6B1 . 57 push edi ; |String1 => OD加强版.0050AF00 004AF6B2 . E8 77FBFFFF call <jmp.&KERNEL32.lstrcpyA> ; \lstrcpyA 004AF6B7 . 59 pop ecx 004AF6B8 . 51 push ecx 004AF6B9 . 68 6FF64A00 push OD加强版.004AF66F ; /String2 = "plugin" 004AF6BE . 81EF 00010000 sub edi,100 ; | 004AF6C4 . 03F9 add edi,ecx ; | 004AF6C6 . 57 push edi ; |String1 004AF6C7 . E8 62FBFFFF call <jmp.&KERNEL32.lstrcpyA> ; \lstrcpyA 004AF6CC . 90 nop 004AF6CD . 68 76F64A00 push OD加强版.004AF676 ; /String2 = "UDD" 004AF6D2 . 81C7 00010000 add edi,100 ; | 004AF6D8 . 57 push edi ; |String1 004AF6D9 . E8 50FBFFFF call <jmp.&KERNEL32.lstrcpyA> ; \lstrcpyA 004AF6DE . 68 A4534D00 push OD加强版.004D53A4 ; /FileName = "C:\Documents and Settings\Xinwm\桌面\OllyDbg\.ini" 004AF6E3 . 68 00AF5000 push OD加强版.0050AF00 ; |String = "" 004AF6E8 . 68 FD744B00 push OD加强版.004B74FD ; |Key = "UDD path" 004AF6ED . 68 7E744B00 push OD加强版.004B747E ; |Section = "History" 004AF6F2 . E8 25FBFFFF call <jmp.&KERNEL32.WritePrivateProfileS>; \WritePrivateProfileStringA 004AF6F7 . 68 A4534D00 push OD加强版.004D53A4 ; /FileName = "C:\Documents and Settings\Xinwm\桌面\OllyDbg\.ini" 004AF6FC . 68 00AE5000 push OD加强版.0050AE00 ; |String = "" 004AF701 . 68 06754B00 push OD加强版.004B7506 ; |Key = "Plugin path" 004AF706 . 68 7E744B00 push OD加强版.004B747E ; |Section = "History" 004AF70B . E8 0CFBFFFF call <jmp.&KERNEL32.WritePrivateProfileS>; \WritePrivateProfileStringA 004AF710 . 59 pop ecx 004AF711 . 51 push ecx 004AF712 . BF 00AE5000 mov edi,OD加强版.0050AE00 004AF717 . 83C1 07 add ecx,7 004AF71A . 33C0 xor eax,eax 004AF71C . F3:AA rep stos byte ptr es:[edi] 004AF71E . 59 pop ecx 004AF71F . 83C1 04 add ecx,4 004AF722 . BF 00AF5000 mov edi,OD加强版.0050AF00 004AF727 . 33C0 xor eax,eax 004AF729 . F3:AA rep stos byte ptr es:[edi] 004AF72B . 61 popad 004AF72C . 68 027F0000 push 7F02 004AF731 . 68 7B734300 push OD加强版.0043737B [COLOR="red"]004AF736 . C3 retn ; RET 用作跳转到 0043737B[/COLOR] 往下一直翻到出现第一个retn,所以我直接修改call <jmp.&USER32.SetWindowTextA>为NOP,但是用修改后的OD加载程序,多点几次快速加载,会弹出错误,不知道是不是我的修改问题,其他修改并没出现这样的错误。 如果最后出现的是“retn C070”,是不是要修改成“add esp,C070”? |
|
|
|
[求助]AdvancedOlly.dll问题求助?
我最近真是郁闷,前段时间两问题都解决了,今天再次测试,失败了~!我的地址和你的不一样! 004779B1 |. A3 705A4D00 mov dword ptr ds:[4D5A70],eax 004779B6 |. 8B95 20E4FFFF mov edx,[local.1784] 004779BC |. 8915 745A4D00 mov dword ptr ds:[4D5A74],edx 004779C2 |. 8B4D F0 mov ecx,[local.4] 004779C5 |. 51 push ecx 004779C6 |. 8D86 A5030000 lea eax,dword ptr ds:[esi+3A5] 004779CC |. 50 push eax 004779CD |. 8D96 8E090000 lea edx,dword ptr ds:[esi+98E] 004779D3 |. 52 push edx 004779D4 |. 8D8D E0FEFFFF lea ecx,[local.72] 004779DA |. 51 push ecx 004779DB |. E8 4CF20200 call OD加强版.004A6C2C 004779E0 |. 83C4 10 add esp,10 004779E3 |. 8D85 E0FEFFFF lea eax,[local.72] 004779E9 |. 50 push eax ; /Text 004779EA |. 8B15 7C3B4D00 mov edx,dword ptr ds:[4D3B7C] ; | 004779F0 |. 52 push edx ; |hWnd => 019F02D4 ('终结Θ者 - [PYG]',class='1212121') 004779F1 E8 C87B0300 call <jmp.&USER32.SetWindowTextA> 004779F6 |. C705 88574D00>mov dword ptr ds:[4D5788],1 00477A00 |. 33C9 xor ecx,ecx 是不是直接NOP掉啊? |
|
[求助]OllyDBG的标题汉化问题[附带目前网上很少的非标汉化工具破解版]
书呆彭版主,如果加载程序,标题还会变化 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值