;FASM汇编 自修改 SMC 代码测试
format pe console
entry start
include 'Win32AXP.inc'
;include 'List.inc'
section '.text' code readable writeable executable ;确保代码段有写入权限,必须的
start:
call f1
call f2
;memcpy(f1.Start,f2.Start,f2.CodeLen)
mov esi,f2.Start
mov edi,f1.Start
mov ecx,f2.End-f2.Start
rep movsb
;再次调用f1和f2
call f1
call f2
ret
f1:
.Start=$
cinvoke printf,buf1
ret
.End=$
;确保有足够的空间来存放f2的代码
repeat (f2.End-f2.Start)-(f1.End-f1.Start)
nop
end repeat
f2:
.Start=$
cinvoke printf,buf2
ret
.End=$
data import
library msvcrt,'msvcrt.dll'
import msvcrt,\
printf,'printf'
end data
buf1 db "SMC 前",0dh,0ah,0
buf2 db "SMC 后",0dh,0ah,0
[注意]APP应用上架合规检测服务,协助应用顺利上架!