about summary refs log tree commit diff stats
path: root/example/samples/x86_32_mod.S
blob: df7792af1f3b794e349e6ef58ad1cc49db26ea07 (plain) (blame)
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
main:
    CALL test_automod
    CALL test_automod
    RET

test_automod:
    PUSH EBP
    MOV  EBP, ESP

loop:
    MOV  EAX, 0
    CMP  EAX, 0
    JMP  mod_addr
mod_addr:
    JNZ  end

    PUSH 0
    PUSH title
    PUSH msg
    PUSH 0
    CALL DWORD PTR [ MessageBoxA ]

    ; automodif code
    MOV BYTE PTR [mod_addr], 0xEB
    JMP loop
end:
    MOV BYTE PTR [mod_addr], 0x75
    MOV ESP, EBP
    POP EBP
    RET

title:
.string "Hello!"
msg:
.string "World!"