【分享】常见五种语言OEP代码,与新手学习
BC++ 也就是C++ Builder,查壳可能报的是Borland C++ 1999
0040163C B> /EB 10 jmp short Borland_.0040164E
0040163E |66:623A bound di,dword ptr ds:[edx]
00401641 |43 inc ebx
00401642 |2B2B sub ebp,dword ptr ds:[ebx]
00401644 |48 dec eax
00401645 |4F dec edi
00401646 |4F dec edi
00401647 |4B dec ebx
00401648 |90 nop
00401649 -|E9 98E04E00 jmp SHELL32.008EF6E6
0040164E \A1 8BE04E00 mov eax,dword ptr ds:[4EE08B]
00401653 C1E0 02 shl eax,2
00401656 A3 8FE04E00 mov dword ptr ds:[4EE08F],eax
0040165B 52 push edx
0040165C 6A 00 push 0
0040165E E8 DFBC0E00 call <jmp.&KERNEL32.GetModuleHandleA>
Delphi
00458650 D> 55 push ebp
00458651 8BEC mov ebp,esp
00458653 83C4 F0 add esp,-10
00458656 B8 70844500 mov eax,Delphi.00458470
0045865B E8 00D6FAFF call Delphi.00405C60
00458660 A1 58A14500 mov eax,dword ptr ds:[45A158]
00458665 8B00 mov eax,dword ptr ds:[eax]
00458667 E8 E0E1FFFF call Delphi.0045684C
0045866C A1 58A14500 mov eax,dword ptr ds:[45A158]
00458671 8B00 mov eax,dword ptr ds:[eax]
00458673 BA B0864500 mov edx,Delphi.004586B0
00458678 E8 DFDDFFFF call Delphi.0045645C
0045867D 8B0D 48A24500 mov ecx,dword ptr ds:[45A248] ; Delphi.0045BC00
00458683 A1 58A14500 mov eax,dword ptr ds:[45A158]
00458688 8B00 mov eax,dword ptr ds:[eax]
0045868A 8B15 EC7D4500 mov edx,dword ptr ds:[457DEC] ; Delphi.00457E38
00458690 E8 CFE1FFFF call Delphi.00456864
00458695 A1 58A14500 mov eax,dword ptr ds:[45A158]
0045869A 8B00 mov eax,dword ptr ds:[eax]
0045869C E8 43E2FFFF call Delphi.004568E4
Visual C++
0046C07B U> 55 push ebp
0046C07C 8BEC mov ebp,esp
0046C07E 6A FF push -1
0046C080 68 18064C00 push UltraSna.004C0618
0046C085 68 F8364700 push UltraSna.004736F8
0046C08A 64:A1 00000000 mov eax,dword ptr fs:[0]
0046C090 50 push eax
0046C091 64:8925 00000000 mov dword ptr fs:[0],esp
0046C098 83EC 58 sub esp,58
0046C09B 53 push ebx
0046C09C 56 push esi
0046C09D 57 push edi
0046C09E 8965 E8 mov dword ptr ss:[ebp-18],esp
0046C0A1 FF15 74824A00 call dword ptr ds:[<&KERNEL32.GetVersion>] ; kernel32.GetVersion
0046C0A7 33D2 xor edx,edx
0046C0A9 8AD4 mov dl,ah
0046C0AB 8915 403F4F00 mov dword ptr ds:[4F3F40],edx
0046C0B1 8BC8 mov ecx,eax
0046C0B3 81E1 FF000000 and ecx,0FF
0046C0B9 890D 3C3F4F00 mov dword ptr ds:[4F3F3C],ecx
VB
0040116C V>/$ 68 147C4000 push VB.00407C14
00401171 |. E8 F0FFFFFF call <jmp.&MSVBVM60.#100>
00401176 |. 0000 add byte ptr ds:[eax],al
00401178 |. 0000 add byte ptr ds:[eax],al
0040117A |. 0000 add byte ptr ds:[eax],al
0040117C |. 3000 xor byte ptr ds:[eax],al
汇编
00401000 汇> 6A 00 push 0
00401002 E8 C50A0000 call <jmp.&KERNEL32.GetModuleHandleA>
00401007 A3 0C354000 mov dword ptr ds:[40350C],eax
0040100C E8 B50A0000 call <jmp.&KERNEL32.GetCommandLineA>
00401011 A3 10354000 mov dword ptr ds:[403510],eax
00401016 6A 0A push 0A
00401018 FF35 10354000 push dword ptr ds:[403510]
0040101E 6A 00 push 0
00401020 FF35 0C354000 push dword ptr ds:[40350C]
00401026 E8 06000000 call 汇编.00401031
0040102B 50 push eax
0040102C E8 8F0A0000 call <jmp.&KERNEL32.ExitProcess>
00401031 55 push ebp
00401032 8BEC mov ebp,esp
00401034 83C4 B0 add esp,-50
00401037 C745 D0 30000000 mov dword ptr ss:[ebp-30],30
0040103E C745 D4 0B000000 mov dword ptr ss:[ebp-2C],0B
00401045 C745 D8 37114000 mov dword ptr ss:[ebp-28],汇编.00401137
可以利用上面5种常见的语言特征来判断是否达到了OEP
也可以看是否是大跨段来判断是否到达OEP
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)