I'm a CS major as well, and my automata theory exams are in a couple of days. I have been thinking about the same material as you have. However, as a science major you should know that what you are proposing is not simply far fetched or even hard to execute. It's simply impossible since the code structure is so much degraded by the time a program turns binary that there's simply not enough information to decompile it into something remotely useful.
The main problem is that you can trace a stack when decompiling Java or Flash bytecode for instance, but it's much harder to trace a register set, because the sequence of instructions is pretty much lost. On top of that, functions are merely adresses in rom space, and are not named. Variables are also unnamed, and there's simply no way to retrieve information about structs and classes.
You don't need all of that information, you could simply convert each instruction of program A into a new instruction for program B. However, program B would need the data inside it's rom to be the same as in program A. Since you cannot see wich byte is code, and wich byte is data, you have to have both in memory. So you are essentially doubling the memory use for a given program.
Emulating I/O is also quite impossible since most gaming systems use memory mapped I/O. This means you have to recompile every memory access into a function or macro that checks wether that memory access is doing I/O. And you have to do this for EVERY memory access, making memory access so incredibly slow the program crawls.
The main problem is that you can trace a stack when decompiling Java or Flash bytecode for instance, but it's much harder to trace a register set, because the sequence of instructions is pretty much lost. On top of that, functions are merely adresses in rom space, and are not named. Variables are also unnamed, and there's simply no way to retrieve information about structs and classes.
You don't need all of that information, you could simply convert each instruction of program A into a new instruction for program B. However, program B would need the data inside it's rom to be the same as in program A. Since you cannot see wich byte is code, and wich byte is data, you have to have both in memory. So you are essentially doubling the memory use for a given program.
Emulating I/O is also quite impossible since most gaming systems use memory mapped I/O. This means you have to recompile every memory access into a function or macro that checks wether that memory access is doing I/O. And you have to do this for EVERY memory access, making memory access so incredibly slow the program crawls.