View Full Version : Few EXE module functions missing
Petr Schreiber
06-03-2008, 19:58
Hi,
I think latest thinBASIC preview has some odd version of EXE module, following functions are not recognized by parser:
EXE_PE_Is32
EXE_PE_Is64
EXE_PE_IsManaged
It is strange, as EXE_PE_IsUPX works without problem I think.
Bye,
Petr
ErosOlmi
06-03-2008, 23:49
Strange Petr.
Do you have a script example not working?
Petr Schreiber
07-03-2008, 09:37
Hi,
here is sample:
uses "EXE"
dim s as string
s = EXE_Gettypename(EXE_Gettype("Riddick.exe"))+$CRLF+STR$(EXE_PE_Is64("Riddick.exe"))
msgbox 0, s
Might be a parsing problem ? I tried simplier statement and it worked.
Or maybe I miss something obvious, not sure :(
Thanks,
Petr
Michael Clease
07-03-2008, 11:14
Petr your example is wrong.
EXE_Gettypename should be passed a filename not a value, you are passing the returned value from EXE_Gettype().
Also if riddick.exe is not in the same directory as your script it wont see it (i think).
I think there could be a problem with EXE_Gettypename see my example you will see that it is blank.
uses "EXE"
dim s as string
s = APP_PATH +"THINBASIC.EXE" + $CRLF(2)
s += "File Type Name " + $TAB + "= " + EXE_Gettypename(APP_PATH + "thinbasic.exe") +$CRLF
s += "File Type " + $TAB(2) + "= " + EXE_Gettype(APP_PATH + "thinbasic.exe") +$CRLF
s += "Is File 32 " + $tab(2) + "= " + IIF$ (EXE_PE_Is32(APP_PATH + "THINBASIC.exe") = %TRUE, "Yes","No") + $CRLF
s += "Is File 64 " + $tab(2) + "= " + IIF$ (EXE_PE_Is64(APP_PATH + "THINBASIC.exe") = %TRUE, "Yes","No") + $CRLF
msgbox 0, s
Petr Schreiber
07-03-2008, 11:26
Thanks Abraxas,
check this out:
uses "EXE"
dim s as string
s = APP_PATH +"THINBASIC.EXE" + $CRLF(2)
s += "File Type Name " + $TAB + "= " + EXE_Gettypename(EXE_Gettype(APP_PATH + "thinbasic.exe")) +$CRLF
s += "File Type " + $TAB(2) + "= " + EXE_Gettype(APP_PATH + "thinbasic.exe") +$CRLF
s += "Is File 32 " + $tab(2) + "= " + IIF$ (EXE_PE_Is32(APP_PATH + "THINBASIC.exe") = 0, "Yes","No") + $CRLF
s += "Is File 64 " + $tab(2) + "= " + IIF$ (EXE_PE_Is64(APP_PATH + "THINBASIC.exe") = 0, "Yes","No") + $CRLF
msgbox 0, s
Now it works! So I think I had it correct ???
But I would also prefer the way it is in documentation as EXE_Gettypename(EXE_Gettype(... is a bit clumsy
Thanks,
Petr
P.S. I had Riddick.exe in the same directory, but I must admit APP_SOURCEPATH+"Riddick.exe" would be cleaner :-[
P.P.S. I completely forgot that equate + (n) repetition trick, thanks for reminding me of it :)
Michael Clease
07-03-2008, 11:30
I see the problem now!
The documentation is wrong, you need to pass the filetype number not the filename.
Over to you Eros. ;)
Petr Schreiber
07-03-2008, 11:35
Even weirder,
now the problematic script runs ?!
I need to check if I do have some duplicate thinBASIC installation ...
Thanks,
Petr
EDIT> I had a thinBASIC.exe+thinCore.dll+... in Windows/System32. Do not know why, maybe thinBundle without path specified loong time ago ? ( data 2.11.2007 )
Michael Clease
07-03-2008, 12:04
change these :-[ they work now
s += "Is File 32 " + $tab(2) + "= " + IIF$ (EXE_PE_Is32(APP_PATH + "THINBASIC.exe") = %TRUE, "Yes","No") + $CRLF
s += "Is File 64 " + $tab(2) + "= " + IIF$ (EXE_PE_Is64(APP_PATH + "THINBASIC.exe") = %TRUE, "Yes","No") + $CRLF
Petr Schreiber
07-03-2008, 12:08
I did not noticed there was a problem :),
Thanks!
Petr