SWAG >> LDX/BFX >> Sample Analysis Programs

Sample Analysis Programs

Given here are compressed sources of two simple C programs that can be used as targets for various reverse engineering tools. Use

 tar -zxvf filename.tar.gz
to decompress. Alternatively, if your implementation of tar does not support the -z option, you can decompress the files with the following two commands:
gunzip filename.tar.gz
tar tar -xvf filename.tar

EG program
Description A very simple C program that consists of two files - a main and a library, and a header file. The main() method is calling a library function defined in the library file. The program does not actually perform any actions.
Download
Zipped file: [eg.tar.gz]
Individual files: lib.c   lib.h   main.c  
As-linked view: eg.alv.ta
Viewable landscape: eg.ls.ta


C488 compiler
Description C488 is a small compiler used in a compiler course at the University of Toronto. This program is small enough to be comprehensible, but big enough to make the reverse engineering of it interesting. It is a good example to take on after completing the EG program above.
Download:
Zipped file: [c488.tar.gz]
Individual files: [codegen.c] [codegen.h] [machine.c] [machine.h]
[machineDef.h] [parsecodegen.h] [parsetables.h] [scanparse.h]
[tset.c] [tset.h] [symbol.h] [symbol.c] [common.h]
[parser.h] [parser.c] [semanticext.h] [semantics.h]
[semantics.c] [tokenDef.h] [globalvars.h] [main.c]
[parsesemantics.h] [scanner.h] [scanner.c]
As linked view: c488.alv.ta
Viewable landscape: c488.ls.ta