How can I read data from exe file which is running?

Just starting out? Need help? Post your questions and find answers here.
sonic3d
New User
New User
Posts: 9
Joined: Thu Oct 02, 2003 2:36 pm

How can I read data from exe file which is running?

Post by sonic3d »

The problem should be how can a running PB program know its path and filename?

Or any better idea for reading data from exe file which is running.

Thanks a lot! :oops:
Wolf
Enthusiast
Enthusiast
Posts: 234
Joined: Sat Apr 03, 2004 12:00 pm
Location: S.T

Post by Wolf »

You can copy running exe to any temp dir and then easy read all data of exe or patch it.
User avatar
GedB
Addict
Addict
Posts: 1313
Joined: Fri May 16, 2003 3:47 pm
Location: England
Contact:

Post by GedB »

Sonic3d,

What exactly do you need to do?

Everything from your executable should be loaded into memory.

if you are using a DataSection or IncludeBinary then you just need to use a label to get a pointer it.
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

The answer to your question
... how can a running PB program know its path and filename?
can be found here: viewtopic.php?t=4876
ricardo
Addict
Addict
Posts: 2438
Joined: Fri Apr 25, 2003 7:06 pm
Location: Argentina

Post by ricardo »

Code: Select all

FileName.s = Space(1024)
GetModuleFileName_(GetModuleHandle_(0), @FileName, 1025)

If ReadFile(0,FileName)
    ;etc
ARGENTINA WORLD CHAMPION
Post Reply