Research Assistant/Third-year MPhil student in the Department of Information Engineering in the Chinese University of Hong Kong. CTF, Maths enthusiast. A member of the Black Bauhinia (blackb6a) CTF team based in Hong Kong.
A simple-ish demo of a buffer overflow with ret2code, made possible by the wasm port of the Unicorn engine, which is a multi-platform, multi-architecture CPU emulator.
I also made use of Keystone.js and Capstone.js, which are wasm ports of Keystone (which is an assembler framework) and Capstone (which is a disassembler framework).
For this demo, your goal is to reach the function win, located at the address 0x402000.
The C code of the assembly code below would be roughly like so:
You can change the value of the input by clicking on the bytes.