@@firstpass2:
or cl,43h
mov edx,offset buffer1
xor [edx],cl
;invoke MessageBoxW,0,edx,edx,1
invoke SetDlgItemTextW,hWinMain,ID_PWD,edx
.else
mov ecx,offset buffer1
add ecx,PASSLEN
xor eax,eax
MOV [ECX],eax
invoke SetDlgItemTextA,hWinMain,ID_PWD,offset buffer1
invoke RtlZeroMemory,offset buffer1,128
.endif
ret
ViewPass endp
comment %
GetUnknowVarOffset proc uses esi edi ebx
LOCAL user32base:dword
LOCAL varaddr:dword
invoke LoadLibrary,offset user32dll
mov user32base,eax
invoke _ProcessPeFile,user32base ;返回user32.dll的.data段的虚拟偏移
invoke GetProcAddress,user32base,offset _UserRegisterWowHandlers
.if eax!=NULL
invoke RtlMoveMemory,offset buffercode,eax,1000
mov esi,offset buffercode
xor ebx,ebx
@@nextcode:
mov ax,word ptr [esi]
.if ax==08C2h
add esi,2
mov al,byte ptr[esi]
sub esi,2
.if al==00h
;--找到ret 08(C20800)后,倒过去找mov eax,xxxxxxxx (B8 xxxxxxxx)
sub esi,5
sub ebx,5
@@nextcode2:
mov al,byte ptr [esi]
.if al==0B8h
inc esi
mov eax,dword ptr [esi]
dec esi
mov varaddr,eax
.else
@@nextb8:
dec esi
dec ebx
.if ebx>1
jmp @@nextcode2
.else ;找不到mov eax,xxxxxxxx
invoke MessageBox,0,offset errnocode,offset vp,1
xor eax,eax
ret
.endif
.endif
.else
jmp @@findother
.endif
.else
@@findother:
inc ebx
inc esi
.if ebx<1000d
jmp @@nextcode
.else ;找不到ret 08指令
invoke MessageBox,0,offset errnocode,offset vp,1
xor eax,eax
ret
.endif
.endif
.else ;找不到函数
invoke MessageBox,0,offset errnowow,offset vp,1
xor eax,eax
ret
.endif
;正常情况varaddr为USER32.DLL全局变量中记录当前线程GUI TABLE R3层地址的变量的地址
mov ecx,user32base
add ecx,VirtualAddress ;得到内存中user32.dll的全局变量的起始地址
mov eax,varaddr
sub eax,ecx ;变量的地址减全局变量起始地址
..if eax>0 && eax<VirtualSize ;变量的偏移大于0,小于变局变量总大小
add eax,4
mov VarOffset,eax
.else
jmp @@nextb8
.endif
ret
GetUnknowVarOffset endp
上一页 1 2 3 4 5 6 7 8 9 10 下一页 |