{"id":13531027,"url":"https://github.com/nowsecure/frida-trace","last_synced_at":"2025-04-05T09:04:57.597Z","repository":{"id":44741370,"uuid":"53356872","full_name":"nowsecure/frida-trace","owner":"nowsecure","description":"Trace APIs declaratively through Frida.","archived":false,"fork":false,"pushed_at":"2024-01-22T10:37:55.000Z","size":650,"stargazers_count":231,"open_issues_count":20,"forks_count":30,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-03-29T08:04:25.521Z","etag":null,"topics":["frida","nowsecure","trace"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nowsecure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-03-07T20:31:42.000Z","updated_at":"2025-03-25T08:40:44.000Z","dependencies_parsed_at":"2024-01-07T08:10:14.170Z","dependency_job_id":"0ed3bff3-e391-48df-a1ef-90291a74ee13","html_url":"https://github.com/nowsecure/frida-trace","commit_stats":{"total_commits":49,"total_committers":9,"mean_commits":5.444444444444445,"dds":0.326530612244898,"last_synced_commit":"414ce392a71b0737777e9c970479be3c03528efc"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowsecure%2Ffrida-trace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowsecure%2Ffrida-trace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowsecure%2Ffrida-trace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nowsecure%2Ffrida-trace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nowsecure","download_url":"https://codeload.github.com/nowsecure/frida-trace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312077,"owners_count":20918344,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["frida","nowsecure","trace"],"created_at":"2024-08-01T07:00:59.182Z","updated_at":"2025-04-05T09:04:57.555Z","avatar_url":"https://github.com/nowsecure.png","language":"JavaScript","funding_links":[],"categories":["Dynamic Analysis","Libraries"],"sub_categories":["nowsecure"],"readme":"# frida-trace\n\nTrace APIs declaratively through [Frida](https://www.frida.re).\n\n## Example\n\n```js\nimport trace from 'frida-trace';\n\nconst func = trace.func;\nconst argIn = trace.argIn;\nconst argOut = trace.argOut;\nconst retval = trace.retval;\n\nconst types = trace.types;\nconst pointer = types.pointer;\nconst INT = types.INT;\nconst POINTER = types.POINTER;\nconst UTF8 = types.UTF8;\n\ntrace({\n  module: 'libsqlite3.dylib',\n  functions: [\n    func('sqlite3_open', retval(INT), [\n      argIn('filename', UTF8),\n      argOut('ppDb', pointer(POINTER), when('result', isZero)),\n    ]),\n    func('sqlite3_prepare_v2', retval(INT), [\n      argIn('db', POINTER),\n      argIn('zSql', [UTF8, bind('length', 'nByte')]),\n      argIn('nByte', INT),\n      argOut('ppStmt', pointer(POINTER), when('result', isZero)),\n    ])\n  ],\n  callbacks: {\n    onEvent(event) {\n      console.log('onEvent! ' + JSON.stringify(event, null, 2));\n    },\n    onEnter(event, context) {\n      event.trace = Thread.backtrace(context)\n        .map(DebugSymbol.fromAddress)\n        .filter(x =\u003e x.name);\n    },\n    onError(e) {\n      console.error(e);\n    }\n  }\n});\n\nfunction isZero(value) {\n  return value === 0;\n}\n```\n\n## Auto-generating boilerplate from header files\n\n```sh\n$ ./bin/parse-header.js /usr/include/sqlite3.h | ./bin/generate-boilerplate.js\ntrace({\n  module: 'libfoo.dylib',\n  functions: [\n    func('sqlite3_libversion', retval(UTF8), []),\n    func('sqlite3_sourceid', retval(UTF8), []),\n    func('sqlite3_libversion_number', retval(INT), []),\n    func('sqlite3_compileoption_used', retval(INT), [\n      argIn('zOptName', UTF8)\n    ]),\n    func('sqlite3_compileoption_get', retval(UTF8), [\n      argIn('N', INT)\n    ]),\n    func('sqlite3_threadsafe', retval(INT), []),\n    func('sqlite3_close', retval(INT), [\n      argIn('a1', POINTER)\n    ]),\n    func('sqlite3_close_v2', retval(INT), [\n      argIn('a1', POINTER)\n    ]),\n    func('sqlite3_exec', retval(INT), [\n      argIn('a1', POINTER),\n      argIn('sql', UTF8),\n      argIn('callback', POINTER),\n      argIn('a4', POINTER),\n      argOut('errmsg', pointer(POINTER), when('result', isZero))\n    ]),\n...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowsecure%2Ffrida-trace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnowsecure%2Ffrida-trace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnowsecure%2Ffrida-trace/lists"}