본문 바로가기
debug/0x01-frida

frida tutorials 실습 ][ functions

by SpeeDr00t 2020. 6. 17.
반응형
#include <stdio.h>
#include <unistd.h>
void
f (int n)
{
printf ("Number: %d\n", n);
}
int
main (int argc,
char * argv[])
{
int i = 0;
printf ("f() is at %p\n", f);
while (1)
{
f (i++);
sleep (1);
}
}
view raw hello.c hosted with ❤ by GitHub
from __future__ import print_function
import frida
import sys
session = frida.attach("hello")
script = session.create_script("""
Interceptor.attach(ptr("%s"), {
onEnter: function(args) {
send(args[0].toInt32());
}
});
""" % int(sys.argv[1], 16))
def on_message(message, data):
print(message)
script.on('message', on_message)
script.load()
sys.stdin.read()
view raw hook.py hosted with ❤ by GitHub

youtu.be/ClA5eiw2GaM

 

반응형