Yes, it is possible to modify any code. Of course in ROM you will have to generate a new one, since it does not allow writing.
It is possible to decompile virtually any code, but some are very difficult. It needs to have a lot of information that is not always available. In general reverse engineering is done on top of the same Assembly, which is possible to obtain easy in 100% of the situations.
Of course no decompiled code will be as readable as the original. in many cases not nearly..
Some languages use a bytecode standard intermediate and information rich, so it is possible to recreate the original code very closely. In general there will be small changes of the original form of the algorithm, but doing the same thing, the style will obviously be of the decompiler, will not have comments and usually lose the names of local variables.
Java, C# and any language that doesn’t usually generate a native binary are like this. Note that C# can generate native code.
There’s nothing you can do to stop it. What you can do is make it difficult, create situations that the decompiler complicates, that change meaningful names to unreadable things. But the obfuscators can cause code execution problems.
Emulating a ROM has nothing to do with decompiling one. It is not necessary to decompile to emulate it.
Perhaps there is some confusion of what a compiler is. There is a question that speaks of this: What is a programming language, IDE and compiler?. And another who talks about how it works: How is a compiler made?.
ROM - Ready Only Memory ...." Read Only"
– MagicHat
Poxa Magic, the fact of being read-only not invalid the question.
– Marcus Becker
I didn’t answer "besides decompile, create a compiler only based on the compiled program" because that phrase doesn’t make much sense.
– Maniero
But why do you think I invalidated your question ? Just so you know I gave +1 on your question... because I thought it was good, and I didn’t deserve the -1 that someone gave...
– MagicHat
Valeu Magic! :)
– Marcus Becker
@Bigown what I wanted to know is whether the "compiled" has enough information to create a re-compiler. Assuming the example of a ROM translator, where I have the word
you
and want to exchange forvoce
which will not fit in the place of the original sentence. I can’t think of how much information I would need to reallocate pointers and create a new file with the translation in place of the original phrase.– Marcus Becker
There is no re-compiler. Changing only the texts is usually easier and I may have to change all references of it because the sizes are different, but it is very quiet. You don’t need to know almost anything about the code to change only the text. Of course it depends a little on how it was done. Might have some things done on purpose to make it harder.
– Maniero
Under "There is no re-compiler", suppose I generate a . java of a . class, change that . java and want to convert it to . class again, but without using the "original compiler".
– Marcus Becker
@Marcusbecker and what he would use in place of the "original compiler"?
– Maniero
The program that generated the source code initially.
– Marcus Becker
@Marcusbecker again it doesn’t make any sense.
– Maniero
Sorry, I can’t explain. Let me try one last time. I found a Prog program. k, I know this program was generated by a compiler that no longer exists, very old, but I love this program and would like to create similar programs. It runs through a VM that still exists. Can I reverse every binary into source code? (Yes, you already answered). I will be able to make any changes to that source or I will be limited to generating the same output, always generating the same number of bytes as the Prog. k initial?
– Marcus Becker
@Marcusbecker If you get the source, you do what you want with it, it’s code like any other, probably less readable, but do what you want. In abstract, generic terms, this is it, concretely whether or not you will succeed in this case is another story.
– Maniero
I think I’ll be tied to the functions found in the source. For example, I decompile a function
draw
, I can create an editor to generate this function and generate a new version of the game by callingdraw
as many times as I want. In other words, if I had no more Ataris on Earth and found a single tape and decompiled her code I would be doomed to only.– Marcus Becker