反汇编_ClassCreate,jl+$03 为什么会跳到 xor edx,edx。(200分)

  • 主题发起人 主题发起人 skyjacker
  • 开始时间 开始时间
S

skyjacker

Unregistered / Unconfirmed
GUEST, unregistred user!
/*_ClassCreate src*/<br>function _ClassCreate(AClass: TClass; Alloc: Boolean): TObject;<br>asm<br> &nbsp; &nbsp; &nbsp; &nbsp;{ -&gt; &nbsp; &nbsp;EAX = pointer to VMT &nbsp; &nbsp; &nbsp;}<br> &nbsp; &nbsp; &nbsp; &nbsp;{ &lt;- &nbsp; &nbsp;EAX = pointer to instance }<br> &nbsp; &nbsp; &nbsp; &nbsp;PUSH &nbsp; &nbsp;EDX<br> &nbsp; &nbsp; &nbsp; &nbsp;PUSH &nbsp; &nbsp;ECX<br> &nbsp; &nbsp; &nbsp; &nbsp;PUSH &nbsp; &nbsp;EBX<br> &nbsp; &nbsp; &nbsp; &nbsp;TEST &nbsp; &nbsp;DL,DL<br> &nbsp; &nbsp; &nbsp; &nbsp;JL &nbsp; &nbsp; &nbsp;@@noAlloc &nbsp;//jl +$03 &nbsp; ? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br> &nbsp; &nbsp; &nbsp; &nbsp;CALL &nbsp; &nbsp;dword ptr [EAX].vmtNewInstance<br>@@noAlloc:<br>{$IFNDEF PC_MAPPED_EXCEPTIONS}<br> &nbsp; &nbsp; &nbsp; &nbsp;XOR &nbsp; &nbsp; EDX,EDX<br> &nbsp; &nbsp; &nbsp; &nbsp;LEA &nbsp; &nbsp; ECX,[ESP+16]<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; EBX,FS:[EDX]<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; [ECX].TExcFrame.next,EBX<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; [ECX].TExcFrame.hEBP,EBP<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; [ECX].TExcFrame.desc,offset @desc<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; [ECX].TexcFrame.ConstructedObject,EAX &nbsp; { trick: remember copy to instance <br><br>}<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; FS:[EDX],ECX<br>{$ENDIF}<br> &nbsp; &nbsp; &nbsp; &nbsp;POP &nbsp; &nbsp; EBX<br> &nbsp; &nbsp; &nbsp; &nbsp;POP &nbsp; &nbsp; ECX<br> &nbsp; &nbsp; &nbsp; &nbsp;POP &nbsp; &nbsp; EDX<br> &nbsp; &nbsp; &nbsp; &nbsp;RET<br><br>{$IFNDEF PC_MAPPED_EXCEPTIONS}<br>@desc:<br> &nbsp; &nbsp; &nbsp; &nbsp;JMP &nbsp; &nbsp; _HandleAnyException<br><br> &nbsp;{ &nbsp; &nbsp; &nbsp; destroy the object &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<br><br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; EAX,[ESP+8+9*4]<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; EAX,[EAX].TExcFrame.ConstructedObject<br> &nbsp; &nbsp; &nbsp; &nbsp;TEST &nbsp; &nbsp;EAX,EAX<br> &nbsp; &nbsp; &nbsp; &nbsp;JE &nbsp; &nbsp; &nbsp;@@skip<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; ECX,[EAX]<br> &nbsp; &nbsp; &nbsp; &nbsp;MOV &nbsp; &nbsp; DL,$81<br> &nbsp; &nbsp; &nbsp; &nbsp;PUSH &nbsp; &nbsp;EAX<br> &nbsp; &nbsp; &nbsp; &nbsp;CALL &nbsp; &nbsp;dword ptr [ECX].vmtDestroy<br> &nbsp; &nbsp; &nbsp; &nbsp;POP &nbsp; &nbsp; EAX<br> &nbsp; &nbsp; &nbsp; &nbsp;CALL &nbsp; &nbsp;_ClassDestroy<br>@@skip:<br> &nbsp;{ &nbsp; &nbsp; &nbsp; reraise the exception &nbsp; }<br> &nbsp; &nbsp; &nbsp; &nbsp;CALL &nbsp; &nbsp;_RaiseAgain<br>{$ENDIF}<br>end;<br><br>/*运行过程中,反汇编*/<br><br>0040382B C3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret <br>0040382C 52 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push edx<br>0040382D 51 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push ecx<br>0040382E 53 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push ebx<br>0040382F 84D2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; test dl,dl<br>00403831 7C03 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jl +$03 &nbsp; //加 3 后,为什么会跳到 xor edx,edx,怎样计算的?<br>00403833 FF50F4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call dword ptr [eax-$0c]<br>00403836 31D2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xor edx,edx<br>00403838 8D4C2410 &nbsp; &nbsp; &nbsp; &nbsp; lea ecx,[esp+$10]<br>0040383C 648B1A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ebx,fs:[edx]<br>0040383F 8919 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov [ecx],ebx<br>00403841 896908 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov [ecx+$08],ebp<br>00403844 C7410455384000 &nbsp; mov [ecx+$04],$00403855<br>0040384B 89410C &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov [ecx+$0c],eax<br>0040384E 64890A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov fs:[edx],ecx<br>00403851 5B &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pop ebx<br>00403852 59 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pop ecx<br>00403853 5A &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pop edx<br>00403854 C3 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret <br>00403855 E94E010000 &nbsp; &nbsp; &nbsp; jmp @HandleAnyException<br>0040385A 8B44242C &nbsp; &nbsp; &nbsp; &nbsp; mov eax,[esp+$2c]<br>0040385E 8B400C &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov eax,[eax+$0c]<br>00403861 85C0 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; test eax,eax<br>00403863 740E &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jz +$0e<br>00403865 8B08 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov ecx,[eax]<br>00403867 B281 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mov dl,$81<br>00403869 50 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; push eax<br>0040386A FF51FC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call dword ptr [ecx-$04]<br>0040386D 58 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pop eax<br>0040386E E809000000 &nbsp; &nbsp; &nbsp; call @ClassDestroy<br><br><br>jl +$03 段 在计算机中的字节实际如下排列:<br><br>00403831 7C<br>00403832 03 &nbsp;; jl +$03 <br>00403833 FF<br>00403834 50<br>00403835 F4 &nbsp;; call dword ptr [eax-$0c]<br>00403836 31 &nbsp;<br>00403837 D2 &nbsp;; xor edx,edx<br>00403838 85 <br><br>jl+$03 为什么会跳到 xor edx,edx,怎样计算的,起始地址是多少呢?
 
00403831 7C03 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; jl +$03 &nbsp; //加 3 后,为什么会跳到 xor edx,edx,怎样计算的?<br>00403833 FF50F4 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; call dword ptr [eax-$0c]<br>00403836 31D2 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; xor edx,edx<br>呵呵,<br>// jl的地址00403831 &nbsp;jl + $03 Op也就是7C03了, 占2个字节 也就是31,32由7C03填起<br>// 如果小于,跳到他后面的3个字节处阿 31, 32 下一个是不是33吗? <br>// 33,34,35有 FF50F4 OP填起代表call dword ptr [eax-$0c]<br>// 要跳到下一句后面3个不就是36吗? 36, 37有31D2填起,也就是xor edx,edx<br><br>明白?
 

Similar threads

A
回复
0
查看
1K
Andreas Hausladen
A
I
回复
0
查看
699
import
I
I
回复
0
查看
739
import
I
I
回复
0
查看
805
import
I
I
回复
0
查看
719
import
I
后退
顶部