[Asm] 纯文本查看 复制代码
extern getenv
extern sprintf
extern MessageBoxA
extern CreateFileA
extern WriteFile
extern ReadFile
extern SetFilePointer
extern GetLastError
extern ExitProcess
%imacro invoke 1-*
%define %%api %1
%rotate -1
%rep %0-1
%rotate -1
push DWORD %2
%endrep
call %%api
%endmacro
GENERIC_WRITE equ 0x40000000
GENERIC_READ equ 0x80000000
CREATE_ALWAYS equ 2
OPEN_ALWAYS equ 4
FILE_ATTRIBUTE_NORMAL equ 0x80
section .text
_main:
invoke getenv,env
add esp,4
invoke sprintf,buf,fmt,eax
add esp,12
mov eax,GENERIC_WRITE
or eax,GENERIC_READ
xor ebx,ebx
invoke CreateFileA,buf,eax,ebx,ebx,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL,ebx
cmp eax,-1
je operr
mov [hFile],eax
call seek
invoke ReadFile,[hFile],rbuf,13,dwRead,0
test eax,eax
je rderr
invoke sprintf,buf,info,rbuf
add esp,12
invoke MessageBoxA,0,buf,about,1
cmp eax,1
jne exit
call seek
invoke WriteFile,[hFile],patch,2,dwWrite,0
test eax,eax
je rderr
invoke MessageBoxA,0,info2,about,1
cmp eax,1
jne exit
xor ebx,ebx
invoke SetFilePointer,[hFile],0x1DB3A11,ebx,ebx
invoke WriteFile,[hFile],patch2,19,dwWrite,0
test eax,eax
je rderr
jmp exit
operr:
invoke MsgBox,err
jmp exit
rderr:
call GetLastError
invoke sprintf,buf,lsterr,err2,eax
add esp,16
invoke MsgBox,buf
exit:
invoke ExitProcess,0
ret
seek:
xor ebx,ebx
invoke SetFilePointer,[hFile],0x1DB3A38,ebx,ebx
ret
MsgBox:
push ebp
mov ebp,esp
xor ebx,ebx
invoke MessageBoxA,ebx,[ebp+8],ebx,ebx
pop ebp
retn 4
section .data
env db 'LOCALAPPDATA',0
fmt db '%s\MapleStudio\ChromePlus\Application\2.0.9.20\chrome.dll',0
err db '文件被锁定或无权限打开,请关闭浏览器',0
err2 db '文件读取错误',0
info db '检测到 Flash 版本号 %s,如显示异常请勿补丁',0
info2 db '是否补丁上浏览器 UA 伪装成更高版本的 Chrome',0
about db 'ChromeFlashPatch -by JuncoJet',0
lsterr db '%s %d',0
patch db '99',0
patch2 db 'Chrome/45.0.1453.1',0
section .bss
buf resb 260
rbuf resb 14
dwRead resd 1
dwWrite resd 1
hFile resd 1