在学习《软件加密技术内幕》第六章时看到壳的那部分有些有明白,求助
ShellStart0:
call next0
;********************
ImportTableBegin:
ImportTable DD AddressFirst-ImportTable
DD 0,0
AppImpRVA1 DD DllName-ImportTable
AppImpRVA2 DD AddressFirst-ImportTable
DD 0,0,0,0,0
AddressFirst DD FirstFunc-ImportTable
AddressSecond DD SecondFunc-ImportTable
AddressThird DD ThirdFunc-ImportTable
DD 0
DllName DB 'KERNEL32.dll'
DW 0
FirstFunc DW 0
DB 'GetProcAddress',0
SecondFunc DW 0
DB 'GetModuleHandleA',0
ThirdFunc DW 0
DB 'LoadLibraryA',0
ImportTableEnd:
ShellBase DD 0 ;保存外壳压缩部分相对于ShellStart0的偏移地址
ShellPackSize DD 0 ;保存外壳压缩部分的原始大小
Virtualalloc DB 'VirtualAlloc',0
VirtualallocADDR DD 0
TlsTable DB 18h dup (?) ;保存原始程序的TLS表
next0:
pop ebp
sub ebp,(ImportTable-ShellStart0) ;保存ShellStart0的地址
lea esi,[ebp+(DllName-ShellStart0)] ;指向KERNEL32.DLL
push esi
call dword ptr [ebp+(AddressSecond-ShellStart0)] ;取得DLL句柄
lea esi,[ebp+(Virtualalloc-ShellStart0)]
push esi
push eax
call dword ptr [ebp+(AddressFirst-ShellStart0)] ;取得VirtualAlloc函数入口
mov dword ptr [ebp+(VirtualallocADDR-ShellStart0)],eax
push PAGE_READWRITE
push MEM_COMMIT
push dword ptr [ebp+(ShellPackSize-ShellStart0)]
push 0
call dword ptr [ebp+(VirtualallocADDR-ShellStart0)] ;申请内存存入外壳第二段
push eax
mov ebx,dword ptr [ebp+(ShellBase-ShellStart0)]
add ebx,ebp
push eax
push ebx
call _aP_depack_asm
pop edx
push ebp ;保存第一段的基址,以便第二段中使用
jmp edx ;转到第二段继续执行
该如何理解ImportTable-ShellStart0这样的东西?
还有问下该如何理解 jmp $+3 ;call $+5类似这样语句中的$,新手,莫见笑。。。
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课