Quantcast
Channel: Recent Questions - Stack Overflow
Viewing all articles
Browse latest Browse all 12141

Use buffer overflow to reach another function

$
0
0

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 0x5555555551b1
  • func2 address is 0x5555555551c3
  • buf address is 0x7fffffffe210
  • Unable to locate $rip

Viewing all articles
Browse latest Browse all 12141

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>