In this crackme solution, first the strings are found:
$ rabin2 -z crackserial_linux
addr=0x00000aa0 off=0x00000aa0 ordinal=000 sz=7 len=7 section=.rodata type=A string=User:
addr=0x00000aa7 off=0x00000aa7 ordinal=001 sz=11 len=11 section=.rodata type=A string=Password:
addr=0x00000ab2 off=0x00000ab2 ordinal=002 sz=10 len=10 section=.rodata type=A string=Good job!
addr=0x00000abc off=0x00000abc ordinal=003 sz=10 len=10 section=.rodata type=A string=Try again
after that, references for "Good job" are looked for:
$ radare2 crackserial_linux
-- How about a nice game of chess?
[0x080488c4]> /c ab2
f hit_0 @ 0x08048841 # 5: push 0x8048ab2
[0x080488c4]>
I tried the same thing, but for me it's not working:
$ r2 crackserial_linux
[0x080488d0]> !!rabin2 -z crackserial_linux
[strings]
addr=0x08048d80 off=0x00000d80 ordinal=000 sz=7 section=.rodata string=User:
addr=0x08048d87 off=0x00000d87 ordinal=001 sz=9 section=.rodata string=Serial:
addr=0x08048d90 off=0x00000d90 ordinal=002 sz=10 section=.rodata string=Good job!
addr=0x08048d9a off=0x00000d9a ordinal=003 sz=10 section=.rodata string=Try again
4 strings
[0x080488d0]> /c d90
[0x080488d0]>
By the way, why are the strings in my case at different locations?
/c
uses pattern matching using1118c
wont give you any results using18c
will spew a lot of results think about it before asking why. Why? Is that because of PIE and is related to virtual memory?