Skip navigation.

taviso

linux, programming and security

x48 calculator

I'm about to request arch teams mark x48 stable, an awesome hp48 calculator emulator. If you own an hp48 calculator you can use the utilities accompanying the package to dump the firmware from it and use x48 for any purpose, otherwise you will have to use the firmware image provided by hp that is only available for non-commerical use. If you've never had the opportunity to use an hp48, you should definitely give it a try.

There's a screenshot of x48 in action here.

algebraic syntax assembly

,

We really need a free software algebraic syntax assembler, I've recently discovered a proprietaty language called terse that you'll love if you ever need to use assembly language in any of your projects.

terse is a free-form assembly language that makes assembly code more structured and recognisable, and also frees you from the annoying task of inventing new labels every 5 lines (my pet hate). I'm currently getting familiar with terse, but it's a pleasure to write compared to any standard assembly syntax, without sacrificing any of the power. Here's a hello world in terse:

segment .data;
    'msg = ("hello world",0ah);
segment .text;
global _start;
_start:
    eax = 4; 
    ebx = 1;
    ecx = $msg;
    edx = 12; !80h;
    &eax+; &ebx; !80h;

$ terse hello.t 
ÄÄÄÄÄÄÄ The terse (tm) Compiler, Version 2.20 ÄÄÄÄÄÄÄ
Copyright (C) Jim Neil 1989-1997, All Rights Reserved

    12 Lines In.
    14 Lines Out.

$ nasm -f elf -o hello.o hello.asm
$ ld -o hello hello.o
$ ./hello 
hello world

And an example of a loop:

section .data;
    'msg = ("loop #x", 0ah);
section .text;
global _start;
_start:
    ecx = 9;
    ebx = 1;
    edx = 12;
    edi === [$msg + 6];
    {   =ecx;
        ecx + '0';
        [edi] = cl;
        eax = 4; ecx = $msg; !80h;
        ecx=; 
    }-<>;
    &ebx; &eax+; !80h;

And here's a quick example of an insertion sort I wrote just to demonstrate the syntax:

section .data;
    'msg = ("arr[%d] = %d", 0ah, 00h);
    'arr = (34, 126, 42, 9, 124, 64, 24, 76, 98, 121);
section .text;
global _start;
extern printf;
_start:
    ebx = ecx = edx = eax = 0; eax+;
    {   bl = [arr+eax];
        cl = al; cl-;
        {   ecx ? --;    
            dl = [arr+ecx]; 
            dl - bl ? > {    
                [+ecx+arr] = dl; 
                ecx--;      
            }, { . };
        }.;                 
        [+ecx+arr] = bl;    
        eax+;               
        eax - 10 ?;
    }<>;
    ecx = 9;
    {   &eax; 
        al = [ecx+arr];
        =eax; =ecx; =msg; =.printf;
        ecx=; ecx=; eax=; ecx-;
    }++;
    &eax+; &ebx; !80h;

Unfortunately the compiler isnt free, so I've been considering designing my own algebraic assembly, perhaps using bison. Although I'd take some inspiration from terse, I think I would prefer a more c-like syntax where that's possible.

crackmes: hacker puzzles

, ,

crackmes are small reverse engineering puzzles designed to test your binary analysis skills and showcase interesting protection schemes, similar to those used in commercial software to validate registered users. Solving them can be tough, but must be the most fun you can have with a debugger.

The goal is usually to study how the crackme works and then write a keygen or disable the protection by patching the code (if permitted by the rules), and then publish a solution explaining how you solved it to anyone else interested in learning about it.

Some knowledge of assembly is all that's required to get started, but all sorts of skills are needed to solve the tougher crackmes, from cryptanalysis, algorithm analysis, reconstructing high-level code, executable unpacking, identifying and eliminating anti-debugger and anti-disassembler tricks, and so on.

The best site for finding linux crackmes is crackmes.de, where there's a whole community of users interested in reverse engineering, unfortunately the number of linux crackmes is tiny in comparison to the number of windows crackmes, however, there are still plenty of interesting ones available. The crackmes range from the ridiculously simple to some really tough projects that can take weeks to solve.

An example of the best of linux crackmes is one of my favourite authors, crp-, who has released three very different crackmes on crackmes.de. I've just published my solution to his third crackme, and really enjoyed it.

crp-'s crackmes are here, here and here.

If you're looking for an interesting project and would like to hone your debugging, reverse engineering or hostile binary analysis skills I would highly reccommend trying out a few crackmes.
January 2010
S M T W T F S
December 2009February 2010
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30