How to convert your ITB-100HD to MPH *FREE*

yakpimp

Member
Joined
Mar 30, 2013
Messages
43
Reaction score
4
Location
WEST
Country
United States
I spent some time today looking into this because the km/h thing means nothing to me being from the USA. This will allow anyone with decent computer skills to make the change on their own. Enjoy!

The wordpress write up has images to make it easier to follow.
http://yakhack.wordpress.com/2013/03/29/194/

Last week I decided to get myself a dashboard camera to record crazy things I see on the road while driving. After lots of reading and comparing different cameras, I decided to buy the Itronics ITB-100HD.

There are a couple things about the camera that I’d like to change.
1. The onscreen speed output it written in km/h. Since I’m in the USA that doesn’t mean anything to me and I’d rather have it in MPH.
2. All video files are saved to the root of the attached SD card. This isn’t really so much a problem as it is an unfortunate implementation detail. I’d like to use an Eye-Fi card with the device so that I can automatically transfer files to my home network when I pull into the garage. More on this later.

I had seen online that there was a guy that spent some time working to make the device display in mi/h instead of km/h. He did some great work, but ended up selling the patched image on ebay rather than sharing the binary with other folks who wanted to do the same thing. Also mi/h, while technically correct is not what I expect when I see a speed. I much prefer MPH since that is how speedometers are typically labeled.
I decided to see if I could reproduce the same type of mod to the firmware that the other guy did, but do it without paying for it, and then share it with anyone else who wanted to do the same.

The device has the ability to update its firmware from the attached SD card slot. It’s as simple as putting the binary on the SD card and booting up the device. I figured that would be a good place to start, so I downloaded the latest v2.1 firmware and got to work. What I found was pretty interesting. I spent some time looking at the binary to see if it was a well known format. It turns out it was a gzip file, which contained a tar file, which contained to gzip files, which contained more tar files.

Once you get through the layers of the onion you find out there are a bunch of files in the ipnc folder within the it100_fw file. Using IDA I was able to disassemble the binaries in this folder and find that there was actually a lot of symbol information in the files, which made it a lot easier. It took me a while to find what I was looking for, but eventually I found a function called AVSERVER_getCurrentSpeed. This seemed like a good place to start and after a bit of time I followed the logic and figured out what I had to do.

If you look at the above code you can see that the getCurrentSpeed function is called from within swosdDisplay. At that point it does some flag check and then prints the current speed. The flag appears to be the flag that sets if the speed is printed on the video or not. I figured I didn’t need that and could steal that code space from 00025F1C -> 00025F28. My goal was to apply a simple medication to the km value that was returned from getCurrentSpeed prior to when it’s used in sprintf. After some quick google searching I found the conversion 1 kilometer = 0.621371192 miles. I just needed to write some new code that multiplied the km value by 0.62137. I came up with the following code.

EOR R1, R1, R1
MOV R1, #0x27C
MUL R1, R1, R0
MOV R12, R1,LSR#10

What this basically does is load 636 into R1, then multiply the km value by R1, then divide it by 1024. This essentially multiplies the value by 0.62109375 which is pretty close to the conversion value. It also fits nicely into the space that the old four instructions were using.
I didn’t have an ARM encoder, but had some friends encode the instructions for me so I could drop it into the original binary. There are several tools to do this, I just hadn’t used them before and I’m glad I knew some people who had. Once I had the raw bytes I was able to modify the binary file directly and replace the old code bytes with the new ones.

I wanted to make sure the bytes were right so I loaded the newly modified binary into IDA again to see if the change resulted in the correct disassembly. I’m happy to say after loading the bytes in the wrong order the first time. A quick fix solved the problem and I had the exact code change that I wanted.

The only thing left to do was to find the constant string that was used in the sprintf, and convert the ascii from “km/h” to “ MPH” I decided to add a space for aesthetic reasons.

The final step was to package the whole thing back up in the reverse order of how I unpacked it. tar->zip->tar->zip. The end result is --- MPH instead of --- km/h. Hopefully this helps other people who want to make this modification.
 
Last edited by a moderator:
Re: How to convert your ITB-100HD to MPH

Good to see you worked it out, even better to see that you're sharing your work, great stuff
 
