Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relocations table in MZ files not supported #1200

Closed
VladRassokhin opened this issue Aug 13, 2014 · 14 comments
Closed

Relocations table in MZ files not supported #1200

VladRassokhin opened this issue Aug 13, 2014 · 14 comments
Labels
enhancement New File-Format Windows Microsoft Windows platform support issues
Milestone

Comments

@VladRassokhin
Copy link

Subj. Have old dos mz executable with relocation table.
Beginning of file:

[0x00000000 752 Downloads/motor-city/IDMAS.EXE]> x
- offset -  0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
0000:0000  4d5a 7000 3b01 2709 4c02 774a 774a 412b  MZp.;.'.L.wJwJA+
0000:0010  0034 0000 4800 0000 1c00 0000 4b00 0000  .4..H.......K...
0000:0020  5000 0000 5500 0000 6600 0000 8400 0000  P...U...f.......
0000:0030  9900 0000 a300 0000 af00 0000 c600 0000  ................
0000:0040  de00 0000 e300 0000 f400 0000 f900 0000  ................
0000:0050  2401 0000 4201 0000 5601 0000 6801 0000  $...B...V...h...

As you can see relocation talbe starts at 0000:001c and contains 0x13b elements.

Radare 2 not processed relocation table, and after start comes into

[0000:0048]> x 10
- offset -  0 1  2 3  4 5  6 7  8 9  A B  C D  E F  0123456789ABCDEF
0000:0048  f400 0000 f900 0000 2401                 ........$.

which is part of relocation table.

@VladRassokhin
Copy link
Author

Is there any documentation about inner structures, e.g. RBinRelloc ?
I'm trying to implement method which would provide reallocs information for mz files, but does not understand what means all those fields of scructure RBinRelloc.
As example i'm looking into bin_pe.c, but no luck still.

@radare
Copy link
Collaborator

radare commented Aug 13, 2014

Relocs are not supported in any file format. They are only listed, but they do not virtually modify the io layer yet. That should be easy to do, but im currently busy in other todo points. Anyway, whats the output radiff2 -r IDMAS.exe?

Iirc there's a pad collecting all kind of random information about different relocation types on different file formats in order to define it properly to be crossplatform.

On 13 Aug 2014, at 17:14, Vladislav Rassokhin notifications@github.com wrote:

Subj. Have old dos mz executable with relocation table.
Beginning of file:

[0x00000000 752 Downloads/motor-city/IDMAS.EXE]> x

  • offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
    0000:0000 4d5a 7000 3b01 2709 4c02 774a 774a 412b MZp.;.'.L.wJwJA+
    0000:0010 0034 0000 4800 0000 1c00 0000 4b00 0000 .4..H.......K...
    0000:0020 5000 0000 5500 0000 6600 0000 8400 0000 P...U...f.......
    0000:0030 9900 0000 a300 0000 af00 0000 c600 0000 ................
    0000:0040 de00 0000 e300 0000 f400 0000 f900 0000 ................
    0000:0050 2401 0000 4201 0000 5601 0000 6801 0000 $...B...V...h...
    As you can see relocation talbe starts at 0000:001c and contains 0x13b elements.

Radare 2 not processed relocation table, and after start comes into

[0000:0048]> x 10

  • offset - 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF
    0000:0048 f400 0000 f900 0000 2401 ........$.
    which is part of relocation table.


Reply to this email directly or view it on GitHub.

@radare
Copy link
Collaborator

radare commented Aug 13, 2014

Nope there's no documentation on that. Just check how it's used in pe, elf or mach0. This is implemented but not used so far the symbol definition (relocs does not yet modify io memory yet)

On 13 Aug 2014, at 17:57, Vladislav Rassokhin notifications@github.com wrote:

Is there any documentation about inner structures, e.g. RBinRelloc ?
I'm trying to implement method which would provide reallocs information for mz files, but does not understand what means all those fields of scructure RBinRelloc.
As example i'm looking into bin_pe.c, but no luck still.


Reply to this email directly or view it on GitHub.

@VladRassokhin
Copy link
Author

Ok, thanks for information.
radiff2 -r idmas.exe does not works, did you mean some other command?

@radare
Copy link
Collaborator

radare commented Aug 13, 2014

No, thats correct because as you said its not implemented for mz :) only for pe iirc

On 13 Aug 2014, at 18:30, Vladislav Rassokhin notifications@github.com wrote:

Ok, thanks for information.
'radiff2 -r idmas.exe' does not works, did you mean some other command?


Reply to this email directly or view it on GitHub.

@radare radare changed the title Reloations table in MZ files not supported Relocations table in MZ files not supported Aug 29, 2014
@XVilka XVilka added Windows Microsoft Windows platform support issues New File-Format enhancement labels Nov 23, 2014
@XVilka XVilka added this to the 1.0.0 milestone Nov 23, 2014
@radare radare modified the milestones: 1.1.0, 1.0.0 Oct 27, 2016
@radare
Copy link
Collaborator

radare commented Oct 27, 2016

can we have a test case for this?

@Maijin
Copy link
Contributor

Maijin commented Nov 9, 2016

@marespiaut "can we have a test case for this?" ?

@ghost
Copy link

ghost commented Nov 9, 2016

@Maijin It's not possible yet. First of all, because Motor City isn't a freeware game, so I have to find a freeware binary with the same problem. Second of all, I don't know (yet) what this is about, as I'm not familiar with the concept of relocation table.

@Maijin
Copy link
Contributor

Maijin commented Nov 9, 2016

Well yeah no problem take something else ^^

@radare radare modified the milestones: 1.2.0, 1.1.0 Dec 13, 2016
@radare
Copy link
Collaborator

radare commented Dec 13, 2016

any other bin?

@ghost
Copy link

ghost commented Dec 13, 2016

@radare Not for now. I'll do some research this evening.

@radare
Copy link
Collaborator

radare commented Jan 29, 2017

@marespiaut any update?

@radare radare modified the milestones: 1.3.0, 1.2.0 Jan 29, 2017
@VladRassokhin
Copy link
Author

Good news, seems it was fixed in 0c57a43 or bit later.

@Maijin
Copy link
Contributor

Maijin commented Feb 23, 2017

@marespiaut ^

yossizap pushed a commit to yossizap/radare2 that referenced this issue Dec 30, 2019
* Fixed a scaling issue of Graph

* Thoroughly fixed for the scaling

* double click fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New File-Format Windows Microsoft Windows platform support issues
Projects
None yet
Development

No branches or pull requests

5 participants