21,458
社区成员
发帖
与我相关
我的任务
分享
__asm
{
mov eax, fs:[0x30] ;point to PEB
mov eax, [eax + 0x0C] ;point to _PEB_LDR_DATA
mov eax, [eax + 0x0C] ;point to InLoadOrderModuleList
mov eax, [eax] ;InLoadOrderLinks of this process
mov eax, [eax] ;InLoadOrderLinks of ntdll address
mov eax, [eax + 0x18] ;DllBase of kernel32 address
mov edi,eax ;edi poin to kernel32
//mov ebp,esp;
//sub esp,100;
mov eax,[edi+3ch] ;edx point to pe header
mov edx,[edi+eax+78h] ;edx point to RVA of export table
add edx,edi ;edx point to VA of export table
mov ecx,[edx+18h] ;ecx point to the number of functions of export name table
mov ebx,[edx+20h] ;ebx point to RVA of export name table
add ebx,edi ;ebx point to VA of export name table
search:
dec ecx ;loop counter ecx minusitself
mov esi,[ebx+ecx*4] ;esi get RVA of function name from last
add esi, edi; ;esi get VA of it
mov eax,0x50746547 ;eax get PteG("GetP")
cmp [esi],eax ;compare [esi] with current block
jne search
mov eax,0x41636f72 ;eax get Acor("rocA")
cmp [esi+4],eax ;compare second half
jne search
mov ebx,[edx+24h] ;ebx point to RVA of export index table
add ebx,edi ;ebx point to VA of export index table
mov cx,[ebx+ecx*2] ;
mov ebx,[edx+1ch] ;ebx point to RVA of export address table
add ebx,edi ;ebx point to VA of export address table
mov eax,[ebx+ecx*4] ;eax point to RVA of function
add eax,edi ;eax point to VA of function
mov [ebp+76],eax ;restore somewhere
call GetProAddress:
push 0;
push DWORD PTR 0x57656C ; leW(" leA")
push DWORD PTR 0x69466574 ;iFet("teFi")
push DWORD PTR 0x61657243 ;aerC("Crea")
push esp
push edi
call [ebp+76]
mov [ebp+80],eax
call CreateFileA:
push 0
push 0
push 2
push 0
push 0
push 40000000h
push offset string "C:\\test\\test.txt"
call [ebp+80];
}
mov eax, [ebp+84]
mov ecx, 8
l_:
push eax
and al, 0fh
add al, '0'
cmp al, '9'
jna fors
add al, 7
fors:
mov bl,al; 保存或输出 al 中的字符
pop eax
ror eax, 4
push bl
loop l_
mov eax, [ebp+84]
mov ecx, 8
l_:
rol eax, 4
push eax
and al, 0fh
add al, '0'
cmp al, '9'
jna fors
add al, 7
fors:
push al; 保存或输出 al 中的字符
pop eax
loop l_
push 0x20656c69
push 0x20656c69
; many push
; 或者,可以象是这样?
mov eax, 76540000h
mov ecx, 8
l_:
rol eax, 4
push eax
and al, 0fh
add al, '0'
cmp al, '9'
jna @f
add al, 7
@@:
; 保存或输出 al 中的字符
pop eax
loop l_
; ...
01101436 mov esi,esp
01101438 push 0
0110143A push 0
0110143C push 2
0110143E push 0
01101440 push 0
01101442 push 40000000h
01101447 push offset string "c:\\test\\test.txt" (110573Ch)
CreateFileA("c:\\test\\test.txt",0x40000000L,0,0,2,0,0);
01101436 mov esi,esp
01101438 push 0
0110143A push 0
0110143C push 2
0110143E push 0
01101440 push 0
01101442 push 40000000h
01101447 push offset string "c:\\test\\test.txt" (110573Ch)
0110144C call dword ptr [__imp__CreateFileA@28 (11081A4h)]
01101452 cmp esi,esp
01101454 call @ILT+315(__RTC_CheckEsp) (1101140h)
01101436 mov esi,esp
01101438 push 0
0110143A push 0
0110143C push 2
0110143E push 0
01101440 push 0
01101442 push 40000000h
01101447 push offset string "c:\\test\\test.txt" (110573Ch)