Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: [main, master]
pull_request:

env:
CARGO_TERM_COLOR: always

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install build deps
run: |
sudo apt-get update
sudo apt-get install -y pkg-config libclang-dev clang

- name: Install Rust (stable)
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy

- name: Cache cargo
uses: Swatinem/rust-cache@v2

- name: Format check
run: cargo fmt --all -- --check

- name: Clippy (warnings allowed; fails only on errors)
run: cargo clippy --all-targets

- name: Build
run: cargo build

- name: Tests
run: cargo test --all
7 changes: 7 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ version = "0.2.2"
edition = "2021"
description = "A strong dynamic debugger CLI tool based on Frida"
license = "MIT"
rust-version = "1.70"
authors = ["eunhhu"]
repository = "https://github.com/eunhhu/vlitz"
homepage = "https://github.com/eunhhu/vlitz"
readme = "README.md"
keywords = ["frida", "debugger", "cli", "reverse-engineering", "instrumentation"]
categories = ["command-line-utilities", "development-tools::debugging"]

[dependencies]
clap = { version = "4.5.38", features = ["derive", "unstable-styles"] }
Expand Down
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 eunhhu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<div align="center">

# Vlitz

A strong dynamic debugger CLI tool based on [Frida](https://frida.re/)
**A strong, cross-platform dynamic debugger CLI tool built on [Frida](https://frida.re/).**

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![crates.io](https://img.shields.io/crates/v/vlitz.svg?logo=rust&logoColor=white&color=dea584)](https://crates.io/crates/vlitz)
[![Rust](https://img.shields.io/badge/Rust-1.70+-DEA584?logo=rust&logoColor=white)](https://www.rust-lang.org/)

</div>

---

## Overview

Expand All @@ -25,7 +35,7 @@ Vlitz is a powerful command-line interface tool that leverages Frida's dynamic i
### From Source

```bash
git clone https://github.com/your-username/vlitz.git
git clone https://github.com/eunhhu/vlitz.git
cd vlitz
cargo build --release
```
Expand Down Expand Up @@ -172,7 +182,7 @@ cargo clippy

## License

[Add your license information here]
`vlitz` is released under the [MIT License](LICENSE).

## Acknowledgments

Expand All @@ -183,7 +193,7 @@ cargo clippy

If you encounter any issues or have questions, please:

1. Check the [Issues](https://github.com/your-username/vlitz/issues) page
1. Check the [Issues](https://github.com/eunhhu/vlitz/issues) page
2. Create a new issue with detailed information about your problem
3. Include your operating system, Rust version, and steps to reproduce

Expand Down
32 changes: 16 additions & 16 deletions src/gum/commands/disasm_cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,24 @@ pub(crate) fn build() -> Vec<Command> {
cmds.push(Command::new(
"disas",
"Disassemble instructions at address",
vec!["dis", "u"], // 'u' is common in debuggers for unassemble
vec!["dis", "u"], // 'u' is common in debuggers for unassemble
vec![
CommandArg::optional("target", "Address, selector, or function name"),
CommandArg::optional("count", "Number of instructions to disassemble (default 20)"),
],
vec![
SubCommand::new(
"func",
"Disassemble an entire function until return",
vec![
CommandArg::optional("target", "Address or selector of function"),
],
|c, a| Commander::disas_function(c, a),
)
.alias("f"),
CommandArg::optional(
"count",
"Number of instructions to disassemble (default 20)",
),
],
vec![SubCommand::new(
"func",
"Disassemble an entire function until return",
vec![CommandArg::optional(
"target",
"Address or selector of function",
)],
|c, a| Commander::disas_function(c, a),
)
.alias("f")],
Some(|c, a| Commander::disas(c, a)),
));

Expand Down Expand Up @@ -54,9 +56,7 @@ pub(crate) fn build() -> Vec<Command> {
patch_subs.push(SubCommand::new(
"restore",
"Restore original bytes at address",
vec![
CommandArg::required("target", "Address or selector"),
],
vec![CommandArg::required("target", "Address or selector")],
|c, a| Commander::patch_restore(c, a),
));

Expand Down
19 changes: 11 additions & 8 deletions src/gum/commands/hook_cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ pub(crate) fn build() -> Vec<Command> {
"Add a hook to target address or function",
vec![
CommandArg::required("target", "Address, selector, or function name"),
CommandArg::optional("options", "Hook options: -e (enter) -l (leave) -a (args) -r (retval) -b (backtrace)"),
CommandArg::optional(
"options",
"Hook options: -e (enter) -l (leave) -a (args) -r (retval) -b (backtrace)",
),
],
|c, a| Commander::hook_add(c, a),
)
Expand All @@ -24,19 +27,19 @@ pub(crate) fn build() -> Vec<Command> {
SubCommand::new(
"remove",
"Remove a hook by ID",
vec![CommandArg::required("id", "Hook ID to remove (e.g., hook_0)")],
vec![CommandArg::required(
"id",
"Hook ID to remove (e.g., hook_0)",
)],
|c, a| Commander::hook_remove(c, a),
)
.alias("rm"),
);

hook_subs.push(
SubCommand::new(
"list",
"List all active hooks",
vec![],
|c, a| Commander::hook_list(c, a),
)
SubCommand::new("list", "List all active hooks", vec![], |c, a| {
Commander::hook_list(c, a)
})
.alias("ls"),
);

Expand Down
7 changes: 5 additions & 2 deletions src/gum/commands/memory_cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,18 @@ pub(crate) fn build() -> Vec<Command> {
list_subs.push(SubCommand::new(
"modules",
"List process modules into Field store",
vec![CommandArg::optional("filter", "Optional name filter (substring)")],
vec![CommandArg::optional(
"filter",
"Optional name filter (substring)",
)],
|c, a| Commander::list_modules(c, a),
));
list_subs.push(SubCommand::new(
"ranges",
"List memory ranges into Field store",
vec![
CommandArg::optional("protect", "Protection filter, e.g. r-x, rw-"),
CommandArg::optional("filter", "Optional name filter (substring)")
CommandArg::optional("filter", "Optional name filter (substring)"),
],
|c, a| Commander::list_ranges(c, a),
));
Expand Down
20 changes: 10 additions & 10 deletions src/gum/commands/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// src/gum/commands/mod.rs

pub mod disasm_cmds;
pub mod hook_cmds;
pub mod memory_cmds;
pub mod nav_cmds;
pub mod store_cmds;
pub mod hook_cmds;
pub mod disasm_cmds;
pub mod scan_cmds;
pub mod store_cmds;

use crate::gum::commander::{Command, CommandArg, SubCommand};
use crate::gum::commander::Commander;
use crate::gum::commander::{Command, CommandArg, SubCommand};

pub fn build_all() -> Vec<Command> {
let mut cmds: Vec<Command> = Vec::new();
Expand Down Expand Up @@ -54,12 +54,12 @@ pub fn build_all() -> Vec<Command> {
));

// Grouped commands by category
cmds.extend(nav_cmds::build()); // Navigation: select, deselect, add, sub, goto
cmds.extend(store_cmds::build()); // Stores: field, lib
cmds.extend(memory_cmds::build()); // Memory: list, view, read, write
cmds.extend(hook_cmds::build()); // Hooking: hook add/remove/list/enable/disable
cmds.extend(disasm_cmds::build()); // Disassembly: disas, patch, nop
cmds.extend(scan_cmds::build()); // Scanning: scan, thread
cmds.extend(nav_cmds::build()); // Navigation: select, deselect, add, sub, goto
cmds.extend(store_cmds::build()); // Stores: field, lib
cmds.extend(memory_cmds::build()); // Memory: list, view, read, write
cmds.extend(hook_cmds::build()); // Hooking: hook add/remove/list/enable/disable
cmds.extend(disasm_cmds::build()); // Disassembly: disas, patch, nop
cmds.extend(scan_cmds::build()); // Scanning: scan, thread

cmds
}
10 changes: 8 additions & 2 deletions src/gum/commands/nav_cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ pub(crate) fn build() -> Vec<Command> {
"sub",
"Subtract an offset from the current navigator address",
vec![],
vec![CommandArg::required("offset", "Offset to subtract (hex or dec)")],
vec![CommandArg::required(
"offset",
"Offset to subtract (hex or dec)",
)],
vec![],
Some(|c, a| Commander::sub(c, a)),
));
Expand All @@ -53,7 +56,10 @@ pub(crate) fn build() -> Vec<Command> {
"goto",
"Jump navigator to an absolute address",
vec![],
vec![CommandArg::required("address", "Address to jump to (hex or dec)")],
vec![CommandArg::required(
"address",
"Address to jump to (hex or dec)",
)],
vec![],
Some(|c, a| Commander::goto(c, a)),
));
Expand Down
36 changes: 23 additions & 13 deletions src/gum/commands/scan_cmds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ pub(crate) fn build() -> Vec<Command> {
"Scan for byte pattern (hex with ?? wildcards: 'AA BB ?? CC')",
vec![
CommandArg::required("pattern", "Byte pattern to search"),
CommandArg::optional("protection", "Memory protection filter (e.g., 'r--', 'rw-')"),
CommandArg::optional(
"protection",
"Memory protection filter (e.g., 'r--', 'rw-')",
),
],
|c, a| Commander::scan_bytes(c, a),
));
Expand Down Expand Up @@ -47,7 +50,10 @@ pub(crate) fn build() -> Vec<Command> {
"Refine scan results with new value",
vec![
CommandArg::required("value", "New value to filter by"),
CommandArg::optional("comparison", "Comparison: eq, ne, gt, lt, ge, le (default: eq)"),
CommandArg::optional(
"comparison",
"Comparison: eq, ne, gt, lt, ge, le (default: eq)",
),
],
|c, a| Commander::scan_next(c, a),
)
Expand Down Expand Up @@ -92,9 +98,10 @@ pub(crate) fn build() -> Vec<Command> {
SubCommand::new(
"list",
"List scan results and load into Field store",
vec![
CommandArg::optional("limit", "Max results to load (default 100)"),
],
vec![CommandArg::optional(
"limit",
"Max results to load (default 100)",
)],
|c, a| Commander::scan_list(c, a),
)
.alias("ls"),
Expand All @@ -120,20 +127,20 @@ pub(crate) fn build() -> Vec<Command> {
let mut thread_subs: Vec<SubCommand> = Vec::new();

thread_subs.push(
SubCommand::new(
"list",
"List all threads in the process",
vec![],
|c, a| Commander::thread_list(c, a),
)
SubCommand::new("list", "List all threads in the process", vec![], |c, a| {
Commander::thread_list(c, a)
})
.alias("ls"),
);

thread_subs.push(
SubCommand::new(
"regs",
"Show registers for a thread",
vec![CommandArg::optional("thread_id", "Thread ID (default: current)")],
vec![CommandArg::optional(
"thread_id",
"Thread ID (default: current)",
)],
|c, a| Commander::thread_regs(c, a),
)
.alias("r"),
Expand All @@ -156,7 +163,10 @@ pub(crate) fn build() -> Vec<Command> {
SubCommand::new(
"backtrace",
"Show backtrace for a thread",
vec![CommandArg::optional("thread_id", "Thread ID (default: current)")],
vec![CommandArg::optional(
"thread_id",
"Thread ID (default: current)",
)],
|c, a| Commander::thread_backtrace(c, a),
)
.alias("bt"),
Expand Down
Loading
Loading