Skip to content

Commit

Permalink
Initial import of the binary test suite
Browse files Browse the repository at this point in the history
  • Loading branch information
radare committed Oct 29, 2012
1 parent 890c328 commit 9ab21bf
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions b/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
all:
@sh osx.sh
Binary file added b/files/Hello.class
Binary file not shown.
Binary file added b/files/Hello.dex
Binary file not shown.
15 changes: 15 additions & 0 deletions b/files/Hello.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
public class Hello {
private String who;

public Hello (String who) {
this.who = who;
}

public void say () {
System.out.println ("Hello "+who);
}

public static void main(String[] args) {
new Hello ("World").say ();
}
}
Binary file added b/files/hello-android-arm
Binary file not shown.
Binary file added b/files/hello-android-mips
Binary file not shown.
Binary file added b/files/hello-mingw32
Binary file not shown.
Binary file added b/files/hello-osx-i386
Binary file not shown.
Binary file added b/files/hello-osx-x86_64
Binary file not shown.
6 changes: 6 additions & 0 deletions b/files/hello.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <stdio.h>

int main() {
printf ("Hello World\n");
return 0;
}
6 changes: 6 additions & 0 deletions b/files/hello.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#include <iostream>

int main() {
std::cout << "Hello World" << std::endl;
return 0;
}
Binary file added b/files/hellocxx-mingw32
Binary file not shown.
Binary file added b/files/hellocxx-osx-fat-intel
Binary file not shown.
Binary file added b/files/hellocxx-osx-i386
Binary file not shown.
Binary file added b/files/hellocxx-osx-x86_64
Binary file not shown.
26 changes: 26 additions & 0 deletions b/osx.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/sh
# pancake
# test case for binaries

getentry() {
rabin2 -rve files/"$1" | awk '{if(/@/){print $4}}'
}

getmain() {
rabin2 -vM files/"$1" | awk -F= '{if(/=/){print $3}}'
}

runtest() {
printf " $1\t$2"
O=`eval $2 $1`
if [ "$O" = "$3" ]; then
echo "\r OK"
else
echo " *** FAIL because not '$O' ***"
fi
}

runtest hello-osx-i386 getentry 0x00001f14
runtest hello-osx-i386 getmain 0x00001f52
runtest hello-osx-x86_64 getentry 0x100000ed0
runtest hello-osx-x86_64 getmain 0x100000f0c

0 comments on commit 9ab21bf

Please sign in to comment.