Skip to content

Commit

Permalink
tracer: Add static analysis UI features powered by r2
Browse files Browse the repository at this point in the history
- Support capturing backtraces, enabled on a per handler basis.
- Show event's caller (or backtrace, if available), and support
  disassembling each location.
- Support adding an instruction-level probe by clicking on an address in
  the disassembly view.
- Support jumping to the handler code by clicking on an address in the
  disassembly view.
- Improve styling.
  • Loading branch information
oleavr committed Oct 2, 2024
1 parent 0733699 commit 1ae7c57
Show file tree
Hide file tree
Showing 16 changed files with 1,569 additions and 405 deletions.
345 changes: 250 additions & 95 deletions agents/tracer/agent.ts

Large diffs are not rendered by default.

27 changes: 27 additions & 0 deletions apps/tracer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/tracer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@blueprintjs/core": "^5.12.0",
"@frida/react-use-r2": "^1.0.2",
"@monaco-editor/react": "^4.6.0",
"monaco-editor": "^0.51.0",
"react": "^18.3.1",
Expand All @@ -20,6 +21,7 @@
"use-debounce": "^10.0.3"
},
"devDependencies": {
"@types/node": "^22.7.4",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.1",
Expand Down
4 changes: 4 additions & 0 deletions apps/tracer/src/AddTargetsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ function labelForTraceSpecScope(scope: TraceSpecScope) {
return "Function";
case TraceSpecScope.RelativeFunction:
return "Relative Function";
case TraceSpecScope.AbsoluteInstruction:
return "Instruction";
case TraceSpecScope.Imports:
return "All Module Imports";
case TraceSpecScope.Module:
Expand All @@ -127,6 +129,8 @@ function placeholderForTraceTargetSpecScope(scope: TraceSpecScope) {
return "[Module!]Function";
case TraceSpecScope.RelativeFunction:
return "Module!Offset";
case TraceSpecScope.AbsoluteInstruction:
return "0x1234";
case TraceSpecScope.Imports:
case TraceSpecScope.Module:
return "Module";
Expand Down
45 changes: 43 additions & 2 deletions apps/tracer/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,61 @@
padding: 5px;
}

.work-area {
.editor-area {
display: flex;
flex: 1;
flex-direction: column;
white-space: nowrap;
}

.work-area section {
.editor-area section {
flex: 1;
}

.editor-area .bp5-button:focus {
outline: 0;
}

.editor-area section.editor-toolbar {
display: flex;
justify-content: space-between;
flex: 0;
padding-right: 10px;
}

.editor-toolbar .bp5-switch {
padding-top: 10px;
}

.monaco-editor {
position: absolute !important;
}

.bottom-tabs {
display: flex;
flex-direction: column;
flex: 1;
}

.bottom-tabs .bp5-tab-list {
padding-left: 10px;
}

.bottom-tabs .bp5-tab:focus {
outline: 0;
}

.bottom-tab-panel {
display: flex;
margin-top: 0;
flex: 1;
overflow: hidden;
}

.event-view {
flex: 1;
}

.disassembly-view {
flex: 1;
}
Loading

0 comments on commit 1ae7c57

Please sign in to comment.