I think AI can be used to decompile code.

Just build a loop with:
1. What do you think is the C code that made this assembly?
2. I compiled your C code, it results in this, is this the same as the original assembly?
3. Do you have any ideas about how you could change the C code to make it compile to the original assembly?
Follow

@cjd I've been thinking about the same thing. I've thought about some console emulator that can read a disassembly of a game while the actual game is running and see if it could reconstruct C code based on that, but I don't know if it's possible.

@80caa3337d33760ee355697260af0a038ae6a82e6d0b195c7db3c7d02eb394ee @cjd I know next to nothing about AI programming or programming emulators. Someone else has to do it.

@xianc78 @80caa3337d33760ee355697260af0a038ae6a82e6d0b195c7db3c7d02eb394ee @cjd ever fucked with GHIDRA or IDA Pro? They're kinda similar in some ways.

The NSA releasing GHIDRA was a huge revolution when it came to a lot of things in tech because aside from being like IDA but legally free; it spawned a whole plugin ecosystem.

Case in point: this whole page about reversing some obscure (outside Japan) PSX game with GHIDRA:
https://tetracorp.github.io/tokimeki-memorial/methods/decompiling-psx-games.html

GHIDRA is why in the past few years github is flooded with decomp projects. It got revealed in the Vault 7 leaks, released to the public in 2019 with a permissive license as a tool in their words to "get ahead of malware developers", and it's been used by everyone from Coreboot to retrogamers reversing old games.
This is quite interesting, thanks both of you!
@PurpCat@clubcyberia.co @xianc78@gameliberty.club @80caa3337d33760ee355697260af0a038ae6a82e6d0b195c7db3c7d02eb394ee@mostr.pub @cjd@pkteerium.xyz Disassembly is complicated though. A typical C binary is so stripped down and optimized by the compiler that prettymuch everything is guesswork. Even with large amounts of help from the disassembler, it is still an insane level of effort to make even a little bit of progress. It's not for everyone. This is especially the case for locker down platforms like video game consoles where the binary imports/exports and layout of the code is not clear to the disassembler being used.

Having an AI-assisted Ghidra to further speculate and break down analyzed machine assembly would be really cool.
@xianc78@gameliberty.club @cjd@pkteerium.xyz Realistically speaking I don't think that would be much easier than traditional analysis + disassembly. You'd just be stripping away context from the disassembler and forcing it to miss things.

Something similar that is a good idea is mapping a disassembly project's symbols to a running emulator to assist with analysis.
Sign in to participate in the conversation
Game Liberty Mastodon

Mainly gaming/nerd instance for people who value free speech. Everyone is welcome.