Jump to content
IGNORED

Extracting an executable file & disassembly


Tezz

Recommended Posts

Hello all.

 

Does anyone know an easy way to "extract" from a booting floppy image to create an executable file? I can launch the disk image and dump memory locations to a file in Atari800Win monitor but how without knowing the memory locations used? There are progs to display the init address of executable files from the header but are there any available for sectored disks?

 

I basically want to disassemble some code but I don't want to alter any addresses used.

 

Talking of which, I found a utility on the net called asi15am which apparently creates Mac 65 compilable sources from any executable. I know the disassembled code always needs a lot of work as it simply converts the tocanised (compiled) object back to commands but on this occasion it I have an earlier version of the sourcecode so I will be looking only at the additions and/or changes to the new object file.

 

Has anyone used this program before or are there any better ones out there? PC based preferably!

 

Tezz ;)

Link to comment
Share on other sites

I've just remembered about Dassi ! The PC based disassembler. It reads disk images as well as executables!

 

It correctly identified the Init and execute address but the disassembly only seems to identify the first 2 starting parts of the code and generates just this source? The memory dump window does show the complete file?

Link to comment
Share on other sites

bootsector byte 0-5 contain information about the data to load...

 

0

1 holds how many sectors are read by the ROM bootloader

2,3 init adress where the sectors are loaded to...

4,5 start adress which is jumped to after the init procedere is finished... often the start adress of the main programm

 

if my memories are not fooling me...so long ago... when cracking boot discs... ;) normally you have a further loader loaded in the 1st bunch of boot code which displays a kind of "loading" or a title screen...

 

but you can easily load the game in atari800win...press f8 quick enough at the title screen and try to figure out where the main code starts... normally you then save via monitor the memory range... f.e. $0500-$bfff and have a brief look into the programm counter with "show" and or a look into the system variables $0a,$0b,... where the reset adress or starting adress might be stored in...

 

the image file you have written with the "WRITE" command is written with file header as far as i know so you can easily add a starting adress by adding $e0,$02,$e1,$02,lo,hi at the file end where lo/hi is the starting adress...

 

double check it with xhead in the xasm pack... this is exactly how i have done it with trailblazer for "trackball" reengeniering.

 

if the header is not added by the atari800win monitor then you can do this easily with xasm...

 

org startadress

icl "dumpfile.dat'

org $2e0

dta a(init adress of the game)

 

and assemble...

 

? is your question answered?

Link to comment
Share on other sites

Heaven ? is your question answered?
Thanks Heaven, That's a great help. I'll work some more on this.

 

BTW. It's a shame that the disassembly listing command in Atari800Win Monitor cannot output to a file. It even comments the code for you.

 

Maybe on the next release. ;)

Link to comment
Share on other sites

Try DIS6502, it will do binary files, boot disks and a few more. Plus you can modify the assembler output format to match whatever assembler you use.

 

It says trial version on the web page but dis6502 has actually been free software for some time now.

 

http://www.atarimax.com/dis6502/

Link to comment
Share on other sites

Heaven ? is your question answered?
Thanks Heaven, That's a great help. I'll work some more on this.

 

BTW. It's a shame that the disassembly listing command in Atari800Win Monitor cannot output to a file. It even comments the code for you.

 

Maybe on the next release. ;)

 

yep but you can copy & paste the output, well not the best method but better than nothing.

Maybe you can patch the emu the source is available... ;)

Link to comment
Share on other sites

classics Try DIS6502, it will do binary files, boot disks and a few more. Plus you can modify the assembler output format to match whatever assembler you use.
thanks for that it looks very good, I'll check this out tonight.

 

Heaven the monitor in atari800win might be redirectable via command line stuff to a file
Yeah, I was looking at that possibility. I'll have to investigate this :)

 

Schmutzpuppe yep but you can copy & paste the output, well not the best method but better than nothing.  

Maybe you can patch the emu the source is available...

Yeah, I was concidering this even though it would be a long laborious job. Hmmm but the Monitor output doesn't seem to allow me to highlight to be able to cut and paste? I will definately write a DOS script if it's possible and post this back here for others

 

I guess I'll check out this new Dis6502 program. It seems pointless to manually input everything when a prog could generate a file.

 

Heaven have a brief look into the programm counter with "show" and or a look into the system variables $0a,$0b,... where the reset adress or starting adress might be stored in...
Thanks again for all that advice, I had a lot more success extracting the object file yesterday. although strangely the DOSVEC 0A,0B points to the programs start address, when I used XASM to add the run address header to the file, launching this in the emulator crashes it. I tried tirlessly for about 3 hours without discovering why. Although, I did get the program to run at the title screen, but the game wouldn't start so I guess I must have bypassed some important init code.

 

It can be a bit frustrating but, it is also a good way to learn with trial and error. :) Thanks everyone.

Link to comment
Share on other sites

:love: Wow, this is great! a couldn't wait to check out dis6502 so I have downloaded it now and it's very impressive.

 

The author will include a (.PRF) profile for any chosen assembler syntax with the next release.

 

I'll have a go a setting this up myself for XASM later. Here's a screenshot of the default M65 settings if any of you would like to set it up for their assembler or perhaps set-up for XASM with my mistakes!

post-4724-1092231959_thumb.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...