Dynamic Linking

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Therx

Dynamic Linking

Post by Therx »

I've read the COFF file format and I'm trying to implement a program that reports all the COFF data, symbols etc. I can read the file header but my list of symbols is just s***.

Can some one please look at the code attached.

Pete

[attachment deleted by admin]
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Dynamic Linking

Post by Pype.Clicker »

hmm ..
i'm unsure, but i can see things like

Code: Select all

struct coff_header *image;
...
symbol = (image + image->symbol_off + i);
you are of course aware that writing ptr+offset in C means (void*)ptr + offset * sizeof(<base type of ptr>), so ((dword*)p) + 1 == ((char*)p)+4
Therx

Re:Dynamic Linking

Post by Therx »

Thanks. Although I still don't completely understand the output. The name of the symbols are obviously right.

I've just found a page which seems to contain lots of useful info on the subject and on other stuff as well.

HERE

Pete
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Dynamic Linking

Post by Pype.Clicker »

all of these things are also clearly described in the appendix of the Kernighan & Ritchie book about ANSI C ... that one is a must-read for all of you, young paddawan ...
Post Reply