about summary refs log tree commit diff stats
path: root/example
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2020-03-02 13:59:06 +0100
committerGitHub <noreply@github.com>2020-03-02 13:59:06 +0100
commitbc02f150f4d2ca584eb0d757e27fc09d70777cdd (patch)
tree512dbc7044b3ee707b8ed85c1b50f67dc64139b7 /example
parent886f05bcc6c4285bf60cb296186b9e975698356a (diff)
parent2abb748af4b402a4883f11d240fcdcdac37f7d04 (diff)
downloadmiasm-bc02f150f4d2ca584eb0d757e27fc09d70777cdd.tar.gz
miasm-bc02f150f4d2ca584eb0d757e27fc09d70777cdd.zip
Merge pull request #1148 from serpilliere/fix_automod_code
Fix Automod code
Diffstat (limited to 'example')
-rw-r--r--example/samples/x86_32_automod_2.S25
1 files changed, 25 insertions, 0 deletions
diff --git a/example/samples/x86_32_automod_2.S b/example/samples/x86_32_automod_2.S
new file mode 100644
index 00000000..832e253f
--- /dev/null
+++ b/example/samples/x86_32_automod_2.S
@@ -0,0 +1,25 @@
+main:
+	MOV     EAX, 0
+	MOV     ECX, 0x3
+block1:
+	DEC     ECX
+block2:
+	INC     EAX
+tmp:
+	DEC     ECX
+	JNZ     block2
+	; Modify block1
+	MOV     BYTE PTR [block1], 0x90
+	; Modify block2
+	MOV     BYTE PTR [block2], 0x90
+	MOV     BYTE PTR [tmp], 0x90
+	MOV     ECX, 4
+	MOV     EBX, EAX
+	XOR     EAX, EAX
+	CMP     EBX, 2
+	JZ      block2
+	CMP     EBX, 0
+	JZ      ok
+	INT     0x3
+ok:
+	RET