English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 20 November 2020, 10:53   #1
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 485
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).
Radertified is offline  
Old 20 November 2020, 11:10   #2
AMIGASYSTEM
Registered User
AMIGASYSTEM's Avatar
 
Join Date: Aug 2014
Location: Brindisi (Italy)
Posts: 6,425
There is an application that makes an image executable, for text files you just need to insert the Flag "S"
AMIGASYSTEM is online now  
Old 20 November 2020, 18:00   #3
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 485
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.
Radertified is offline  
Old 20 November 2020, 21:45   #4
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 49
Posts: 5,103
if nothing exists, I could write one in no time in SAS/C.
jotd is offline  
Old 20 November 2020, 22:24   #5
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 485
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!
Radertified is offline  
Old 20 November 2020, 22:30   #6
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 7,961
Quote:
Originally Posted by Radertified View Post
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!
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.
Galahad/FLT is offline  
Old 20 November 2020, 22:45   #7
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 485
Quote:
Originally Posted by Galahad/FLT View Post
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!
Radertified is offline  
Old 21 November 2020, 13:39   #8
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,823
Quote:
Originally Posted by Radertified View Post
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".
phx is offline  
Old 21 November 2020, 14:38   #9
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 46
Posts: 2,357
This simple tool convert a binary data file to Amiga exe


http://grandis.nu/eabsearch/search.p...xclude=&limit=
chip is offline  
Old 21 November 2020, 22:02   #10
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 485
Quote:
Originally Posted by phx View Post
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 View Post
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!
Radertified is offline  
Old 22 November 2020, 02:26   #11
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 46
Posts: 2,357
I am also interested in this kind of tool, if it takes a load and jump address ....... thanks !
chip is offline  
Old 22 November 2020, 02:50   #12
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 46
Posts: 2,357
But i have a question, since i am not an expert

The load and the jump address can be freely chosen or must be determined ?
chip is offline  
Old 22 November 2020, 03:10   #13
Radertified
Registered User
 
Join Date: Jan 2011
Location: -
Posts: 485
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.
Radertified is offline  
Old 22 November 2020, 03:12   #14
chip
Registered User
 
Join Date: Oct 2012
Location: Italy
Age: 46
Posts: 2,357
It's not confusing, thanks for the infos
chip is offline  
Old 22 November 2020, 14:55   #15
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,823
Quote:
Originally Posted by Radertified View Post
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?
phx is offline  
Old 22 November 2020, 15:57   #16
Thomas Richter
Registered User
 
Join Date: Jan 2019
Location: Germany
Posts: 977
Quote:
Originally Posted by Radertified View Post
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 View Post
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()".
Thomas Richter is offline  
Old 22 November 2020, 16:03   #17
kamelito
Zone Friend

kamelito's Avatar
 
Join Date: May 2006
Location: France
Posts: 1,307
A packer like bytekiller do that.
kamelito is offline  
Old 22 November 2020, 16:47   #18
Frog
Junior Member

Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,331
Quote:
Originally Posted by kamelito View Post
A packer like bytekiller do that.
i'm agree, there's several packer that can do the job
Frog is offline  
Old 22 November 2020, 16:54   #19
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 7,961
Quote:
Originally Posted by Frog View Post
i'm agree, there's several packer that can do the job
Quote:
Originally Posted by kamelito View Post
A packer like bytekiller do that.







Quote:
Originally Posted by Radertified View Post
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 is offline  
Old 22 November 2020, 16:56   #20
Galahad/FLT
Going nowhere

Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 47
Posts: 7,961
Quote:
Originally Posted by Thomas Richter View Post
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.
Galahad/FLT is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to read file from executable directory? Sim085 Coders. C/C++ 21 08 June 2020 19:27
windows tool to convert ipf to wwp / normal adf file jotd Coders. General 12 08 May 2014 10:02
Tool to convert NewIcon to normal icons Leandro Jardim request.Apps 9 23 November 2013 16:18
File not executable amigapd support.Apps 3 22 February 2011 18:59
File not executable ancalimon support.WinUAE 8 15 February 2008 18:18

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 19:31.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.
Page generated in 0.09641 seconds with 15 queries