Rename test -> tests (#66)
* rename test -> tests * re-add ignored tests
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
How to run the test:
|
||||
|
||||
python SymbolicExecutor/main.py --offset 0 --workspace test --buffer "EBP-4" --size "4" tests/index_code/index_code.dmp
|
||||
@@ -0,0 +1,49 @@
|
||||
// compile with
|
||||
// cl /Fe:index_code.exe index_code.c
|
||||
//
|
||||
// make memory dump with:
|
||||
// .dump /ma index_code.dmp
|
||||
//
|
||||
#include <stdio.h>
|
||||
|
||||
typedef int(*my_callback)(int);
|
||||
|
||||
int say_zero(int a) {
|
||||
printf("entry zero");
|
||||
return a;
|
||||
}
|
||||
int say_one(int a) {
|
||||
printf("entry one");
|
||||
return a;
|
||||
}
|
||||
int say_two(int a) {
|
||||
printf("entry two");
|
||||
return a;
|
||||
}
|
||||
int say_three(int a) {
|
||||
printf("entry three");
|
||||
return a;
|
||||
}
|
||||
|
||||
my_callback table[] = {
|
||||
say_zero,
|
||||
say_one,
|
||||
say_two,
|
||||
say_three};
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
int index = 0;
|
||||
printf("reading an index: ");
|
||||
scanf("%d", &index);
|
||||
// break for windbg
|
||||
__debugbreak();
|
||||
if(index > (int)(sizeof(table)/sizeof(table[0]))) {
|
||||
printf("Invalid index\n");
|
||||
} else {
|
||||
my_callback out = table[index];
|
||||
out(index);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user