CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

understanding the pic .hex file format

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Nick
Guest







understanding the pic .hex file format
PostPosted: Thu Jul 07, 2005 9:30 pm     Reply with quote

I'm adding a simple encryption to a boot loader.

":1000000010308A0000280000FF00030E8301A100C9"

is the first line of a hex file, can someone break down the line?

I figure it has the address, data, and a check sum value

also sometimes i see lines that start with :0 what are those?
":0A385000272C99008A01002800349B"

Thanks Nick
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jul 07, 2005 11:39 pm     Reply with quote

Read the Microchip TB025 document, which talks about downloading
HEX files to PICs and explains the HEX file format.
http://ww1.microchip.com/downloads/en/AppNotes/91025a.pdf
asmallri



Joined: 12 Aug 2004
Posts: 1634
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

Re: understanding the pic .hex file format
PostPosted: Fri Jul 08, 2005 4:08 am     Reply with quote

Nick wrote:
I'm adding a simple encryption to a boot loader.


If you are going to build simple encryption then one challenge you will have to work with is that the record format is "well known". Generally records are a fixed length - this gives an obvious clue to the record format. Certain records are constant such as type 4 records. When constant records occur it is relatively easy to break the encryption. You will effectively need to pad all records to the same length. You have to have a psuedo random pad otherwise type 4 records can be readily identified. Once these are identified then it becomes easier to determine the key to break the rest. The encryption algorithm has to be such that changing a single byte (such as would be the case of a minor code change) should result in the charge in a large number of records (ideally all records) without any obvious pattern.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!


Last edited by asmallri on Fri Jul 08, 2005 8:30 am; edited 1 time in total
Nick
Guest







PostPosted: Fri Jul 08, 2005 5:06 am     Reply with quote

1. Only encyrpt type 0 codes
2. Only encrypt the four digit hex- words and the checksum


those are going to be my rules.

example
non-enc
:1000000010308A0000280000FF00030E8301A100C9
enc
:10000000KFIJI4OI3KL409FKFKLEOI904983IO489390


so the format is not broken and can be programmed ;-)

Nick
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group