mirror of
https://github.com/GaloisInc/macaw.git
synced 2024-12-24 06:35:41 +03:00
2092a0fd01
The code pointer discovery in macaw can't handle this case because we never write the code pointers into memory - we only read them. We really need a way to tell macaw about code pointers. The easy workaround is to pull all of the function entry points out of the TOC and just seed the macaw search with them, but it would be nice to be able to identify them from first principles.
30 lines
348 B
C
30 lines
348 B
C
#include "util.h"
|
|
|
|
int g1;
|
|
int g2;
|
|
int g3;
|
|
int g4;
|
|
|
|
int f2(long l1) {
|
|
return (int)&g2;
|
|
}
|
|
|
|
int f1(long l1) {
|
|
long i1 = (long)&g1;
|
|
i1 = l1 + i1;
|
|
return (int)i1;
|
|
}
|
|
|
|
void _start() {
|
|
long i1 = (long)&g1;
|
|
long i2 = (long)&g2;
|
|
long i3 = (long)&g3;
|
|
int (*fptr)(long) = &f1;
|
|
if(i1 > i2)
|
|
fptr = &f2;
|
|
|
|
g1 = fptr(i3 + i2);
|
|
EXIT();
|
|
}
|
|
|