Frida Hooking 질문 있습니다.
py0zz1
3
6486
2019.12.06 22:29
질문 글을 너무 많이 올리는 것 같네요..ㅠ
Frida Unity App Hooking 관련 레퍼런스를 계속 찾아봤는데, 다 코드수정하는거 뿐이라.. 질문할 곳이 여기 뿐이네요
var libmono = Module.enumerateExports("libmono.so");
libmono.forEach(function (func, index, array)
{
if(func.address != 0x0)
{
Interceptor.attach(func.address,
{
onEnter: function(args)
{
console.log("[*] "+func.name);
},
onLeave: function(){}
});
}
});
위와 같이 libmono.so의 함수오브젝트들을 가져와서 forEach문에서 Trace하는 코드입니다.
[*] mono_class_get_name
[*] mono_class_get_namespace
[*] mono_class_get_image
[*] mono_image_get_name
[*] mono_domain_get
[*] mono_object_new
[*] mono_class_vtable
[*] mono_mempool_alloc0
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_type_generic_inst_is_valuetype
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_enum_basetype
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_from_mono_type
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_get_root_domain
[*] mono_class_data_size
[*] mono_class_data_size
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
코드를 정상적으로 실행돼서 위와 같은 결과가 출력이 되는데요.
1) 문제는 Trace가 1초정도 되다가 App이 종료되어 버립니다..
실행되는 함수마다 Attach작업을 해서 그런 것 같은데요.. 혹시 이럴 때는 어떻게 처리를 해줘야 할까요?
2) 그리고 제가 분석한 결과로는, 후킹함수의 RVA를 더하는 Base주소를 libmono.so로 가져오면 안될 것 같은데 여기에 대해서 조언 부탁드립니다..
Frida Unity App Hooking 관련 레퍼런스를 계속 찾아봤는데, 다 코드수정하는거 뿐이라.. 질문할 곳이 여기 뿐이네요
var libmono = Module.enumerateExports("libmono.so");
libmono.forEach(function (func, index, array)
{
if(func.address != 0x0)
{
Interceptor.attach(func.address,
{
onEnter: function(args)
{
console.log("[*] "+func.name);
},
onLeave: function(){}
});
}
});
위와 같이 libmono.so의 함수오브젝트들을 가져와서 forEach문에서 Trace하는 코드입니다.
[*] mono_class_get_name
[*] mono_class_get_namespace
[*] mono_class_get_image
[*] mono_image_get_name
[*] mono_domain_get
[*] mono_object_new
[*] mono_class_vtable
[*] mono_mempool_alloc0
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_type_generic_inst_is_valuetype
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_enum_basetype
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_type_get_underlying_type
[*] mono_class_from_mono_type
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_get_root_domain
[*] mono_class_data_size
[*] mono_class_data_size
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
[*] mono_class_get_fields
코드를 정상적으로 실행돼서 위와 같은 결과가 출력이 되는데요.
1) 문제는 Trace가 1초정도 되다가 App이 종료되어 버립니다..
실행되는 함수마다 Attach작업을 해서 그런 것 같은데요.. 혹시 이럴 때는 어떻게 처리를 해줘야 할까요?
2) 그리고 제가 분석한 결과로는, 후킹함수의 RVA를 더하는 Base주소를 libmono.so로 가져오면 안될 것 같은데 여기에 대해서 조언 부탁드립니다..