Page 1 of 1

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

Posted: Fri Jun 25, 2004 6:46 pm
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:

Posted: Sat Jun 26, 2004 11:28 am
by Wolf
You can copy running exe to any temp dir and then easy read all data of exe or patch it.

Posted: Sat Jun 26, 2004 12:03 pm
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.

Posted: Sat Jun 26, 2004 12:36 pm
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

Posted: Sat Jun 26, 2004 2:13 pm
by ricardo

Code: Select all

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

If ReadFile(0,FileName)
    ;etc