Page 1 of 1

Dynamic Linking

Posted: Mon Feb 02, 2004 12:11 pm
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]

Re:Dynamic Linking

Posted: Mon Feb 02, 2004 3:21 pm
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

Re:Dynamic Linking

Posted: Mon Feb 02, 2004 3:43 pm
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

Re:Dynamic Linking

Posted: Mon Feb 02, 2004 5:20 pm
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 ...