MCPcopy Index your code
hub / github.com/ethteck/coddog

github.com/ethteck/coddog @0.6.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.6.3 ↗ · + Follow
203 symbols 403 edges 40 files 2 documented · 1%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

coddog - the dog that sniffs for cod

coddog allows you to more efficiently decompile binaries by reducing redundant work. Whether it's identifying library functions, de-duplicating code, or looking for ways to get the codegen you want for that one portion of a function, coddog will find your cod!

Features

match: Function matching

Find functions that are similar to a query function

~/repos/pokemonsnap$ coddog match func_80348C08_828378 -t 0.7
100.00% - func_802ECC44_5E9D14 (decompiled)
100.00% - func_802E01F4_6C7FD4 (decompiled)
100.00% - func_802C57A4_647C54 (decompiled)
73.33% - finishLevel (decompiled)
73.10% - func_802D9DD8_6C1BB8
71.88% - osAiSetFrequency (decompiled)
70.89% - func_800E1930_A08EC0 (decompiled)
70.19% - func_802D0D0C_7AA29C

cluster: Function clustering

Find clusters of functions that are identical or near-identical in one binary. This can be useful for de-duplicating redundant code and turning common functions into #includes.

~/repos/pokemonsnap$ coddog cluster -m 10
Cluster func_802C8998_7A1F28 has 23 symbols
Cluster func_802E1110_6C8EF0 has 12 symbols
Cluster func_802C2D00_6451B0 has 12 symbols
Cluster func_802CA858_7A3DE8 has 10 symbols
Cluster func_beach_802C68D8 has 8 symbols

submatch: Partial function matching

Find n-length segments of code that are common between the ones found in the given query function and all other functions in a binary (and soon, beyond)

~/repos/pokemonsnap$ coddog submatch finishLevel 30
func_credits_801DE060 (decompiled):
        query [41-77] matches func_credits_801DE060 [insn 101-137] (36 total)
func_800A081C:
        query [42-76] matches func_800A081C [insn 165-199] (34 total)
func_8035464C_4F4A5C (decompiled):
        query [43-77] matches func_8035464C_4F4A5C [insn 81-115] (34 total)
updateIdle (decompiled):
        query [23-89] matches updateIdle [insn 107-173] (66 total)

Experimental features

compare2: Find common functions between one binary and another

~/repos/pokemonsnap$ coddog compare2 decomp.yaml us ~/repos/stadium/decomp.yaml us
alMainBusPull (decompiled) - alMainBusPull (decompiled) (98.61%)
__ll_div (decompiled) - __ll_div (decompiled) (100.00%)
__osIdCheckSum (decompiled) - __osIdCheckSum (decompiled) (100.00%)
__ull_to_d (decompiled) - __ull_to_d (decompiled) (100.00%)
__osSumcalc (decompiled) - __osSumcalc (decompiled) (100.00%)
__ll_lshift (decompiled) - __ll_lshift (decompiled) (100.00%)
Vec3fDiff (decompiled) - func_8000E958 (100.00%)

compare-n: Find common functions between one binary and multiple others

~/repos/pokemonsnap$ coddog compare-n decomp.yaml us /home/ethteck/repos/papermario/decomp.yaml
Comparing Pokemon Snap US to Paper Mario US:
func_80369F80_83D730 (decompiled) - npc_set_palswap_2 (decompiled) (90.91%)
alFxParam (decompiled) - au_SEFCmd_06_FineTune (decompiled) (91.67%)
alLink (decompiled) - alLink (decompiled) (93.33%)
alUnlink (decompiled) - alUnlink (decompiled) (90.91%)
func_800C1E04_5ECA4 - osFlashWriteBuffer (decompiled) (92.00%)

Comparing Pokemon Snap US to Paper Mario PAL:
No matches found

Comparing Pokemon Snap US to Paper Mario iQue:
func_80369F80_83D730 (decompiled) - npc_set_palswap_2 (decompiled) (90.91%)
alFxParam (decompiled) - au_SEFCmd_06_FineTune (decompiled) (91.67%)
alLink (decompiled) - alLink (decompiled) (93.33%)
alUnlink (decompiled) - alUnlink (decompiled) (90.91%)

Comparing Pokemon Snap US to Paper Mario JP:
func_80369F80_83D730 (decompiled) - npc_set_palswap_2 (decompiled) (90.91%)
alFxParam (decompiled) - au_SEFCmd_06_FineTune (decompiled) (91.67%)
alLink (decompiled) - alLink (decompiled) (93.33%)
alUnlink (decompiled) - alUnlink (decompiled) (90.91%)
func_800C1E04_5ECA4 - osFlashWriteBuffer (decompiled) (92.00%)

Configuration

coddog reads decomp.yaml files to understand the attributes of a project.

Extension points exported contracts — how you extend this code

Register (Interface)
(no doc)
website/src/app.tsx
ProcessEnv (Interface)
(no doc)
website/src/env.d.ts
FileRoutesByFullPath (Interface)
(no doc)
website/src/routeTree.gen.ts
FileRoutesByTo (Interface)
(no doc)
website/src/routeTree.gen.ts
FileRoutesById (Interface)
(no doc)
website/src/routeTree.gen.ts

Core symbols most depended-on inside this repo

to_string
called by 60
crates/db/src/main.rs
create
called by 11
crates/db/src/sources.rs
read_elf
called by 9
crates/core/src/ingest.rs
endianness
called by 7
crates/core/src/lib.rs
arch
called by 7
crates/core/src/lib.rs
init
called by 7
crates/db/src/lib.rs
get_opcode_hashes
called by 6
crates/core/src/lib.rs
collect_symbols
called by 6
crates/cli/src/main.rs

Shape

Function 132
Class 31
Method 18
Interface 12
Enum 10

Languages

Rust74%
TypeScript23%
C3%

Modules by API surface

crates/db/src/lib.rs24 symbols
crates/db/src/main.rs18 symbols
crates/core/src/lib.rs18 symbols
crates/cli/src/main.rs17 symbols
crates/api/src/main.rs16 symbols
crates/db/src/symbols.rs11 symbols
crates/core/src/arch.rs10 symbols
crates/db/src/projects.rs9 symbols
crates/core/src/ingest.rs8 symbols
website/src/routeTree.gen.ts6 symbols
website/src/api/symbols.tsx6 symbols
test/simple.c6 symbols

For agents

$ claude mcp add coddog \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact