魔恩:如何找CALL参数[esp/ebp+*]来源与局部变量[ebp-*]来源

本文介绍了一种在汇编语言中定位CALL指令参数的方法,详细解释了如何通过ESP寄存器的不同偏移找到对应的参数,并针对特殊情况提供了解决方案,如使用条件断点处理立即断下的情形,以及如何寻找较大偏移量的参数来源。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

找这种:MOV EBX,DWORD PTR SS:[ESP+10]  的来源,
要知道:[esp/ebp+8]  是CALL的第一个参数
        [esp/ebp+0c] 是CALL的第二个参数
        [esp/ebp+10] 是CALL的第三个参数
     类推,每次都是加4,因为push 占用4字节。

找法的话,通过找上一层CALL的参数,例如:[esp+8] 是上一层第一个参数,就返回上层,分析CALL的第一
个参数,可以通过对比[esp+8]的值与CALL的参数值 相同就说明对了。
====================================
例外情况#1

这种情况是 当你返回上一层分析CALL参数的时候,下断立即就断下,是无法对比[esp+8]的值的,
解决的话:需要使用条件断点shift+F2,这技术在我们的第四款二叉树游戏辅助课程有教授。
====================
如何下多条件断点:

请学习VIP绝密课程:
【VIP绝密教程】多重过滤心跳包技术解决断太快与断后返回相同数据。
VIP绝密教程入口:http://www.moguizuofang.com/bbs/forum-47-1.html
======================================
例外情况#2
MOV EBX,DWORD PTR SS:[esp+50] 
像这种比较大的偏移的时候,找来源考虑找整体,往上找像:
mov [esp+50],ecx  这类的语句,这时候就是往上找ECX了。
=====================================
如何找
mov eax,[ebp-4]/[ebp-8]/[ebp-0c] 等
的来源

请学习VIP绝密课程:【VIP绝密教程】教你如何找局部变量的来源?
VIP绝密教程入口:http://www.moguizuofang.com/bbs/forum-47-1.html

int __thiscall sub_10001000(_DWORD *this) { _DWORD *v1; // edx signed int v2; // ecx unsigned int v3; // eax int v5; // [esp+0h] [ebp-98h] int v6; // [esp+4h] [ebp-94h] int v7; // [esp+8h] [ebp-90h] int v8; // [esp+Ch] [ebp-8Ch] int v9; // [esp+10h] [ebp-88h] int v10; // [esp+14h] [ebp-84h] int v11; // [esp+18h] [ebp-80h] int v12; // [esp+1Ch] [ebp-7Ch] int v13; // [esp+20h] [ebp-78h] int v14; // [esp+24h] [ebp-74h] int v15; // [esp+28h] [ebp-70h] int v16; // [esp+2Ch] [ebp-6Ch] int v17; // [esp+30h] [ebp-68h] int v18; // [esp+34h] [ebp-64h] int v19; // [esp+38h] [ebp-60h] int v20; // [esp+3Ch] [ebp-5Ch] int v21; // [esp+40h] [ebp-58h] int v22; // [esp+44h] [ebp-54h] int v23; // [esp+48h] [ebp-50h] int v24; // [esp+4Ch] [ebp-4Ch] int v25; // [esp+50h] [ebp-48h] int v26; // [esp+54h] [ebp-44h] int v27; // [esp+58h] [ebp-40h] int v28; // [esp+5Ch] [ebp-3Ch] int v29; // [esp+60h] [ebp-38h] int v30; // [esp+64h] [ebp-34h] int v31; // [esp+68h] [ebp-30h] int v32; // [esp+6Ch] [ebp-2Ch] int v33; // [esp+70h] [ebp-28h] int v34; // [esp+74h] [ebp-24h] int v35; // [esp+78h] [ebp-20h] int v36; // [esp+7Ch] [ebp-1Ch] int v37; // [esp+80h] [ebp-18h] int v38; // [esp+84h] [ebp-14h] int v39; // [esp+88h] [ebp-10h] int v40; // [esp+8Ch] [ebp-Ch] int v41; // [esp+90h] [ebp-8h] __int16 v42; // [esp+94h] [ebp-4h] v1 = this; v5 = 904656733; v2 = 150; v6 = 945984154; v7 = 925490322; v8 = 1975671264; v3 = v1[38]; v9 = -1053814971; if ( v3 < 0x96 ) v2 = v3; v10 = -104732444; v11 = -785623118; v12 = -774160856; v13 = -1651896261; v14 = 2031170445; v15 = 209627365; v16 = 1684532701; v17 = 998187738; v18 = 2036755521; v19 = -87648280; v20 = -1868824629; v21 = 1288876033; v22 = -115946258; v23 = -353948231; v24 = -152286208; v25 = -1064672821; v26 = 1018547391; v27 = 1845933205; v28 = 1963912906; v29 = -907337577; v30 = -1055381981; v31 = 1485485304; v32 = 821575091; v33 = -679865344; v34 = 1247138502; v35 = -1223297121; v36 = -2015505269; v37 = -1661163291; v38 = -675280490; v39 = -561019512; v40 = 473139806; v41 = 158761826; v42 = 17598; return sub_10002B60(v1, &v5, v2); }给你sub_10001000
最新发布
07-14
?getFunctionIndirectType@UnDecorator@@CA?AVDName@@ABV2@@Z proc near .text:100F8C1E ; CODE XREF: UnDecorator::getPrimaryDataType(DName const &)+13C↓p .text:100F8C1E ; UnDecorator::getPtrRefType(DName const &,DName const &,char const *)+63↓p .text:100F8C1E .text:100F8C1E var_38 = DName ptr -38h .text:100F8C1E var_30 = DName ptr -30h .text:100F8C1E returnType = DName ptr -28h .text:100F8C1E var_20 = DName ptr -20h .text:100F8C1E rd = DName ptr -18h .text:100F8C1E thisType = DName ptr -10h .text:100F8C1E fitType = DName ptr -8 .text:100F8C1E result = dword ptr 8 .text:100F8C1E superType = dword ptr 0Ch .text:100F8C1E .text:100F8C1E push ebp .text:100F8C1F mov ebp, esp .text:100F8C21 mov ecx, ?gName@UnDecorator@@0PBDB ; char const * const UnDecorator::gName .text:100F8C27 sub esp, 38h .text:100F8C2A mov al, [ecx] .text:100F8C2C test al, al .text:100F8C2E jnz short loc_100F8C48 .text:100F8C30 push [ebp+superType] ; rd .text:100F8C33 push 1 ; st .text:100F8C35 push [ebp+result] ; result .text:100F8C38 call ??H@YA?AVDName@@W4DNameStatus@@ABV0@@Z ; operator+(DNameStatus,DName const &) .text:100F8C3D add esp, 0Ch .text:100F8C40 .text:100F8C40 loc_100F8C40: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+40↓j .text:100F8C40 mov eax, [ebp+result] .text:100F8C43 jmp loc_100F9023 .text:100F8C48 ; --------------------------------------------------------------------------- .text:100F8C48 .text:100F8C48 loc_100F8C48: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+10↑j .text:100F8C48 cmp al, 36h ; '6' .text:100F8C4A jl short loc_100F8C50 .text:100F8C4C cmp al, 39h ; '9' .text:100F8C4E jle short loc_100F8C60 .text:100F8C50 .text:100F8C50 loc_100F8C50: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+2C↑j .text:100F8C50 cmp al, 5Fh ; '_' .text:100F8C52 jz short loc_100F8C60 .text:100F8C54 mov ecx, [ebp+result] ; this .text:100F8C57 push 2 ; st .text:100F8C59 call ??0DName@@QAE@W4DNameStatus@@@Z ; DName::DName(DNameStatus) .text:100F8C5E jmp short loc_100F8C40 .text:100F8C60 ; --------------------------------------------------------------------------- .text:100F8C60 .text:100F8C60 loc_100F8C60: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+30↑j .text:100F8C60 ; UnDecorator::getFunctionIndirectType(DName const &)+34↑j .text:100F8C60 push ebx .text:100F8C61 movsx ebx, al .text:100F8C64 sub ebx, 36h ; '6' .text:100F8C67 inc ecx .text:100F8C68 mov ?gName@UnDecorator@@0PBDB, ecx ; char const * const UnDecorator::gName .text:100F8C6E cmp ebx, 29h ; ')' .text:100F8C71 jnz short loc_100F8CA2 .text:100F8C73 mov al, [ecx] .text:100F8C75 test al, al .text:100F8C77 jz short loc_100F8C90 .text:100F8C79 movsx ebx, al .text:100F8C7C sub ebx, 3Dh ; '=' .text:100F8C7F inc ecx .text:100F8C80 mov ?gName@UnDecorator@@0PBDB, ecx ; char const * const UnDecorator::gName .text:100F8C86 cmp ebx, 4 .text:100F8C89 jl short loc_100F8CAB .text:100F8C8B cmp ebx, 7 .text:100F8C8E jmp short loc_100F8CA9 .text:100F8C90 ; --------------------------------------------------------------------------- .text:100F8C90 .text:100F8C90 loc_100F8C90: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+59↑j .text:100F8C90 push [ebp+superType] ; rd .text:100F8C93 push 1 ; st .text:100F8C95 push [ebp+result] ; result .text:100F8C98 call ??H@YA?AVDName@@W4DNameStatus@@ABV0@@Z ; operator+(DNameStatus,DName const &) .text:100F8C9D add esp, 0Ch .text:100F8CA0 jmp short loc_100F8CBD .text:100F8CA2 ; --------------------------------------------------------------------------- .text:100F8CA2 .text:100F8CA2 loc_100F8CA2: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+53↑j .text:100F8CA2 test ebx, ebx .text:100F8CA4 js short loc_100F8CAB .text:100F8CA6 cmp ebx, 3 .text:100F8CA9 .text:100F8CA9 loc_100F8CA9: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+70↑j .text:100F8CA9 jle short loc_100F8CAE .text:100F8CAB .text:100F8CAB loc_100F8CAB: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+6B↑j .text:100F8CAB ; UnDecorator::getFunctionIndirectType(DName const &)+86↑j .text:100F8CAB or ebx, 0FFFFFFFFh .text:100F8CAE .text:100F8CAE loc_100F8CAE: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &):loc_100F8CA9↑j .text:100F8CAE cmp ebx, 0FFFFFFFFh .text:100F8CB1 jnz short loc_100F8CC5 .text:100F8CB3 mov ecx, [ebp+result] ; this .text:100F8CB6 push 2 ; st .text:100F8CB8 call ??0DName@@QAE@W4DNameStatus@@@Z ; DName::DName(DNameStatus) .text:100F8CBD .text:100F8CBD loc_100F8CBD: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+82↑j .text:100F8CBD mov eax, [ebp+result] .text:100F8CC0 jmp loc_100F9022 .text:100F8CC5 ; --------------------------------------------------------------------------- .text:100F8CC5 .text:100F8CC5 loc_100F8CC5: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+93↑j .text:100F8CC5 and [ebp+thisType.node], 0 .text:100F8CC9 and dword ptr [ebp+thisType._bf_4], 0FFFF0000h .text:100F8CD0 push esi .text:100F8CD1 mov esi, [ebp+superType] .text:100F8CD4 push edi .text:100F8CD5 mov edi, ebx .text:100F8CD7 mov eax, [esi] .text:100F8CD9 mov [ebp+fitType.node], eax .text:100F8CDC mov eax, [esi+4] .text:100F8CDF mov dword ptr [ebp+fitType._bf_4], eax .text:100F8CE2 and edi, 2 .text:100F8CE5 jz loc_100F8DD7 .text:100F8CEB cmp byte ptr [ecx], 40h ; '@' .text:100F8CEE jz loc_100F8D96 .text:100F8CF4 lea eax, [ebp+fitType] .text:100F8CF7 push eax ; rd .text:100F8CF8 lea eax, [ebp+rd] .text:100F8CFB push eax ; result .text:100F8CFC push offset asc_10131938 ; "::" .text:100F8D01 lea ecx, [ebp+var_20] ; this .text:100F8D04 call ??0DName@@QAE@PBD@Z ; DName::DName(char const *) .text:100F8D09 mov ecx, eax ; this .text:100F8D0B call ??HDName@@QBE?AV0@ABV0@@Z ; DName::operator+(DName const &) .text:100F8D10 mov eax, [ebp+rd.node] .text:100F8D13 mov [ebp+fitType.node], eax .text:100F8D16 mov eax, dword ptr [ebp+rd._bf_4] .text:100F8D19 mov dword ptr [ebp+fitType._bf_4], eax .text:100F8D1C mov eax, ?gName@UnDecorator@@0PBDB ; char const * const UnDecorator::gName .text:100F8D21 cmp byte ptr [eax], 0 .text:100F8D24 jz short loc_100F8D69 .text:100F8D26 lea eax, [ebp+var_30] .text:100F8D29 push eax ; result .text:100F8D2A call ?getScope@UnDecorator@@CA?AVDName@@XZ ; UnDecorator::getScope(void) .text:100F8D2F pop ecx .text:100F8D30 push eax ; rd .text:100F8D31 lea eax, [ebp+var_20] .text:100F8D34 push eax ; result .text:100F8D35 push 20h ; ' ' ; ch .text:100F8D37 lea ecx, [ebp+var_38] ; this .text:100F8D3A call ??4DName@@QAEAAV0@D@Z ; DName::operator=(char) .text:100F8D3F mov ecx, eax ; this .text:100F8D41 call ??HDName@@QBE?AV0@ABV0@@Z ; DName::operator+(DName const &) .text:100F8D46 mov eax, [ebp+var_20.node] .text:100F8D49 lea ecx, [ebp+rd] ; this .text:100F8D4C mov [ebp+rd.node], eax .text:100F8D4F mov eax, dword ptr [ebp+var_20._bf_4] .text:100F8D52 mov dword ptr [ebp+rd._bf_4], eax .text:100F8D55 lea eax, [ebp+fitType] .text:100F8D58 push eax ; rd .text:100F8D59 call ??YDName@@QAEAAV0@ABV0@@Z ; DName::operator+=(DName const &) .text:100F8D5E mov eax, [ebp+rd.node] .text:100F8D61 mov [ebp+fitType.node], eax .text:100F8D64 mov eax, dword ptr [ebp+rd._bf_4] .text:100F8D67 jmp short loc_100F8D8B .text:100F8D69 ; --------------------------------------------------------------------------- .text:100F8D69 .text:100F8D69 loc_100F8D69: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+106↑j .text:100F8D69 lea eax, [ebp+fitType] .text:100F8D6C push eax ; rd .text:100F8D6D lea eax, [ebp+var_20] .text:100F8D70 push eax ; result .text:100F8D71 push 1 ; st .text:100F8D73 lea ecx, [ebp+var_38] ; this .text:100F8D76 call ??0DName@@QAE@W4DNameStatus@@@Z ; DName::DName(DNameStatus) .text:100F8D7B mov ecx, eax ; this .text:100F8D7D call ??HDName@@QBE?AV0@ABV0@@Z ; DName::operator+(DName const &) .text:100F8D82 mov eax, [ebp+var_20.node] .text:100F8D85 mov [ebp+fitType.node], eax .text:100F8D88 mov eax, dword ptr [ebp+var_20._bf_4] .text:100F8D8B .text:100F8D8B loc_100F8D8B: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+149↑j .text:100F8D8B mov ecx, ?gName@UnDecorator@@0PBDB ; char const * const UnDecorator::gName .text:100F8D91 mov dword ptr [ebp+fitType._bf_4], eax .text:100F8D94 jmp short loc_100F8D9D .text:100F8D96 ; --------------------------------------------------------------------------- .text:100F8D96 .text:100F8D96 loc_100F8D96: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+D0↑j .text:100F8D96 inc ecx .text:100F8D97 mov ?gName@UnDecorator@@0PBDB, ecx ; char const * const UnDecorator::gName .text:100F8D9D .text:100F8D9D loc_100F8D9D: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+176↑j .text:100F8D9D mov al, [ecx] .text:100F8D9F test al, al .text:100F8DA1 jz loc_100F8E4B .text:100F8DA7 cmp al, 40h ; '@' .text:100F8DA9 jnz loc_100F8E44 .text:100F8DAF mov eax, ?disableFlags@UnDecorator@@0KA ; ulong UnDecorator::disableFlags .text:100F8DB4 inc ecx .text:100F8DB5 and eax, 60h .text:100F8DB8 mov ?gName@UnDecorator@@0PBDB, ecx ; char const * const UnDecorator::gName .text:100F8DBE cmp al, 60h ; '`' .text:100F8DC0 lea eax, [ebp+var_38] .text:100F8DC3 push eax ; result .text:100F8DC4 jz short loc_100F8E33 .text:100F8DC6 call ?getThisType@UnDecorator@@CA?AVDName@@XZ ; UnDecorator::getThisType(void) .text:100F8DCB pop ecx .text:100F8DCC mov ecx, [eax] .text:100F8DCE mov eax, [eax+4] .text:100F8DD1 mov [ebp+thisType.node], ecx .text:100F8DD4 mov dword ptr [ebp+thisType._bf_4], eax .text:100F8DD7 .text:100F8DD7 loc_100F8DD7: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+C7↑j .text:100F8DD7 ; UnDecorator::getFunctionIndirectType(DName const &)+224↓j .text:100F8DD7 test bl, 4 .text:100F8DDA jz loc_100F8E77 .text:100F8DE0 mov eax, ?disableFlags@UnDecorator@@0KA ; ulong UnDecorator::disableFlags .text:100F8DE5 shr eax, 1 .text:100F8DE7 not eax .text:100F8DE9 test al, 1 .text:100F8DEB lea eax, [ebp+var_38] .text:100F8DEE push eax ; result .text:100F8DEF jz short loc_100F8E68 .text:100F8DF1 call ?getBasedType@UnDecorator@@CA?AVDName@@XZ ; UnDecorator::getBasedType(void) .text:100F8DF6 pop ecx .text:100F8DF7 push eax ; rd .text:100F8DF8 lea eax, [ebp+var_20] .text:100F8DFB push eax ; result .text:100F8DFC push 20h ; ' ' ; ch .text:100F8DFE lea ecx, [ebp+var_30] ; this .text:100F8E01 call ??4DName@@QAEAAV0@D@Z ; DName::operator=(char) .text:100F8E06 mov ecx, eax ; this .text:100F8E08 call ??HDName@@QBE?AV0@ABV0@@Z ; DName::operator+(DName const &) .text:100F8E0D mov eax, [ebp+var_20.node] .text:100F8E10 lea ecx, [ebp+rd] ; this .text:100F8E13 mov [ebp+rd.node], eax .text:100F8E16 mov eax, dword ptr [ebp+var_20._bf_4] .text:100F8E19 mov dword ptr [ebp+rd._bf_4], eax .text:100F8E1C lea eax, [ebp+fitType] .text:100F8E1F push eax ; rd .text:100F8E20 call ??YDName@@QAEAAV0@ABV0@@Z ; DName::operator+=(DName const &) .text:100F8E25 mov eax, [ebp+rd.node] .text:100F8E28 mov [ebp+fitType.node], eax .text:100F8E2B mov eax, dword ptr [ebp+rd._bf_4] .text:100F8E2E mov dword ptr [ebp+fitType._bf_4], eax .text:100F8E31 jmp short loc_100F8E77 .text:100F8E33 ; --------------------------------------------------------------------------- .text:100F8E33 .text:100F8E33 loc_100F8E33: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+1A6↑j .text:100F8E33 call ?getThisType@UnDecorator@@CA?AVDName@@XZ ; UnDecorator::getThisType(void) .text:100F8E38 pop ecx .text:100F8E39 push eax ; rd .text:100F8E3A lea ecx, [ebp+thisType] ; this .text:100F8E3D call ??_5DName@@QAEAAV0@ABV0@@Z ; DName::operator=|(DName const &) .text:100F8E42 jmp short loc_100F8DD7 .text:100F8E44 ; --------------------------------------------------------------------------- .text:100F8E44 .text:100F8E44 loc_100F8E44: ; CODE XREF: UnDecorator::getFunctionIndirectType(DName const &)+18B↑j .text:100F8E44 push 2 .text:100F8E46 jmp loc_100F9015 .text:100F8E4B ; --------------------------------------------------------------------------- .text:100F8E4B 解析一下这反编译函数是什么意思 一句一句解析
07-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值