Commenting a disassembled binary file
Commenting a disassembled binary file
Anyone want to join in on a learning session on how to comment a disassembled binary file? Im trying to learn how to do it on my own and need some help and thought that everyone on the board could learn how also if they wanted to. What i have is a partially done file form a 94 cavalier, 2.2L, 16191947 ecm.
Any of the source code guys want to lend a hand on this? I think this could be a good start on more people learning how to read code and make changes to there files as needed.
Any takers? I cant upload the file here so i can email it to anyone that can so we can get it posted for others to download and follow along. thanks in advance!
Any of the source code guys want to lend a hand on this? I think this could be a good start on more people learning how to read code and make changes to there files as needed.
Any takers? I cant upload the file here so i can email it to anyone that can so we can get it posted for others to download and follow along. thanks in advance!
Supreme Member
Joined: Jun 2000
Posts: 7,554
Likes: 1
From: In reality
Car: An Ol Buick
Engine: Vsick
Transmission: Janis Tranny Yank Converter
While not a pro at it. This is how I've tackled it so far.
Read as many hacs that have the calibration end of it commented.
read the Source Code that I've posted.
If you have a disassemblied .bin.
then the next thing to do is getting it so that it assemblies. Once you get it to assemble, compare it to the original .bin to make sure that it assemblies correctly.
Not all disassemblies and assembliers are friendly with each other. So sometimes it takes alot of work to get them to play nice together. If you can get more then one assemblier, and have it assemble the .asm, like the other so much the better.
Find the ALDL datastream, as it identifies a few of the RAM locations. Once you get this far then you can start identifing some of the larger tables, and then cross referencing the tables in the calibration area to where they're mentioned in the code area.
NEVER USE a .TXT, or .DOC file type as good ole winders adds some header info that fubars the document, use .asm and maybe TextPad instead of WordPad.
At he end of the code are the vectors, that tell you where the code actually starts to get read.
Get real familiar with using *find*, and all the other shortcuts you can.
Hope you have a Motorola Pink Book, if not visit their site and get one.
Once you begin to fill things in some of gets more apparent.
There are somethings that just are difficult to figure out.
Be prepared to put alot of time into this.
More then you can imagine, unless your wel versed in assembly to begin with.
And it's exposure, you gotta spend at least some time on it every day. And yet, when you hit a wall know when to take a break, and just walk away.
Read as many hacs that have the calibration end of it commented.
read the Source Code that I've posted.
If you have a disassemblied .bin.
then the next thing to do is getting it so that it assemblies. Once you get it to assemble, compare it to the original .bin to make sure that it assemblies correctly.
Not all disassemblies and assembliers are friendly with each other. So sometimes it takes alot of work to get them to play nice together. If you can get more then one assemblier, and have it assemble the .asm, like the other so much the better.
Find the ALDL datastream, as it identifies a few of the RAM locations. Once you get this far then you can start identifing some of the larger tables, and then cross referencing the tables in the calibration area to where they're mentioned in the code area.
NEVER USE a .TXT, or .DOC file type as good ole winders adds some header info that fubars the document, use .asm and maybe TextPad instead of WordPad.
At he end of the code are the vectors, that tell you where the code actually starts to get read.
Get real familiar with using *find*, and all the other shortcuts you can.
Hope you have a Motorola Pink Book, if not visit their site and get one.
Once you begin to fill things in some of gets more apparent.
There are somethings that just are difficult to figure out.
Be prepared to put alot of time into this.
More then you can imagine, unless your wel versed in assembly to begin with.
And it's exposure, you gotta spend at least some time on it every day. And yet, when you hit a wall know when to take a break, and just walk away.
Thank you so much for the reply on this. Ill get the pink book asap! Ok, on the the assembler. Ive got the asm11 assembler and i use the cats disassembler. whenever i try and assemble it with the asm11, it gives me a wookie document. is this correct? i have the aldl datastream for it and will check some of the locations for it. example: if the datastream says spk adv rel to top dead center at location 4005. is that were the spark adv table is located? next, what do you mean by calibration end, the beginning or end? thanks grumpy.
Supreme Member
Joined: Jun 2000
Posts: 7,554
Likes: 1
From: In reality
Car: An Ol Buick
Engine: Vsick
Transmission: Janis Tranny Yank Converter
Dunno, wookie.
All the calibration data is at the beginning of the .bin file.
The data stream point to where the data for say the final spark computation is, not the table itself.
The 3D tables all have a header, then the table.
You do a serach here for Programming 101, and read thru that. Or at DIY-EFI.org, I forget where it's located there.
All the calibration data is at the beginning of the .bin file.
The data stream point to where the data for say the final spark computation is, not the table itself.
The 3D tables all have a header, then the table.
You do a serach here for Programming 101, and read thru that. Or at DIY-EFI.org, I forget where it's located there.
Supreme Member
iTrader: (2)
Joined: Jan 2002
Posts: 9,962
Likes: 5
From: Moorestown, NJ
Car: 88 Camaro SC
Engine: SFI'd 350
Transmission: TKO 500
Axle/Gears: 9-bolt w/ 3.23's
Wookie is a HC11 simulation program. Managed to slip onto my computer as well. Must have put it on awhile ago and forgotten. The files are assembled into motorolla .S19 format. TC has a utility that will convert it over to a bin file. From there, use a good hex editor like Hexworkshop or the like to compare the two and fix all the errors untill the compiled one is identical to the binary you used as the source.
Let me make sure i got this straight:
-download the bin from the prom and save as a binary file.
-Use a disassembler to create a wookie file
-Use a utility from TC to convert the wookie file to a bin file
-Use a program like hexworkshop to correct the mistakes on the bin to match the source bin i started with.
Is this correct? Is there anyway around the wookie file? im not sure why it keeps popping up.
Ill read up on programming 101 again and see what else i can get from it.
Anything im missing or doing wrong? I have a file started, ive downloaded it using the disassembler from TC and have tried to assemble it but all i keep getting is the wookie file. Is there a setting or something on the asm11 i need to change? thanks again!
-download the bin from the prom and save as a binary file.
-Use a disassembler to create a wookie file
-Use a utility from TC to convert the wookie file to a bin file
-Use a program like hexworkshop to correct the mistakes on the bin to match the source bin i started with.
Is this correct? Is there anyway around the wookie file? im not sure why it keeps popping up.
Ill read up on programming 101 again and see what else i can get from it.
Anything im missing or doing wrong? I have a file started, ive downloaded it using the disassembler from TC and have tried to assemble it but all i keep getting is the wookie file. Is there a setting or something on the asm11 i need to change? thanks again!
OK, ive brushed up on programming 101 and im glad i did. ill compare the locations to the bin i have and go from there. thanks grumpy.
also, what utility is it from TC that i need? S2BIN, or another? thanks
also, what utility is it from TC that i need? S2BIN, or another? thanks
Trending Topics
Supreme Member
iTrader: (2)
Joined: Jan 2002
Posts: 9,962
Likes: 5
From: Moorestown, NJ
Car: 88 Camaro SC
Engine: SFI'd 350
Transmission: TKO 500
Axle/Gears: 9-bolt w/ 3.23's
The wookie thing is jsut an association. The file is in standard motorola .S19 I think some burning software will allow you to burn directly to a prom using S19 format but to compare files its necessary to make it a binary.
ok, here is what im trying to accomplish:
1- I want to create an ecu file for the bin file i have. to do that, what all do i need to do?
2- I want to learn how to insert the human language into the file so i have the info to create the ecu file. What do i need to do to do that?
3-My main goal is to be able to alter my bin file and make the car respond how i want it to.
Ive been doing all the things suggested and im making progress, but i need a little more info on this. anybody up for my first suggestion on having a tutorial here? i could post the bin and then we could disassemble it and reassemble it and maybe do a comment or two together to learn how all this is done. are you interested grumpy or anyone else here? thanks for all your help.
1- I want to create an ecu file for the bin file i have. to do that, what all do i need to do?
2- I want to learn how to insert the human language into the file so i have the info to create the ecu file. What do i need to do to do that?
3-My main goal is to be able to alter my bin file and make the car respond how i want it to.
Ive been doing all the things suggested and im making progress, but i need a little more info on this. anybody up for my first suggestion on having a tutorial here? i could post the bin and then we could disassemble it and reassemble it and maybe do a comment or two together to learn how all this is done. are you interested grumpy or anyone else here? thanks for all your help.
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
The first thing to do is to disassemble the bin. You should have a file that looks something like this:
That will be source code. And probably several thousand lines in length. The next thing to do is to figure out what is what in the code and comment it. So it looks like this:
From that you can put together an ECU file from the calibration area. And, be able to change the source into a format that an assembler can assemble.
RBob.
Code:
LDEC5: LDAB L000D BITB #$10 BEQ LDED7 LDAA L000E BITA #$40 BNE LDF18 LDAA L00A4 BPL LDF18 BRA LDEBD
Code:
LDEC5: LDAB L000D ; STATUS WD BITB #$10 ; b4 BEQ LDED7 ; BR IF NOT b4 ; LDAA L000E ; A/F MODE Word Flag BITA #$40 ; b6, RICH BNE LDF18 ; BR IF b6 ; LDAA L00A4 ; INTEGRATOR, BIN BPL LDF18 ; BRA if INT removing fuel BRA LDEBD
RBob.
Supreme Member
Joined: Jun 2000
Posts: 7,554
Likes: 1
From: In reality
Car: An Ol Buick
Engine: Vsick
Transmission: Janis Tranny Yank Converter
Just to back up a little.
!) you need to be totally familiar with what scanned info. looks like under all conditions.
2) Have as many data logs from as many conditions as possible, from crank to WOT.
3) Be able to fire up the ecm bench, and know what to look for under all conditions and be able to do a sanity check with data logs.
4) The above three items are absolutes. Violating ANY of the above with leave you scratching your head for hours, and could pose a potentically dangerous driving situation.
5) This is very serious stuff when you fire up several thousands pounds of iron, and run it down the road at normal road speeds. You don't have to be going fast to have a serious situation develope. It can happen in reverse just pulling out of the garage.
6) THERE IS NOTHING SWEETER THEN THE FIRST TEST DRIVE WITH YOUR OWN SOURCE CODE.
!) you need to be totally familiar with what scanned info. looks like under all conditions.
2) Have as many data logs from as many conditions as possible, from crank to WOT.
3) Be able to fire up the ecm bench, and know what to look for under all conditions and be able to do a sanity check with data logs.
4) The above three items are absolutes. Violating ANY of the above with leave you scratching your head for hours, and could pose a potentically dangerous driving situation.
5) This is very serious stuff when you fire up several thousands pounds of iron, and run it down the road at normal road speeds. You don't have to be going fast to have a serious situation develope. It can happen in reverse just pulling out of the garage.
6) THERE IS NOTHING SWEETER THEN THE FIRST TEST DRIVE WITH YOUR OWN SOURCE CODE.
thanks rbob and grumpy, that is what i was looking for in an answer. rbob, i only get one line for each location when i do my disassembly and it does not look quite like yours. it is only like 3 digits long. am i doing the disassembly wrong maybe?
can you use my file and give an example here if i email it to you? form an example i can go from there with a good understanding.
can you use my file and give an example here if i email it to you? form an example i can go from there with a good understanding.
Supreme Member
Joined: Jun 2000
Posts: 7,554
Likes: 1
From: In reality
Car: An Ol Buick
Engine: Vsick
Transmission: Janis Tranny Yank Converter
Originally posted by clippjr8
thanks rbob and grumpy, that is what i was looking for in an answer. rbob, i only get one line for each location when i do my disassembly and it does not look quite like yours. it is only like 3 digits long. am i doing the disassembly wrong maybe?
can you use my file and give an example here if i email it to you? form an example i can go from there with a good understanding.
thanks rbob and grumpy, that is what i was looking for in an answer. rbob, i only get one line for each location when i do my disassembly and it does not look quite like yours. it is only like 3 digits long. am i doing the disassembly wrong maybe?
can you use my file and give an example here if i email it to you? form an example i can go from there with a good understanding.
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
Originally posted by clippjr8
. . .rbob, i only get one line for each location when i do my disassembly and it does not look quite like yours. it is only like 3 digits long. am i doing the disassembly wrong maybe? . . .
. . .rbob, i only get one line for each location when i do my disassembly and it does not look quite like yours. it is only like 3 digits long. am i doing the disassembly wrong maybe? . . .
Can you post a couple of lines of what you have?
When I do an disassembly I do a decimal dump on the calibration data area. For 3d tables I'll use PromEdit and manually format the tables with the rows/columns commands then cut and paste the table into the source. Less editing that way.
I use the interrupt vector table at the end of the bin to find the code start location. I'll use that for the end address of the cal data and the beginning address of where to start to disassemble.
RBob.
here is a few lines of what i have so far.
;-----------------------------------------------------------
; Table vs RPM vs MAP
;
; If RPM >= 4800 RPM use table @ $4153
;
; 13 x 17
;-----------------------------------------------------------
4073: FCB 000
4074: FCB 000
4075: FCB 013
; 400 RPM
4076: FCB 097 ;
4077: FCB 097 ;
4078: FCB 097 ;
4079: FCB 097 ;
407A: FCB 097 ;
407B: FCB 092 ;
407C: FCB 088 ;
407D: FCB 087 ;
407E: FCB 085 ;
407F: FCB 085 ;
4080: FCB 080 ;
4081: FCB 077 ;
4082: FCB 074
this is the spark table i presume. how does it look? now what?
;-----------------------------------------------------------
; Table vs RPM vs MAP
;
; If RPM >= 4800 RPM use table @ $4153
;
; 13 x 17
;-----------------------------------------------------------
4073: FCB 000
4074: FCB 000
4075: FCB 013
; 400 RPM
4076: FCB 097 ;
4077: FCB 097 ;
4078: FCB 097 ;
4079: FCB 097 ;
407A: FCB 097 ;
407B: FCB 092 ;
407C: FCB 088 ;
407D: FCB 087 ;
407E: FCB 085 ;
407F: FCB 085 ;
4080: FCB 080 ;
4081: FCB 077 ;
4082: FCB 074
this is the spark table i presume. how does it look? now what?
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
Now what? If the CATS disassembler gives that much info you are ahead of the game already. I would search the code for the 4073 address (start of the table) and comment it as the main SA table.
Look at other hac's and you will see a pattern. Most of this vintage GM code is similar.
Then you'll be able to see other things such as bias values, inital values, and so on.
Another tip is to find the ALDL transmit list and match it up to the ALDL values. Then you'll be able to label each of those through out the code. It is a process of building on top on building what you already have.
Just from the above table the code area will have the MAP & RPM, and possibly the TPS% RAM locations.
RBob.
Look at other hac's and you will see a pattern. Most of this vintage GM code is similar.
Then you'll be able to see other things such as bias values, inital values, and so on.
Another tip is to find the ALDL transmit list and match it up to the ALDL values. Then you'll be able to label each of those through out the code. It is a process of building on top on building what you already have.
Just from the above table the code area will have the MAP & RPM, and possibly the TPS% RAM locations.
RBob.
hey rbob, i actually had alot of help with that part of it with TC. the disassembler does not give you that much info. im still not sure how to get the rest of it either. here is a table from the bin i disassembled:
4072: 30 FCB $30
4073: 00 FCB $00
4074: 00 FCB $00
4075: 0D FCB $0D
4076: 61 FCB $61
4077: 61 FCB $61
4078: 61 FCB $61
4079: 61 FCB $61
407A: 61 FCB $61
407B: 5C FCB $5C
407C: 58 FCB $58
407D: 57 FCB $57
407E: 55 FCB $55
407F: 55 FCB $55
4080: 50 FCB $50
4081: 4D FCB $4D
4082: 4A FCB $4A
now how do i get the info to comment this part. as you can see it is the same location of the same bin file so i want to know how to go from this to the other section that i listed previously.
4072: 30 FCB $30
4073: 00 FCB $00
4074: 00 FCB $00
4075: 0D FCB $0D
4076: 61 FCB $61
4077: 61 FCB $61
4078: 61 FCB $61
4079: 61 FCB $61
407A: 61 FCB $61
407B: 5C FCB $5C
407C: 58 FCB $58
407D: 57 FCB $57
407E: 55 FCB $55
407F: 55 FCB $55
4080: 50 FCB $50
4081: 4D FCB $4D
4082: 4A FCB $4A
now how do i get the info to comment this part. as you can see it is the same location of the same bin file so i want to know how to go from this to the other section that i listed previously.
Moderator
iTrader: (1)
Joined: Mar 2002
Posts: 18,432
Likes: 233
From: Chasing Electrons
Car: check
Engine: check
Transmission: check
Learn to read the code, and become familiar with currently available GM hacs.
RBob.
P.S. also having the ALDL list is beneficial.
RBob.
P.S. also having the ALDL list is beneficial.
ok, will do and i do have the aldl info handy. To learn to read code, will i need more than a few hacks and the pink book from motorola? Ill keep looking at other hacks and see what i can do. any more advice you can give me for how to learn to read the code?
Thread
Thread Starter
Forum
Replies
Last Post
Elephantismo
Electronics
14
Feb 13, 2019 12:51 AM
Damon
Tech / General Engine
8
Sep 26, 2015 04:29 PM





