views:

31

answers:

2

Suppose I have a VC++ project contains no of(say e.g 5) Source files(.cpp files),it will generate 5 .obj files(obj files corresponding to my .cpp's files not all kernel and OS layers including .obj files)

e.g my project includes xyz_1.cpp,xyz_2.cpp,xyz_3.cpp,xyz_4.cpp,it will corresponds 4 respective .objs.

By programtaically HOW CAN I TAKE AND GET THE NAMES OF THESE 4 .OBJ files at runtime(On run time I need to check how many obj files & names of those objs).

REMEMBER I DON'T NEED ALL KERNEL AND OS LAYER .OBJS I ONLY NEED OBJS OF MY .CPPs.

Regards Usman

A: 

The .obj file names are not standard. some compilers hay create ones that correspond to the .cpp files, others may create ones with random names (VC actually does that when configured with link time code generation) while others may skip this stage completely.

So there is no well defined answer to your question. it is compiler and compilation flags dependent.

Furthermore, there is no way to get this information that I know of.

shoosh
Actually I am using Dumpbin SDK for getting information from pdb or Exe. It gives me every function signature and symbolic info even which I dont want. Suppose I have 3 funcs in one Exe, I only need these 3 funcs signatures not everything starting from User layer ends up to KERNEL level all functions and OS functions. it gives EVERY THING STARTING FROM FUNCTIONS defined in that xyz.cpp and BACKTRACK TO KERNEL EVEN OS LEVEL LAYER.... I dont need all those, I only need functions info regarding defined in my .cpp's or .h's
Usman
please try to make sense.
shoosh
U mean u could'nt got What I need ...?
Usman
Suppose i have xyz.cpp. It contains two funcs i.eint func1(int,int,float) and int func2(int,float,double)I just need these 2 after using dia2dump sdk. But it gives me EVERYTHING ,ever func even which I dont want. i.e _initp_misc_rand_s(__initp_misc_rand_s) , _VEC_memcpy(__VEC_memcpy) , __updatetmbcinfo(___updatetmbcinfo) and blah blah blah sky is the limit , 1000's of functions of similar kind, WHICH I DONT NEED..
Usman
A: 

It sounds like you need to use Microsoft's dbghelp.dll library and their Debug Interface Access SDK.

T.E.D.
I am using Debug Interface Access SDK. That is dia2dump SDK. But it gives me EVERY SYMBOL INFO from user level to KERNEL Level. I dont need EVERY function info. I only need those functions WHICH WEERE DEFINED UNDER MY CPP's(e.g i defined xyz.cpp and its having single function int func_01(int,int) I only need this signature THAT'S IT!!) I DONT NEED kernel imports, ALL COMPILANDS and EVERY MODULE participating in EXE...
Usman