Nada Labs

Author Archive

File format reverse engineering – Redux

by on Jan.27, 2012, under Hacks, Software

I was contacted by a visitor of this site asking for the following:

‘I read your nice article on file format reverse engineering and was wondering if you could give me a small tip / hint about compression / encryption. I am trying to understand a constant size file format and need to know if by any chance the file is compressed or encrypted in a simpler way, which leaves hope in cracking it.

In the case you would like to have a look at the files, I generated 2 pairs. The first file pair differs only in that one variable. The second file’s name and caption are set to “;1″;, the file 2b to “;1111111…”; (31 chars)’

As the reader seeked advice on how to proceed further and provided enough information to investigate the problem, I took a look. (continue reading…)

Leave a Comment :, , , more...

GPS Logger VII – Componets and Assembly

by on May.30, 2010, under GPS Logger, Projects

Finally the components arrived. The next step was to check them against a printout of the PCB to ensure that all the footprints matched up. I had already checked that the printout was a 1:1 scale of the PCB artwork.

(continue reading…)

Leave a Comment :, , more...

Copper Tree

by on May.09, 2010, under Projects

For Mothers Day this year I made an ornamental tree from copper wire. This post documents the steps that I took to build it.

(continue reading…)

Leave a Comment :, , more...

Converting a GeoRSS file to a Google Earth kml

by on May.04, 2010, under Hacks, Software

I had a need to convert GeoRSS files used with iMapPlot to a Google Earth kml which I accomplished with the following shell script. It’s ulgy but gets the job done. The script can also be downloaded: rss_process.zip

#!/bin/bash
infile=$1
outfile=`echo $infile | sed -e 's/\.xml/.kml/'`
grep -E '^<(title|description|georss\:(point|line)|link)>(.*)</\1>' "$infile" | sed -r -e 's/(-?[0-9]{2,3}\.[0-9]{1,}) (-?[0-9]{2,3}\.[0-9]{1,})/\2,\1,0/g' -e 's|<(title)>(.*)</\1>|\t<Placemark>\n\t\t<name>\2</name>|' -e 's|<(georss:point)>(.*),(.*),0</\1>|\t\t<LookAt>\n\t\t\t<longitude>\2</longitude>\n\t\t\t<latitude>\3</latitude>\n\t\t\t<altitude>0</altitude>\n\t\t\t<range>500</range>\n\t\t\t<tilt>0</tilt>\n\t\t\t<heading>0</heading>\n\t\t</LookAt>\n\t\t<Point>\n\t\t\t<coordinates>\2,\3,0</coordinates>\n\t\t</Point>\n\t</Placemark>|' -e 's|<(georss:line)>(.*)</\1>|\t\t<LineString>\n\t\t\t<tessellate>1</tessellate>\n\t\t\t<coordinates>\2</coordinates>\n\t\t</LineString>\n\t</Placemark>|' -e '1 s|.*<Placemark>|<?xml version="1.0" encoding="UTF-8" ?>\n<kml xmlns="http://www.opengis.net/kml/2.2">\n<Document>\n|' -e '$ s|(.*)|\1\n</Document>\n</kml>|' -e 's|<(link)>(http://.*)</\1>|<description><a href="\2">\2</a></description>|' | sed -r -e '/<\/description>/ {
N
/\n.*<description>/ {
s/<\/(description)>.*\n.*<\1>//
}
}' | sed -r -e 's|<(description)>(.*)</\1>|<\1><![CDATA[\2]]></\1>|' > "$outfile"

An attempted explaination

The grep command only grabs the tags from the RSS file that we are interested in.

The first sed statement 's/(-?[0-9]{2,3}\.[0-9]{1,}) (-?[0-9]{2,3}\.[0-9]{1,})/\2,\1,0/g' finds two sets of numbers seperated by a space and swaps their order while seperating them with a space and appending ,0. This converts the ‘latitude longitude’ coordinates into ‘longitude,latitude,altitude’ as used by Google Earth.

The second statement converts the title block into a Placemark and name block.

The third formats a point placemark, providing look at information while the fourth converts a line placemark.

The fifth inserts the kml header while the sixth inserts the kml footer.

The seventh sed statement converts a link block into a description block with a HTML link in it.

The second sed command merges two description blocks into one by removing the first close block and the second open block.

sed -r -e '/<\/description>/ {
N
/\n.*<description>/ {
s/<\/(description)>.*\n.*<\1>//
}
}'

This is accomplished by looking for the </description> block and loading in the next line if it is found. The next line is then checked for the <description> tag and if found a replacement is performed removing the two tags and any characters in between.

The third sed command wraps the description in a CDATA block to allow HTML to be included in the description.

Leave a Comment :, , , , more...

Curtains for the Crusier

by on Apr.16, 2010, under Landcruiser, Projects

As I travel around Australia I will need to be able to sleep in the ‘cruiser and store items in it out of sight so I made some curtains to cover the 4 side windows, the 2 back windows and to divide the front and back. Thinking about how to mount the curtains (continue reading…)

Leave a Comment :, , , more...

Introducing the Landcruiser

by on Apr.09, 2010, under Landcruiser

I purchased a 1995 Toyota Landcruiser HZJ75 Troopcarrier with the intent of decking it out to travel around Australia beginning June/July 2010. This particular one I found through the Quokka with almost 400,000km on the clock with a new engine 120,000km ago, rebuilt gearbox and various other work done to it. It’s a stanard straight 6 4.2L Diesel and still has the bench seats in it.

My Landcruiser Troopy (continue reading…)

Leave a Comment : more...

GPS Logger VI – PCB Layout and Case

by on Apr.06, 2010, under GPS Logger, Projects

Progress has been made on the GPS Logger over the last month. A sutiable case for the project was purchased, components ordered from Mouser and the circuit board designed. Once the component footprints have been checked off the design will be sent to BatchPCB for manufacture.

PCB Artwork for the GPS Logger

(continue reading…)

1 Comment :, , , , more...

GPS Logger V – Full hardware

by on Mar.05, 2010, under GPS Logger, Projects

Having determined the battery and power requirements, a full schematic of the GPS logger was made. Buck regulators and Li-Ion battery chargers were investigated from a variety of manufacturers. The TC105 3.3V Buck regulator and the MCP73863 4.2V Li-Ion battery charger, both from Microchip, were chosen to provide the power needs for the project. The circuit is capable of detecting if a USB port is a Charging Port and adjusting the battery charge current to suit.

GPS Logger Schematic implementing battery charging and USB Charger Port Detection

(continue reading…)

2 Comments :, , , , , more...

GPS Logger IV – Power and Batteries

by on Mar.03, 2010, under GPS Logger, Projects

The prototype is at the stage of being able to successfully achieve GPS lock, log the received coordinates, waypoints and go to sleep. The power usage of the system needed to be analysed in order to specify the battery requirements. The current draw was monitored after the 3.3V regulator as the device was put into its various modes.

Looking at the current draw of the PIC, SD Card and GPS receiver (continue reading…)

Leave a Comment :, , , , more...

GPS Logger III – NMEA Processing

by on Feb.20, 2010, under GPS Logger, Projects

The GPS Logger is currently able to access files and directories on a FAT16 filesystem, contained on a SD card. This post covers processing NMEA with a finite state machine and some of the problems encountered so far with the logger. (continue reading…)

Leave a Comment :, more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...

Archives

All entries, chronologically...