PDA

View Full Version : Making a .bin



Snipesy
November 23rd, 2016, 09:22 PM
So I figured some of you have multiple files... Maybe with a jtag read, and they are disorganized. Hopefully this will help you in sorting them together into a single .bin, mainly for .cax development.

Step 1. Make a giant hex file filled with FF FF for whatever size you need to be (like 4Mb maybe). You can use any hex editor, notepad++ will work.

Step 2. Find a piece of your read, any piece will do. Then try to find an obvious segment and go to the end of that segment. You will find some bytes that go like this.

55 55 04 00 41 31 32 36 37 38 32 35 32 41 41 01 00 00 38 80 00 E0 07 00

Yours will look different, obviously, but it will be at the end of every segment.

Anyway let's disect this, this contains the part number or software id or whatever you want to call it: 12678252 (31 32 36 37 38 32 35 32). Hopefully this will help you find it if you know the part number.

After this skip ahead a few bytes to 00 00 38 80 which is an address. Do some byte swapping you will get 80380000. Now this is the address in the ecu, which you don't want so slice off the 80 and you get 380000.

Step 3: Paste the segment to that address.

Repeat for each segment. Verify by importing to efi live. Wuhlah, you went from junk to something more reasonable.

Additionally the bytes immediately following is the size of the segment (in this case,7E000). Make sure your paste is that size. I'm sure this is enough info that you will figure it out.

GMPX
November 24th, 2016, 10:55 AM
Bosch (Tri-Core) stuff is hard because of the dumb $80xxxxxx offset to the real position in the bin....and everything is stored backwards :yucky:

Snipesy
November 24th, 2016, 11:50 AM
Endianness was a pretty big mistake... Lititle endian which is what this is, is simpler to do math on (because math is done small side first). But in practice it really doesnt matter. It's just something to add to the pile of complexity...

GMPX
November 24th, 2016, 02:16 PM
It depends on what you first experienced. I've only known Motorola CPU's since the 80's which of course have numbers in the order that our brains process easier.
Would you rather pay $00.95 for a chocolate bar or $95.00 :grin:

joecar
November 24th, 2016, 04:42 PM
+1 Motorola for me, hex addresses view easier in big endian as Ross said.