For example, "mov eax, 0x0040137C"
Is is this an address or a numeric constant?
Should it be translated to:
1) var = 4199292;
2) var = &SomeGlobalVariable;
If you're lucky you might get a non-ambiguous answer from the relocation table embedded in your executable.
So you're probably better off writing a new backend for the Go compiler (a backend generating machine code, or C code).
The resulting program will have, by far, a lot less dangerous approximations.
For example, "mov eax, 0x0040137C"
Is is this an address or a numeric constant?
Should it be translated to:
1) var = 4199292;
2) var = &SomeGlobalVariable;
If you're lucky you might get a non-ambiguous answer from the relocation table embedded in your executable.
So you're probably better off writing a new backend for the Go compiler (a backend generating machine code, or C code).
The resulting program will have, by far, a lot less dangerous approximations.