Sponsors

Cracking software on the mac 7

Posted by Darshan Patil Sun, 11 Mar 2007 05:57:00 GMT

Cracking software on the MacOSX is easy. Once you install XCode you pretty much have everything you need to crack software. Software you need:

gdb - Debugger
otool - Disassembler
otx - GUI for otool
nm - Displays symbols in a binary
Hex Fiend - Hex editor

If you've done any kind of hacking on linux, using gdb should be familiar to you.

gdb commands you would use:

set disassembly-flavor intel
This sets the disassembled output to intel syntax from the default att syntax.

disassemble functionname
This returns the assembly listing for a function

stepi/nexti
Step into/next instruction

info registers
Displays the registers and their contents

x/FMT ADDRESS
Examine memory. Run help x in the gdb for details.
example: x/10xb 0x989b
displays 10 bytes in hex starting at 0x989b

break
Set a breakpoint. Run help break for details

bt/where
Displays the stack trace

up/down
Move up and down the stack frames

How to crack ?
Cracking is illegal and you should only be doing this to check how easy it is for someone to crack your application. I could give you step by step instructions on how to crack a commercial application but that would be both illegal and unfair to the app.

To crack an application:
1 - Run nm & otool on the application to get the list of symbols and the disassembled output. You can look at the disassembled output to get a grip on the code flow.

2. Run the application under the debugger and set breakpoints in functions you think are interesting. Or better yet, when the registration/unlock screen pops up, hit ctrl-c in the debugger and get a stack trace to find out functions you should be looking at.

3. Once you find the function you need to tweak, see the instructions that you need to modify. You NEED to know assembly for this. Once you find the instructions you need to replace, find the machine code equivalent. Once you get the machine code, you can use a hex editor to replace the current instructions with the new ones. This is the basic premise, but there are some caveats to this that you need to know about. Sometimes, you will need to replace x bytes of machine codes with y bytes where x > y. This is the easy case, you can put nop instructions for the unused bytes. Things get considerably harder the other way around. You need to find an equivalent instruction that does the same thing or sometimes rewrite the complete function.

Technorati Tags: ,

Bit the bullet and bought a MacBook 3

Posted by Darshan Patil Thu, 08 Mar 2007 18:48:16 GMT

My sister stepped on her laptop a few months ago. So I gave her my old trusty laptop which I had not been using for a while. All 8 lbs of my trusty HP laptop from 2002. It was still a good machine and she is happy with it.

I have a linux box and a windows box setup with dual monitors. I normally use the windows box and use Exceed to connect to the linux box. This setup serves me well. I miss my laptop on days when I want to lie down on my couch, watch TV and do stuff on the computer. So I was in the market for a laptop.

I had been eyeing the macbooks for a while. I'm a man. Things that look good attract me :). I also knew that MacOSX has a UNIX core so, it would not be too hard to adapt. The fact that I could install linux/XP on the macbook made my decision a little easier. Anyway long story short, I got a MacBook.

I love the hardware. Looks nice, feels nice and just works. I'm getting used to MacOSX. There are some things which I don't like about it.

1. There is no concept of maximize in the mac. I hate having to resize windows manually to use the full screen.
2. No right click. Ctrl-Click gives you a context menu like the right click on Windows. I guess I would be a lot more productive on the mac if they had a right click button.

Anyway more to explore. But I like what I see. I can drop into the shell and build, install utilities I need, the UI is nice. Most of the apps I need on the go are available.

I don't think I could do away with my linux & windows boxes though. I would need them just to develop on those platforms. And there are apps there that I just cannot live without.

"Mac OS X Leopard for Starters: The Missing Manual" (David Pogue)