English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Asm / Hardware (https://eab.abime.net/forumdisplay.php?f=112)
-   -   Tool to convert data file to executable (https://eab.abime.net/showthread.php?t=104734)

Radertified 20 November 2020 09:53

Tool to convert data file to executable
 
Can anyone recommend a tool that can take a data file and turn it into an Amiga executable? It would load the data into an absolute address and JMP to another address.

The kicker is I don't want the data compressed/crunched. Crunchers can compress the data and do all of the above, but I can't find a cruncher that omits the crunchy crunch part.

I'm sure I can assemble something that'll do this but I'd prefer something premade where I can pop in a file and get an executable in a few seconds.
I know I've used something that did this years ago but I can't for the life of me remember what it was. It was probably something really common but my brain is being stupid (as usual).

AMIGASYSTEM 20 November 2020 10:10

There is an application that makes an image executable, for text files you just need to insert the Flag "S"

Radertified 20 November 2020 17:00

Thanks AMIGASYSTEM but by data file, I meant a raw memory dump, and then being able to jump to a specific part of code within that dump.

jotd 20 November 2020 20:45

if nothing exists, I could write one in no time in SAS/C.

Radertified 20 November 2020 21:24

I'm sure it exists because I recall using one back in the day, but I can't figure out what it was called.

It's a simple loader to write so if you're down for it jotd, no objections from me. And if you decide not to, no sweat! :D

Galahad/FLT 20 November 2020 21:30

Quote:

Originally Posted by Radertified (Post 1441945)
I'm sure it exists because I recall using one back in the day, but I can't figure out what it was called.

It's a simple loader to write so if you're down for it jotd, no objections from me. And if you decide not to, no sweat! :D

It would be a very simple piece of asm code to achieve what you want, you would just include the file at assembly time and done.

Radertified 20 November 2020 21:45

Quote:

Originally Posted by Galahad/FLT (Post 1441947)
It would be a very simple piece of asm code to achieve what you want, you would just include the file at assembly time and done.

Exactly. I've done it a few times in the past, but I'd prefer something generic. A quick tool where I pass in some parameters and it's done.

Don't underestimate my laziness! :D

phx 21 November 2020 12:39

Quote:

Originally Posted by Radertified (Post 1441953)
I'd prefer something generic. A quick tool where I pass in some parameters and it's done.

Which parameters would you like to pass? Just the load-address, or also the binary file name? Not sure if jotd wants to work on it now, but such a program can be written by many people here in less than an hour. The most complex part would be command line parsing. ;)

Although I still don't see the advantage of a "generic" tool. You can even make it generic with an assembler. For example by defining a symbol on the command line with "-Dloadaddr=$1234".

chip 21 November 2020 13:38

This simple tool convert a binary data file to Amiga exe


http://grandis.nu/eabsearch/search.p...xclude=&limit=

Radertified 21 November 2020 21:02

Quote:

Originally Posted by phx (Post 1442040)
Which parameters would you like to pass? Just the load-address, or also the binary file name? Not sure if jotd wants to work on it now, but such a program can be written by many people here in less than an hour. The most complex part would be command line parsing. ;)

Although I still don't see the advantage of a "generic" tool. You can even make it generic with an assembler. For example by defining a symbol on the command line with "-Dloadaddr=$1234".

Generally whenever I write a loader I need to give a load address and a JMP address. At times I might have to set registers or the stack, but not too often. So a simple command line might be something like:

bin2exe FILE=rawdata LOAD=1000 JMP=30000

As I said, I know something like this already exists but I guess it was something obscure. I think I might write a generic converter myself when I find the time. As you said, it's super simple. I'm just being lazy.

Quote:

Originally Posted by chip (Post 1442049)
This simple tool convert a binary data file to Amiga exe
http://grandis.nu/eabsearch/search.p...xclude=&limit=

Unfortunately I just tried it and it didn't work. I gave it and infile and outfile and it just crashes, probably because I couldn't define all of the required details. Thanks for trying though!

chip 22 November 2020 01:26

