-- Trace all calls to a specific librarylocaltarget_lib="libapp.so"localbase=Module.find(target_lib)ifnotbasethenprint(RED.."Library not found: "..target_lib..RESET)returnend-- Get all exportslocalexports=Module.exports(target_lib)localhook_count=0-- Hook first 10 exports for demonstrationfori,expinipairs(exports)doifi>10thenbreakendhook(target_lib,exp.offset,{onEnter=function(args)print(CYAN.."[TRACE] "..exp.name.."("..string.format("0x%x, 0x%x, 0x%x",args[0],args[1],args[2])..")"..RESET)end,onLeave=function(retval)print(CYAN.." └─> "..string.format("0x%x",retval)..RESET)returnretvalend})hook_count=hook_count+1endprint(GREEN.."✓ Installed "..hook_count.." trace hooks"..RESET)