Page 1 of 1

Super Nooby Questions, How can I read .Hex files?

PostPosted: Mon Oct 17, 2005 11:18 pm
by Spec C Wannabe
Hi All,

Am very new to this ecu things. I have downloaded ROM file from this forum and try to open it with Exel but it isn't readable.

Pls help me how to open and read it.

Also, most numbers that you guys talk about when referring to the ROM files are in Hex code??

Do I need to convert them into decimal code in order to fully understand the value of the parameters??

I am confused :(

Re: Super Nooby Questions, How can I read .Hex files?

PostPosted: Tue Oct 18, 2005 7:07 am
by ahains
Spec C Wannabe wrote:Hi All,

Am very new to this ecu things. I have downloaded ROM file from this forum and try to open it with Exel but it isn't readable.

Pls help me how to open and read it.

Also, most numbers that you guys talk about when referring to the ROM files are in Hex code??

Do I need to convert them into decimal code in order to fully understand the value of the parameters??

I am confused :(


I'm not sure where to send you to get started. I can tell you that my favorite tool for reading/comparing/editing binary data is Tiny Hexer. You can download it for free from here:
http://www.mirkes.de/en/freeware/tinyhex.php

As you may know, computers work with binary data. That means that on your hard drive, or in RAM, all data is represented as a series of 1's and 0's. These can also be thought of as "on" or "off", like a light switch.

There are multiple ways that you can view or edit binary data. Windows comes with a free calculator utility. If you run this and choose the "View" menu and choose "Scientific", it will give you more options. After you do this, there are four radio buttons in the upper left hand corner - "Hex", "Dec", "Oct", "Bin". You can use this utility to see how these things relate.
I won't go into much detail, but choose "Dec" and enter the number ten. Dec is short for "decimal", which means it is "base 10". Base 10 means that each position can represent 10 possibilities. Binary is base 2, so it can represent two possibilities (like how I mentioned on or off earlier).

"Hex" is short for hexadecimal, and it means base 16.
"Oct" is for base 8.

In base 10 (decimal), each position in a number is represented by the digits 0 through 9. After you get to 9, you set 9 back to the first value (zero) and set the next placeholder to the left to 1. This gives you 10.

Similarly, hexadecimal is represented by the digits 0 through 9 and the letters a through f. So to count to 17 as represented in hexadecimal you go:
0, 1 , 2, 3, 4, 5, 6, 7, 8, 9, a, b, c, d, e, f, 10, 11

This looks confusing because we think of "10" as ten and "11" as eleven, but in hexdecimal this really means that the first digit 1 represents sixteen.

So I don't know if that helped you or confused you more :)

I would suggest that you NOT go editing your ROM directly yourself until you are extremely certain that you understand what you are doing. Probably the easiest way to understand it will be to see someone walk through some examples of changing values. More likely though, you'll want to wait until there are some free utilities that give you an easy to use graphical interface to make these changes.

Spiider has published almost all of the information to make it easy to write this kind of utility, so I don't think you will have to wait very long for such a free application to come along.

Hope that helps!
Adrian

PostPosted: Tue Oct 18, 2005 10:57 am
by richip
Well, let's say I'm working with an HC16 disassembler that only knows the OP codes. Given an ECU ROM image, where does one find the initial jump address that the processor loads in its PC on power-cycle? In 6502 it's at 0xFFFE. In x86, I think it's the last 2 bytes in the 640K region as well (IIRC).

PostPosted: Tue Oct 18, 2005 11:34 am
by cboles
read the HC16 chip docs posted here. there is a vector table at 0x00000 that has the initial PC,SP,and other values. that is, the initial address is programmable.

PostPosted: Tue Oct 18, 2005 1:43 pm
by richip
That's what I've been looking for. I can't seem to find any HC16 documents. So far there's just the HC16 IDA Pro modules Colby wrote, and an HC16 flashing guide. I went through the whole Download list and found nothing.

PostPosted: Tue Oct 18, 2005 2:29 pm
by cboles
richip wrote:That's what I've been looking for. I can't seem to find any HC16 documents. So far there's just the HC16 IDA Pro modules Colby wrote, and an HC16 flashing guide. I went through the whole Download list and found nothing.



there are only hyperlinks to the docs... here:

http://forums.openecu.org/viewtopic.php?t=5