I have an assignment to use buffer overflow to reach another function:
int func1() { printf("1"); return;}int func2() { char buf[10]; scanf("%s",buf); return;}int main() { func2(); return 0;}
I got the buf
begins at address 0x7fffffffe210, and function func1
address is 0x5555555551b1, but I don't know where is $rip so I don't know how many paddings are needed.
Also I tried with lldb on my Mac and issue is same. I know the function address but I don't know the address of pc.
func1
address is 0x5555555551b1func2
address is 0x5555555551c3buf
address is 0x7fffffffe210- Unable to locate $rip