Archive for the ‘Programming’ Category

LMCC and Router Configs

Wednesday, October 22nd, 2008

Source code attached, see end of article.

I had to pull the password for the internet connection out of a router at work recently and stumbled upon a problem that didn’t seem to have much of a solution, the router allows you to save a binary copy of the config, but it didn’t appear to be a known format.

kosh@aerith ~ $ file config.bin
config.bin: data

So after a little digging I found a Zlib header in the file and found a resource on the internet that had a windows only decoder (which failed for me :( ) so I proceeded to figure it out for myself.

kosh@aerith ~ $ hexdump -C config.bin | head -n 2
00000000 4c 4d 4d 43 00 03 00 00 c9 1a 00 00 8d 0e 8d cb |LMMC............|
00000010 e0 a2 00 00 78 9c ed 3d 6b 73 db 38 92 9f ef 7e |....x..=ks.8...~|

You can see the Zlib style magic at the 20-byte mark (0×14, “78 9c”). I tested my theory by grabbing zpipe.c from the zlib website and using dd to decode it.

kosh@aerith ~ $ dd if=config.bin of=test.bin.Z bs=20 skip=1
342+1 records in
342+1 records out
6857 bytes (6.9 kB) copied, 0.0165227 s, 415 kB/s
kosh@aerith ~ $ ./zpipe -d < test.bin.Z
<config version="3.7.0" fsstamp="20061221093151">
....
</config>

But considering I was 5 minutes from a simple working setup, I hacked zpipe.c down and made zlmcc.c from it. I've made zlmcc.c available for anyone else that wants to deflate these files quickly.

Usual guarantee applies, if it blows up the world, not my fault. I only tested it on my system and with my single config file, using the above steps you should be able to figure it out if they change the format by a little (offset, etc)

KoshWiki - zlmcc.c

World of Warcrack

Friday, August 31st, 2007

Yeah, I’m back and coding stuff like always.

I’ve got a script that pulls the XML data out of the armory, parses and stores it for later use in a database.

w0000t

Merlin

Thursday, June 28th, 2007

I’ve always had an interest in home automation, a dream of having a house that can filter out the noise and give me the signal for life.

Part of that is having news, TV guides, everything being indexed and filtered, with some basic smarts to give me “just the news I want, plus a little bit of fun” and warnings that TV shows I might be interested in are coming up.

You know, the usual geek fantasy.

I use alot of scripts to do many little tasks for me, I use Python on my media center to display the caller ID of incoming calls (I borrowed the outline from CallerID script and then made heavy modifications to let my VoIP system send the data, I made a database for MyDNS with phone numbers, allowing a recursive lookup to tell me everything from country to “exchange” for a phone number then give me a Name if they’re known.  I use RSS feeds and filters to give me news I’m interested in, and some that i’m not, I wrote some basic pattern matching to group news stories about the same thing, then attempt to put them chronologically so I can read through them in order when I get time.

But I want to start centralizing this, I wanted a project that would encapsulate all my previous scripts into a system, I wanted a trusted messaging network, so I could have client machines sending information to their nearest/parent server that would cache and route the information around the “network”.

So Merlin was born, merlin is eventually going to be a mix of UDP broadcasts for my home LAN and unicast for my co-located servers, with bi-directional messaging and a form of routing so that any machine in the groups can send messages by content type or by server to anything in the network.

So say I receive a incoming call, Caller ID content type with a “instant” priority level will go out and be passed out through the network to any machines that handle callerid, or “system status” containing hard drive free space might heartbeat out with low priority, so it will make its way around the network to the server/servers that store and catalog that data.  Eventually I want my car to have its own segment, but sine GPRS charges in australia are evil, it could get low bandwidth updates and receive instant updates of certain classes (eg “Instant/High” priority server down messages)

It’s alot of work and I’ve only started coding small parts of it (hell, I just started one of the XML handlers the other night thanks to my previous article about not playing WoW :P )

PIC LCD Clock

Thursday, April 20th, 2006

I’m so going to play with this when I get some time.

I have a 40×2 LCD at home

Unspecified Error “80004005″

Wednesday, April 19th, 2006

I hate IIS/ASP.

UNSPECIFIED ERROR !!!! WARNING DANGER WILL ROBINSON !!!.
How about “DANGER !!, you are about to step off a cliff … at line 1045″ :P

(more…)

KittenAuth

Sunday, April 16th, 2006

So simple. but it just works.

It stops computers from jumping their way in and is alot easier than most of those “type the combinations” that are hard to read even for human eyes.

I might give this a go on the next bb I setup.

Wordpress – Skin

Sunday, March 26th, 2006

I’m modifying a skin from Ajay D’Souza (http://www.ajaydsouza.com/) for my EVE Corporation.

Check out Crystal Ship Corporation

I’ll update this later with a download link for the theme.

(more…)

.NET Service Applications

Tuesday, February 7th, 2006

This is more for my personal reminder.

I’ve looked this up twice, I need to finish my “kosh kdb” (Kosh Knowledge Data Base) which I was working on, and someday will finish….

To install your service manually

1. Access the directory in which your project’s compiled executable file is located.
2. Run InstallUtil.exe from the command line with your project’s output as a parameter. Enter the following code on the command line:

installutil yourproject.exe

To uninstall your service manually

* Run InstallUtil.exe from the command line with your project’s output as a parameter. Enter the following code on the command line:

installutil /u yourproject.exe

Tip You can launch Server Explorer, and verify that your service has been installed or uninstalled. For more information on launching Server Explorer, see Accessing and Initializing Server Explorer.

Note The Servers node of the Server Explorer is not available in the Standard Edition of Visual Basic and Visual C# .NET. For more information, see Visual Basic Standard Edition Features or Visual C# Standard Edition Features.

Space Daemon UDP

Wednesday, January 25th, 2006

Anyway.

So I went back to poke around with my two favorite toys, UDP Broadcast and XML Serialization.

And it started a journey …. that lasted a few hours and was kinda cool ….

(more…)

Space Daemon UDP

Wednesday, January 25th, 2006

I have a fair bit of work to do, but when I get stuck coding I like to go off an finish or improve something I started a while ago.

So I rewrote my “space daemon” for my home network.

I was working on a udp based “system status” service for my windows / linux boxen a while ago, this was just a step towards it.

I’ll leave the geeky detail off the main page, ooh brb Kernel COmpile finished,

rebooting.