flat assembler
Message board for the users of flat assembler.
 Home   FAQ   Search   Register 
 Profile   Log in to check your private messages   Log in 
flat assembler > Windows > Bind an executable file

Author
Thread Post new topic Reply to topic
Picnic



Joined: 05 May 2007
Posts: 1231
Location: Icarian Sea

Bind an executable file

Hi everybody,

Let me describe my problem in short,

I am looking for a method to add the possibility for my toy basic to create a standalone
pseudo-executable by binding the interpreter together with a .bas file.

Here is what i have done so far.

Originally, the interpreter (let's name it A.exe) has no resource section.

When a bind command-line switch is found, i am creating a copy of A.exe on the fly,
and then i use BeginUpdateResource -> UpdateResource -> EndUpdateResource,
to add a section which stores the .bas file in newly created B.exe.

Now, when i run B.exe, first i search for the resource section ID using
FindResource -> LoadResource, and if exists, i am loading the .bas file from there.

Here is the problem,
When i do all the above from a windows 7 system the pseudo-executable works in Windows 7/8, but NOT in XP.
When i do it from a windows XP system the pseudo-executable is not working at all in XP/7/8 and i get the message: this is not a valid win32 application.

Hope this makes sense, any advice is welcome.
Post 14 Mar 2018, 12:13
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 15812
Location: Misner space

"not a valid win32 application" often means it has an empty section of zero length. The Windows loader doesn't like empty sections.
Post 14 Mar 2018, 12:23
View user's profile Send private message Visit poster's website Reply with quote
Picnic



Joined: 05 May 2007
Posts: 1231
Location: Icarian Sea

Oh thanks for this hint revolution. I didn't know that. That might explains other similar messages i am getting like access denied etc. Funny thing that the pseudo-exe works in 7/8 but not in XP.
Post 14 Mar 2018, 15:31
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >

Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Main index   Download   Documentation   Examples   Message board
Copyright © 2004-2018, Tomasz Grysztar.
Powered by rwasa.