konrad-kruczynski / elfsharp

Pure managed C# library for reading ELF, UImage, Mach-O binaries.
https://elfsharp.it
Other
151 stars 56 forks source link

Extract pointer size #34

Closed csholmq closed 7 years ago

csholmq commented 7 years ago

I am trying to extract information regarding the target platform from the ELF file. Architecture, Endianess and EntryPoint are all easy to grab. But what about pointer size?

E.g Class only takes values Bit32 or Bit64, so I assume that isn't it since it doesn't cover 16 bit architectures.

konrad-kruczynski commented 7 years ago

Interesting question. I would say that originally the ELF format was designed for 32 bit platforms and later extended for 64 bit ones. But it may be that it was later fitted for smaller (e.g. embedded architectures). Perhaps you have a sample file for such architecture (or at least an architecture so I could look up some specifications).

csholmq commented 7 years ago

So it seems. Bit odd.

No, I don't have an ELF aimed towards a 16 bit system at hand right now. I will look for one though.

csholmq commented 7 years ago

I got a hold of an ELF for a DSP56 16 bit processor. It appears to be listed as Bit32.

Also, could only find a single .debug sector. Weird.