about summary refs log tree commit diff stats
path: root/example/samples/x86_32_enc.S
blob: 92379838ee72d14219a4ba01389eb9f958bc0950 (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
36
37
38
main:
    CALL cipher_code
    CALL msgbox_encrypted_start
    CALL cipher_code
    RET

cipher_code:
    PUSH EBP
    MOV  EBP, ESP

    LEA  ESI, DWORD PTR [msgbox_encrypted_start]
    LEA  EDI, DWORD PTR [msgbox_encrypted_stop]

loop:
    XOR  BYTE PTR [ESI], 0x42
    INC  ESI
    CMP  ESI, EDI
    JBE  loop

    MOV  ESP, EBP
    POP  EBP
    RET

msgbox_encrypted_start:
    PUSH 0
    PUSH title
    PUSH msg
    PUSH 0
    CALL DWORD PTR [ MessageBoxA ]
    RET
.dontsplit
msgbox_encrypted_stop:
.long 0

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