RSSAmplifier

Blog

Code++

Reverse Engineering

codeplusplus.blogspot.comRSS feed ↗15 posts

Latest posts

ReOSing a Sun Netra X1

Steps for installing Solaris 10 on a sparc server over serialI have a Sun Netra X1 running Solaris 5.8. I needed to blow it all away and install a fresh copy of Solaris 10 so I could sell it. I had done this before on a few sparcbooks and I remember it being complicated and there being a lot of conflicting information out there. So I figured I'd document the process, just in case I need to

Setting up a cheap bench power supply to provide -12V, +12V and +5V with common ground.

I have a cheap bench power supply, $50 on ebay, marked RSR HY3002-3. It has two variable outputs and one fixed 5V output. The variable outputs are capable of 2A, the fixed of 3A.If you put the machine in series mode, it ties the grounds together and locks the slave voltage to the master voltage. Which turns out to be perfect for providing the various power rails needed by a

World Builder Formats

The following is documentation that I've created as a result of reverse engineering the various file formats used by World Builder games.NOTE: All types are big-endian unless otherwise specified.OverviewIt is assumed that you can read HFS disk images. As a part of being able to read HFS disk images, you can also parse a file's resource fork. All of this is well-documented on the

Self-Modifying Code

When you read about programming in the 80s, often there is a discussion about how common assembly was. You'll hear about all sorts of mystic tricks and tips that programmers back then used. You might have also heard reference to "self-modifying code". When I was younger, "self-modifying code" always sounded so advanced. It was something that only the very brightest people did,

A Word Search Generator

A while ago I needed to generate a daily word search using a word list that was unique for each day. I didn't find anything online so I invented my own algorithm. It is designed to encourage words to overlap as much as possible. The setup for the algorithm is very simple and a bit boring, so I'll just cover the basics here. The two things we need before we begin is a list of

Oldschool planar graphics and why they were a good idea

Oldschool planar graphics If you ever work with old hardware, like writing an NES emulator or reverse engineering an old Amiga game, you will inevitably come across planar graphics modes. These days, with loads of memory and huge color depths, graphics are stored sequentially. It makes the most logical sense. The red, green, and blue values for each pixel are just stored in an

Understanding larger disassembly

This past weekend I was disassembling something and it struck me how few people knew how to do what I was doing. So I figured I would quickly document the process of taking a chunk of disassembled code and putting it into a format that's easier to understand. The disassembly I'm going to use for my examples is the same disassembly I was working on this weekend. It is the music playing

Found Data

I'm always interested in found data. Little notes buried in executables and other strange places. These are usually intended to be seen only by those curious enough to fire up a hex editor, or do a little reverse engineering.Here's an example. On the 68k Macintosh, executables usually only have a resource fork. All the code is stored in CODE blocks in the resource fork. So I was curious when

Web Font Shorts

A posting on reddit lead to a discussion on typefaces. In particular one poster asked about the kerning of a word. Surprisingly, the kerning was perfect for me. I decided to compare it across the browsers I have access to.Here's the kerning in Firefox on Linux (Stock Ubuntu Gutsy):Notice how the A and V overlap? That's correct kerning.Here's how it looks in Firefox on OSX Tiger:Aside from the

Malicious Banner Ad

We ran into a malicious banner ad yesterday. People would randomly get redirected to a malicious website. You can imagine that it's a pretty tough thing to diagnose. It turned out to be a flash ad. I was able to disassemble the banner ad to see how it worked. The banner is "protected" and compressed, so hex editing the banner doesn't show any text.Using Flare to decompile the actionscript in

char pointer versus char array

There are two basic ways to assign a string literal to a local variable.char *p = "string";char a[] = "string";I was curious to see how gcc handles the two.In both cases, "string" is put into .rodata This means that with the first method, you must not modify the contents of "string".p[3]='o'; // this causes a segfault.So technically, the first method should be:const char *p = "string";With the

Mobile Gmail API

Did you know that Gmail provides a handy, light-weight API for gmail? Google's gmail midlet uses this API.Mobile Gmail BasicsFirst thing to note, all responses from the server are in the form of UTF8 string lists. There is a 16 bit word (in network byte order) that represents the length of the string, followed by that many bytes. Then another 16 bit word for the next string, and so on. The

128-bit programming challenge

Here's my entry for the 128-bit programming challenge. Not a single lookup table in there. The resulting stripped binary is down to exactly 500 bytes.; nasm -f elf hex.asm; ld hex.osection .textglobal _start_start: mov ecx,10h mov esi,hex mov edi,bufferlp: movzx eax,byte [esi] mov ah,al and al,0fh cmp al,0ah sbb al,

QPS Protocol

The following describes the format of the QPS 3.5 protocol. Earlier versions of QPS are very similar, with only minor packet changes. All communication between the client and the QPS server is done via Messages.Message from Client to Server.0000 0002 Session ID0002 0002 Code0004 0004 Version (0x003f003f)0008 0002 Sequence Number000a 0004 Sub-Data Length000e 0004 Packet Length0012 **** Data****

Quark file format

This is the file format used by Quark Copydesk.The file is broken into chunks. Each chunk is exactly 256 bytes long. Chunks are identified by their ID number. Chunk 1 starts at position 0, Chunk 2 starts at position 512, and so on. The first chunk in the file contains the header followed by the TOC.Quark Header:The first thing in this file is a 26 byte Quark Header.0000 0004 File Format