predprey Master Cheater
Reputation: 24
Joined: 08 Oct 2015 Posts: 486
|
Posted: Wed Apr 27, 2016 10:13 pm Post subject: Guide to writing hard to read and unmaintainable ASM scripts |
|
|
1. Write script's logic in C first.
2. Use gcc to output the assembly.
3. Alternatively, use Compiler Explorer to generate assembly with level 3 optimization.
3. Copy assembly to CE.
4. Remove unnecessary instructions such as initialization of main() etc.
5. PROFIT! And learn nothing much along the way, instead of honing your assembly writing skillset by doing it manually. Plus having tons of numbered labels that make reading the script an equally hard lesson in reverse engineering.
Was writing a relatively long and complex script recently and debugging the logic in assembler was just hellishly confusing. So decided to draft in C first and translate to assembler manually after that, if only to make understanding the code's logic easier. Then I decided that repeatedly translating, even if bit by bit each time was a chore, so I decided to just rip the assembly from a compiled source. Though it barely works out, it's probably in the list of "How NOT to program in assembly"
|
|