Re: How to convert your ITB-100HD to MPH

Well done.
 
Re: How to convert your ITB-100HD to MPH

Great work, nice description. The IDA name made me remember some old days.

enjoy,
Mtz
 
Re: How to convert your ITB-100HD to MPH

Hey Yak,

Posting the same question I did in the other thread where you replied to me. Can you modify the bitrate aswell ? :)
 
Re: How to convert your ITB-100HD to MPH

Thanks yakpimp for sharing this!
 
Re: How to convert your ITB-100HD to MPH

Here's an image of it in action.

aQDhuxw.jpg
 
Re: How to convert your ITB-100HD to MPH

I'm in awe at some people computer skills.

Thanks for sharing your knowledge and creation yakpimp.
 
Re: How to convert your ITB-100HD to MPH

I can only get so far on my own. I have the luxury of having some amazingly smart people around me who were willing to help me learn and get past the thing I don't understand. Honestly this was a learning project for me, and it was pretty fun.
 
Re: How to convert your ITB-100HD to MPH

A user noticed that prior to the GPS being ready the text at the top of the screen gets pretty mangled. It's due to the fact that I took over some branching code to convert.

I just uploaded a new version to skydrive called itb100hdfw_MPH_Branch.bin that has what I think will fix the issue you were seeing before the GPS has a signal. My camera is scheduled to arrive any minute.

The itb100hdfw.bin is still the one that has the original fix, but has the string output issue when the GPS isn't ready.

http://sdrv.ms/127WNlr
 
Last edited by a moderator:
Re: How to convert your ITB-100HD to MPH

Great news!
I hope you will enjoy the camera and find other things which can be improved.

enjoy,
Mtz
 
Re: How to convert your ITB-100HD to MPH

Yeah, there are some requests for bitrate changes, and I'd like to change the output folder to allow eye-fi cards to work.
 
Re: How to convert your ITB-100HD to MPH

Also I don't like the korean style to put videos in different folders and allocating some special space for different files. Because the event files are creating just for small bumps the user will quickly fill the event folder.
But I am not so sure how you will solve the loop recording erasing feature. Will be great if the erasing feature will work based on file name (type): when the card is full, the erasing feature to erase the same type of file, not the oldest one. In this way you will keep the parking or event files more on SD card.

enjoy,
Mtz
 
Re: How to convert your ITB-100HD to MPH

I don't think i'll go too crazy with it. I'm planning to just change the folder to record files into a DCIM folder. Hopefully that is enough to get the eye-fi cards to auto-upload them. If not I might have to truncate the file names to 8 chacters, which might be tough.

Fully working and tested MPH hack http://sdrv.ms/127WNlr
 
Last edited by a moderator:
Re: How to convert your ITB-100HD to MPH

You already have the Eye-Fi card?
You must keep working the loop erasing feature. A dashcam without this feature is not a dashcam.

enjoy,
Mtz
 
Re: How to convert your ITB-100HD to MPH

Mtz said:
You already have the Eye-Fi card?
You must keep working the loop erasing feature. A dashcam without this feature is not a dashcam.

enjoy,
Mtz

I have an old one sitting on my desk. Yes.
 
Re: How to convert your ITB-100HD to MPH

Mtz said:
You already have the Eye-Fi card?
You must keep working the loop erasing feature. A dashcam without this feature is not a dashcam.

enjoy,
Mtz

what do you mean? Doesn't it already have the loop erase feature. Erase oldest.
 
Re: How to convert your ITB-100HD to MPH

Yes, but if the software is searching the files in some special folders like Movie, Event, Parking and you will put the files in another place the firmware will not delete the old files.
The loop erasing feature can be disturbed if a lot of space is used outside that special folders or in that folders to be other files than the camera created.

enjoy,
Mtz
 
Re: How to convert your ITB-100HD to MPH

Oh I see what you are saying now.

I've temporarily abandoned that idea since it turns out eye-fi wants to charge me to enable some features since the card is so old. If I happen to find a good deal on them in the future I may revisit.

I think I'll take a look at nitrate next, not sure how far ill get.
 
Let us know about how the bitrate modification is going :)
 
Back
Top