改进自楼下这个代码,适合内联进C/C++等编译器
[原创]SysWOW64的奇技淫巧
https://www.52pojie.cn/thread-1232264-1-1.html
(出处: 吾爱破解论坛)
演示程序 MASMPlus + FASM
[Asm] 纯文本查看 复制代码 .386.model flat, stdcall ;32 bit memory model
option casemap :none ;case sensitive
Include user32.inc
IncludeLib user32.lib
Include kernel32.inc
IncludeLib kernel32.lib
Include libc.inc
IncludeLib msvcrt.lib
.data
strTitle db 'Helloworld!',0
fmt db '%08X %08X',0
buf db 200 dup(?)
.code
start:
invoke MessageBox,0,addr strTitle,addr strTitle,0
push eax
push offset sys64_start
mov DWORD ptr[esp+4],033h
jmp FWORD ptr[esp]
sys64_start:
;这里插入64位代码
db 48h,0C7h,0C2h,0FFh,0FFh,0FFh,0FFh,52h,67h,8Bh,04h,24h,67h,8Bh,5Ch,24h,04h,5Ah
push eax
push offset sys32_start
mov DWORD ptr[esp+4],023h
jmp FWORD ptr[esp]
sys32_start:
invoke sprintf,addr buf,addr fmt,eax,ebx
invoke MessageBox,0,addr buf,addr strTitle,0
invoke ExitProcess,0
end start
|