Atari Absolute packer

All about the serious stuff.

Moderators: Mug UK, Zorro 2, Moderator Team

Atari Absolute packer

Postby galahad » Thu Apr 12, 2012 1:17 am

If such a thing exists on the ST, I need a packer that can compress executable files and force them to relocate permanently to an address I give it.

i'm working with the Was (not was) crack of When time Stood still and because of where he's forced it to be located in memory is causing me a major headache with finding enough room in memory on the Amiga to fit in the now converted ST screen.

i've checked the original, and that was originally fully relocatable from what I can see, the only extra benefit to the Was (not was) version is he's figured out that some files when loaded are not needed to be reloaded, and so has saved on files by including them in the program file instead.

So, I need a packer that gives me the option of where in memory to load a program file, and force relocate it to that memory address. Surely there must be something like that, because the Was (not was) version certainly does it.
galahad
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
 
Posts: 110
Joined: Fri Oct 21, 2005 1:30 pm
Location: Amiga

Re: Atari Absolute packer

Postby Klapauzius » Thu Apr 12, 2012 5:38 am

The early Was (Not Was) packs are custom hacks. He didn't use a specific tool for relocating the code, everything was done 'manually'. :)

There may be packer that does what you want, but I'm not aware of it. Maybe other folks can chime in here.

If you want the code of an ST executable to relocate to a specific address I'd do it like this:

- Run Steem debug version
- Write and launch a small program that allocates memory up to the point you want your game prg loaded to and that will stay resident in memory
- Launch the game prg, let it relocate and then dump the relocated code to a binary file (use Steem's "Stop on next program run" option for this)
- pack the relocated dump and load/unpack it to the same address
http://www.klapauzius.net
http://dbug.kicks-ass.net/klaz

The tears are welling in my eyes again, I need twenty big buckets to catch them in, twenty pretty girls to carry them down, twenty deep holes to bury them in.
User avatar
Klapauzius
The Klaz
The Klaz
 
Posts: 4300
Joined: Sun Jul 04, 2004 7:55 am
Location: Bavaria

Re: Atari Absolute packer

Postby galahad » Thu Apr 12, 2012 9:01 am

Has no-one ripped the code from TOS so you can externally relocate programs?
galahad
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
 
Posts: 110
Joined: Fri Oct 21, 2005 1:30 pm
Location: Amiga

Re: Atari Absolute packer

Postby Klapauzius » Thu Apr 12, 2012 9:37 am

No need to rip the relocation code, the relocation procedure is well documented. From the tos.hyp site:
Whether relocation information is present or not can be gathered from the element ph_absflag of the program header (see above). Basically only a relocation of 32-bit values (i.e. addresses) is possible; prior to GEMDOS Version 0.15 (or TOS Version 1.04) the relocation information was limited to a maximum of 32 kbytes.

The relocation table itself starts with a 32-bit value which marks the offset of the first value to be relocated relative to the start of the TEXT segment. Single bytes are then used for all following offsets. To be able to handle offsets greater than 255 correctly, one proceeds as follows: If a 1 is found as an offset (this is not possible due to the characteristics of the MC-680x0 processor family) then the value 254 is added automatically to the offset. For very large offsets this procedure can of course be repeated. Incidentally, an empty relocation table is flagged with a LONG value of 0.


All Atari executable packers will have the relocation routine built in.
So another possibilty would be to pack your program with any Atari executable packer, then intercept the relocation procedure after it has unpacked, but before it starts the relocation. Replace the base offset address (start of the text segment) with the address you want the program to be loaded to. Then let the relocation routine commence and save the relocated binary after it's done.

As I said above, there may be tools that do this automatically, but I'm just not aware of any.
http://www.klapauzius.net
http://dbug.kicks-ass.net/klaz

The tears are welling in my eyes again, I need twenty big buckets to catch them in, twenty pretty girls to carry them down, twenty deep holes to bury them in.
User avatar
Klapauzius
The Klaz
The Klaz
 
Posts: 4300
Joined: Sun Jul 04, 2004 7:55 am
Location: Bavaria

Re: Atari Absolute packer

Postby nativ » Thu Apr 12, 2012 9:52 am

Pack Ice would compress executables ?
Atari STFM 512 / STe 4MB / Mega ST+DSP / Falcon 4MB 16Mhz 68882 - DVD/CDRW/ZIP/DAT - FDI / Jaguar / Lynx 1&2 / 7800 / 2600 / XE 130+SD Card // Sega Dreamcast / Mega2+CD2 // Apple G4

http://soundcloud.com/nativ ~ http://soundcloud.com/nativ-1 ~ http://soundcloud.com/knot_music
http://soundcloud.com/push-sounds ~ http://soundcloud.com/push-records
User avatar
nativ
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 4070
Joined: Mon Jul 30, 2007 10:26 am
Location: South West, UK

Re: Atari Absolute packer

Postby galahad » Thu Apr 12, 2012 10:16 am

nativ wrote:Pack Ice would compress executables ?


So does Automation packer, but I specifically need to relocate an executable to an absolute address, i.e. it can only be loaded and run at the address I specify.
galahad
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
 
Posts: 110
Joined: Fri Oct 21, 2005 1:30 pm
Location: Amiga

Re: Atari Absolute packer

Postby nativ » Thu Apr 12, 2012 10:38 am

would hijacking some of Dbug's ULS code help?
Atari STFM 512 / STe 4MB / Mega ST+DSP / Falcon 4MB 16Mhz 68882 - DVD/CDRW/ZIP/DAT - FDI / Jaguar / Lynx 1&2 / 7800 / 2600 / XE 130+SD Card // Sega Dreamcast / Mega2+CD2 // Apple G4

http://soundcloud.com/nativ ~ http://soundcloud.com/nativ-1 ~ http://soundcloud.com/knot_music
http://soundcloud.com/push-sounds ~ http://soundcloud.com/push-records
User avatar
nativ
Fuji Shaped Bastard
Fuji Shaped Bastard
 
Posts: 4070
Joined: Mon Jul 30, 2007 10:26 am
Location: South West, UK

Re: Atari Absolute packer

Postby Klapauzius » Thu Apr 12, 2012 10:44 am

Galahad, just send me the executable and the address you'd like it to be loaded to and I'll make a relocated binary for you.
http://www.klapauzius.net
http://dbug.kicks-ass.net/klaz

The tears are welling in my eyes again, I need twenty big buckets to catch them in, twenty pretty girls to carry them down, twenty deep holes to bury them in.
User avatar
Klapauzius
The Klaz
The Klaz
 
Posts: 4300
Joined: Sun Jul 04, 2004 7:55 am
Location: Bavaria


Return to Applications

Who is online

Users browsing this forum: CommonCrawl [Bot] and 0 guests