1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
format PE console
include 'include/win32a.inc'
entry start
section '.text' code readable executable
start:
xor eax,eax
mov al,0x43
call reverse_bits
push eax
push formh
call [printf]
push 0
call [ExitProcess]
reverse_bits:
push ecx
push edx
xor edx,edx
mov cl,8
@@:
shl al,1 ; bit de gauche → CF
rcr dl,1 ; CF → bit de droite de DL
dec cl
jnz @b
mov al,dl
pop edx
pop ecx
ret
section '.data' data readable writeable
formh db '%08x',13,10,0
section '.idata' import data readable writeable
library kernel32,'kernel32.dll',\
msvcrt,'msvcrt.dll',\
user32,'user32.dll',\
wsock32,'ws2_32.dll'
include 'include\api\kernel32.inc'
include 'include\api\user32.inc'
include 'include\api\wsock32.inc'
import msvcrt,\
printf,'printf' |