about summary refs log tree commit diff stats
path: root/example/x86_32_repmod.S
diff options
context:
space:
mode:
authorCamille Mougey <camille.mougey@cea.fr>2015-01-06 17:37:16 +0100
committerCamille Mougey <camille.mougey@cea.fr>2015-01-23 17:24:41 +0100
commit69ce9d7a43e60d97fb02ccef0a4f8f3aa3d427ee (patch)
tree059f2b6f194defa5ea4bd70affd93d345d1e10e3 /example/x86_32_repmod.S
parent8caaa01f9a6f18a127a5825783d53b49c3a5f532 (diff)
downloadmiasm-69ce9d7a43e60d97fb02ccef0a4f8f3aa3d427ee.tar.gz
miasm-69ce9d7a43e60d97fb02ccef0a4f8f3aa3d427ee.zip
AsmBox: Extract assembly code from AsmBox examples
Diffstat (limited to 'example/x86_32_repmod.S')
-rw-r--r--example/x86_32_repmod.S46
1 files changed, 46 insertions, 0 deletions
diff --git a/example/x86_32_repmod.S b/example/x86_32_repmod.S
new file mode 100644
index 00000000..332a876c
--- /dev/null
+++ b/example/x86_32_repmod.S
@@ -0,0 +1,46 @@
+main:
+    CALL test_automod
+    RET
+
+lbl_good:
+    NOP
+    NOP
+    NOP
+    NOP
+    NOP
+    NOP
+    NOP
+    NOP
+    NOP
+
+test_automod:
+    PUSH EBP
+    MOV  EBP, ESP
+
+    LEA EDI, DWORD PTR [lbl_mod]
+    LEA ESI, DWORD PTR [lbl_good]
+
+    MOV ECX, 0x8
+    REPE MOVSB
+lbl_mod:
+    XOR EAX, EAX
+    MOV DWORD PTR [EAX], 0xDEADC0DE
+
+    NOP
+    NOP
+    NOP
+
+    PUSH 0
+    PUSH title
+    PUSH msg
+    PUSH 0
+    CALL DWORD PTR [ MessageBoxA ]
+
+    MOV ESP, EBP
+    POP EBP
+    RET
+
+title:
+.string "Hello!"
+msg:
+.string "World!"