PDA

View Full Version : EXE module request: exported procedures list



ErosOlmi
09-07-2007, 12:11
Roberto,

a nice addition to EXE module can be a function returning a TAB (or whatever) separated string listing all exported procedures giving an exe or dll file name. Something like:


FUNCTION EXE_ListExportedProcedcures(ExeOrDllName [, StringSeparator]) AS STRING


Here some code can help to start:
http://www.powerbasic.com/support/forums/Forum7/HTML/001212.html
http://www.powerbasic.com/support/forums/Forum7/HTML/000821.html

Do you like?
Ciao
Eros

kryton9
09-07-2007, 18:03
Oh my gosh so much to play with in the new release. TOo bad no time at the moment, but wow this will very great tool!! Thanks so much!

ErosOlmi
09-07-2007, 18:20
Hey Ken, not yet developed but just asked.
But I'm pretty sure Roberto will add it. I think there are differences between OS versions but we will see.

kryton9
10-07-2007, 01:12
Thanks Eros.

RobertoBianchi
10-07-2007, 12:46
Added EXE_PE_GetExportList() and EXE_PE_GetImportList() functioons.
Here is an example of use:


USES "UI"
USES "EXE"
USES "File"

DIM sFile as string
DIM sSeparator AS STRING
DIM sFilter AS STRING
DIM sImport as string
DIM sExport as string

sSeparator = ", "
sFilter = "Executables files (*.exe, *.dll)|*.exe;*.dll|"
sFilter += "All Files (*.*)|*.*"

sFile = Dialog_OpenFile(0, "Please select an executable file", DIR_GetCurrent, sFilter, "exe", %OFN_FILEMUSTEXIST OR %OFN_HIDEREADONLY or %OFN_ENABLESIZING)

if len(sFile) > 0 then
sImport = EXE_PE_GetImportList(sFile, sSeparator)
sExport = EXE_PE_GetExportList(sFile, sSeparator)
Msgbox 0, "FILE: " + sFile + $CRLF + "IMPORTED FUNCTIONS:" + $CRLF + sImport + $CRLF + "EXPORTED FUNCTIONS:" + $CRLF + sExport
end if


Regards,
Roberto

Michael Hartlef
10-07-2007, 12:52
Mmmh, do I read this correctly? I will be able to get the module functions including their parameters?

RobertoBianchi
10-07-2007, 12:59
Here are a screenshots of output of above script runned on my Windows 98 PC.

Ciao,
Roberto

RobertoBianchi
10-07-2007, 13:00
Sorry, only the name of functions imported or exported by the PE executable.

Roberto

Michael Hartlef
10-07-2007, 13:13
Thanks. I thought that it would be that way, but somehow I also thought that you guys foudn a way for thinbasic modules.

ErosOlmi
10-07-2007, 14:06
Mmmh, do I read this correctly? I will be able to get the module functions including their parameters?

That remain a dream :'(
As you know, there is no way to detect function parameters in exported fucntions from DLLs.

ErosOlmi
10-07-2007, 14:07
Thanks. I thought that it would be that way, but somehow I also thought that you guys foudn a way for thinbasic modules.


What way Mike?

Michael Hartlef
10-07-2007, 16:01
To export module function parameters.

kryton9
10-07-2007, 17:44
Thanks Guys, this will be cool to look into the function names so easilly!!