trailofbits / ctf

CTF Field Guide

Home Page:https://trailofbits.github.io/ctf/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how fgets() read the hexadecimal number

xiam0nd opened this issue · comments

in the exploit easy ,i encounter a problem.
i want to overwrite the pikachy variable into 0xfa75beef,but fgets() cannot read 0xfa75beef.
although i used the escape char '',just like \xef\xbe\x75\xfa,fgets() cannot identify the escape char ''.

so ,how can i make fgets() read the hexadecimal number.

fgets() cannot read a hex number for you. You will want to make a script to print the binary value or a one line script like:
$ perl -e 'print "\xce\xfa\xed\xfe"' | nc ip port

thank you very much!!!