I am also interested in this kind of tool, if it takes a load and jump address ....... thanks ! :)

chip 22 November 2020 01:50

But i have a question, since i am not an expert :rolleyes

The load and the jump address can be freely chosen or must be determined ? :blased

Radertified 22 November 2020 02:10

Generally you have to determine these addresses. A lot of games loaded their data to specific memory addresses and then jumped to the game at another address. For example, it might have loaded the game data into $100 and later jumped to $4000 to start the game. If you don't have these details, the game almost certainly won't work.

A well written title will load the title to any memory address and jump to an address relative to that. For example, it might load into an address which is then stored into register A1. Later a jump to the address in A1 is done instead of somewhere specific.

I hope that's not too confusing.

chip 22 November 2020 02:12

It's not confusing, thanks for the infos :)

phx 22 November 2020 13:55

Quote:

Originally Posted by Radertified (Post 1442197)
For example, it might have loaded the game data into $100 and later jumped to $4000 to start the game.

Hmm. Then you probably want to disable the OS, before letting the loader do the copy operation? But can you always be sure the launched program doesn't need it later? Different games might expect a different state of the system when launched.

Quote:

A well written title will load the title to any memory address and jump to an address relative to that.
So it is relocatable, like a hunk-format executable? :D

Thomas Richter 22 November 2020 14:57

Quote:

Originally Posted by Radertified (Post 1441850)
Can anyone recommend a tool that can take a data file and turn it into an Amiga executable?

There are plenty tools that convert a data file to ASM directives or C tables, such as:


http://aminet.net/dev/asm/2b_Bin2Asm.lha


or



http://aminet.net/dev/c/2b_Bin2C.lha


To name two I found immediately on aminet. This way, the data file can be part of your code. Once assembled or compiled, it becomes part of the executable, i.e. your project.


Quote:

Originally Posted by Radertified (Post 1441850)
It would load the data into an absolute address and JMP to another address.

*puke*. DO not do that. Absoute addresses are in absolute use, and an absolute no-go in a multi-tasking system. To get an address data can go into, use AllocMem(), or the system loader aka "LoadSeg()".

kamelito 22 November 2020 15:03

A packer like bytekiller do that.

Frog 22 November 2020 15:47

Quote:

Originally Posted by kamelito (Post 1442294)
A packer like bytekiller do that.

i'm agree, there's several packer that can do the job

Galahad/FLT 22 November 2020 15:54

Quote:

Originally Posted by Frog (Post 1442297)
i'm agree, there's several packer that can do the job

Quote:

Originally Posted by kamelito (Post 1442294)
A packer like bytekiller do that.








Quote:

Originally Posted by Radertified (Post 1441850)
Can anyone recommend a tool that can take a data file and turn it into an Amiga executable? It would load the data into an absolute address and JMP to another address.

The kicker is I don't want the data compressed/crunched. Crunchers can compress the data and do all of the above, but I can't find a cruncher that omits the crunchy crunch part.

I'm sure I can assemble something that'll do this but I'd prefer something premade where I can pop in a file and get an executable in a few seconds.
I know I've used something that did this years ago but I can't for the life of me remember what it was. It was probably something really common but my brain is being stupid (as usual).

Ahem....

Galahad/FLT 22 November 2020 15:56

Quote:

Originally Posted by Thomas Richter (Post 1442293)
There are plenty tools that convert a data file to ASM directives or C tables, such as:


http://aminet.net/dev/asm/2b_Bin2Asm.lha


or



http://aminet.net/dev/c/2b_Bin2C.lha


To name two I found immediately on aminet. This way, the data file can be part of your code. Once assembled or compiled, it becomes part of the executable, i.e. your project.



*puke*. DO not do that. Absoute addresses are in absolute use, and an absolute no-go in a multi-tasking system. To get an address data can go into, use AllocMem(), or the system loader aka "LoadSeg()".

If they are already dealing with data that is already set to an absolute address, they don't have many options but to be constrained by that.


All times are GMT +2. The time now is 04:10.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.09284 seconds with 11 queries