[FASM] Heaven's gate 12-12-2014, 05:08 PM
#1
Code:
include 'win32ax.inc' ;We want to run as a x86 process
.data
szMessageCaption DB "DeadlyVermilion", 0
szMessageText32 DB "This seems to be running on a 32 bit operating system.", 0
.code
proc Our64Proc ;This proc is x64 code
use64
CALL @F
DB "This was generated using 64 bit ASM code.", 0
@@:
POP RAX
MOV RCX, RAX
use32
RETF
endp
start:
;invoke DebugBreak ;Used for debugging
MOV AX, CS
CMP AL, 1Bh ;1Bh for 32 bits native, 33h if 64 bits native, 23h for wow64
JE Its32BitsNative
CMP AL, 33h
JE ExitCode
XOR ECX, ECX
CALL 33h:Our64Proc
invoke MessageBox, 0, ECX, szMessageCaption, MB_OK
JMP ExitCode
Its32BitsNative:
invoke MessageBox, 0, szMessageText32, szMessageCaption, MB_OK
ExitCode:
invoke ExitProcess, 0
.end start
Author: DeadlyVermillion