How to get orignianl file name

How to get orignianl file name

Post by Manis » Fri, 07 Jul 2006 20:48:31


Anyone can help me, I want to know the original name of the file.

Thanks & Regards,

Manish
 
 
 

How to get orignianl file name

Post by David Jone » Fri, 07 Jul 2006 21:23:02


Of what file? Why?

If you're talking about just an ordinary data file, I think you're
out of luck. The original name would have to be stored somewhere
in the file itself in order to recover it. A PE binary (dll, exe,
etc) has a field for this, I think, but it can be set to anything.

David

 
 
 

How to get orignianl file name

Post by Manis » Sat, 08 Jul 2006 14:18:43

I want to get the original file name of any executable(PE format).

Thanks

Manish
 
 
 

How to get orignianl file name

Post by Scherbina » Sat, 08 Jul 2006 17:01:49

Manish,

If you want to get the name of executable from its code then
GetModuleFileName is what you need. If you want to retrieve file name which
is stored by the linker after compilation then you need to look at the place
near export table - usually for dlls (did not checked for exe's) linker
place the name of the module. Read
http://www.yqcomputer.com/
for details.

--
Vladimir
 
 
 

How to get orignianl file name

Post by Alexander » Sun, 09 Jul 2006 23:08:08

Use VerQueryValue