Find what unknown function does in C using gdb
- by Gary
Hi,
I have a function m(int i, char c) which takes and returns a char between "-abc...xyz" and also takes an integer i.
Basically I have no way to see the source code of the function but can call it and get the return value. Using gdb/C, what's the best way to decipher what the function actually does? I've tried looking for patterns using consecutive chars and integer inputs but have come up with nothing yet.
If it helps, here are some results of testing the return values, with the first two bits being the arguments and the last bit being the return value:
0 a i
0 b l
0 c t
0 d x
0 e f
0 f v
1 a q
1 b i
1 c y
1 d e
2 a a
2 b y
2 c f
2 d n