EXE module request: exported procedures list
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:
[code=thinbasic]
FUNCTION EXE_ListExportedProcedcures(ExeOrDllName [, StringSeparator]) AS STRING
[/code]
Here some code can help to start:
http://www.powerbasic.com/support/fo...ML/001212.html
http://www.powerbasic.com/support/fo...ML/000821.html
Do you like?
Ciao
Eros
Re: EXE module request: exported procedures list
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!
Re: EXE module request: exported procedures list
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.
Re: EXE module request: exported procedures list
Re: EXE module request: exported procedures list
Added EXE_PE_GetExportList() and EXE_PE_GetImportList() functioons.
Here is an example of use:
[code=thinbasic] 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
[/code]
Regards,
Roberto
Re: EXE module request: exported procedures list
Mmmh, do I read this correctly? I will be able to get the module functions including their parameters?
2 Attachment(s)
Re: EXE module request: exported procedures list
Here are a screenshots of output of above script runned on my Windows 98 PC.
Ciao,
Roberto
Re: EXE module request: exported procedures list
Sorry, only the name of functions imported or exported by the PE executable.
Roberto
Re: EXE module request: exported procedures list
Thanks. I thought that it would be that way, but somehow I also thought that you guys foudn a way for thinbasic modules.
Re: EXE module request: exported procedures list
Quote:
Originally Posted by MikeHart
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.