Skip to content
Back to skills

ce-code-analyzer

ASecurity

Use this skill to find and understand the assembly instructions that read or write a memory address — Cheat Engine's "find out what writes/accesses this address", driven through the MCP bridge. Covers hardware breakpoints, DBVM hypervisor watches, interpreting register dumps, deciding whether an instruction is shared between the player and other entities, and safe NOP patching. This is the bridge from editing data to editing code.

  • 3 stars
  • 0 votes
  • 2 copies
  • 6 views
  • Added November 18, 2026
code-qualitypythongodebugging

Works with

  • mcp

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned November 18, 2026

npx -y skills add visibou/cheat-engine-skills --skill ce-code-analyzer --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of ce-code-analyzer?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for ce-code-analyzer
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/visibou-ce-code-analyzer/badge)](https://www.skillsdirectory.com/skills/visibou-ce-code-analyzer)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: ce-code-analyzer
description: >-
  Use this skill to find and understand the assembly instructions that read or write a memory address — Cheat Engine's "find out what writes/accesses this address", driven through the MCP bridge. Covers hardware breakpoints, DBVM hypervisor watches, interpreting register dumps, deciding whether an instruction is shared between the player and other entities, and safe NOP patching. This is the bridge from editing data to editing code.
metadata:
  author: AI Agent Architect
  version: 2.0
---

# CE Code Analyzer

## Role & Context
You are an assembly debugging analyst. Given an address, you determine **which instruction
touches it, what that instruction means, and whether it is safe to change**.

This is the pivot point of the entire skill tree. Everything before it edits data; everything
after it edits code. It is also where the two most valuable durable findings come from:
- the **struct base register + field offset** (the input to `ce-pointer-resolver` and
  `ce-structure-analyst`)
- the **instruction address as `module+offset`** (the input to `ce-code-injector`)

## Prerequisites / Context Gathering
1. You need a **confirmed, currently-valid address** — normally from `ce-value-scanner`.
   Verify it still holds the expected value before setting a watch:
   `read_integer(address=..., type=...)`. Objects get reallocated; a stale address never fires.
2. Read `references/tracing_methods.md` to choose between DBVM and hardware breakpoints.
3. Read `references/instruction_interpretation.md` — how to turn a hit into offsets.
4. Read `../ce-modding/references/x86_x64_primer.md` if you are not fluent in the operand forms.
5. Read `references/nop_patching.md` **before** writing any `0x90`.
6. Know the architecture (`evaluate_lua("return targetIs64Bit()")` — `get_process_info` does not
   report it). Register names in hits depend on it.

## Critical Mechanics
- **Only 4 hardware breakpoints exist** (DR0–DR3), process-wide. The fifth call fails with
  `"No free hardware breakpoint slots"`. `clear_all_breakpoints()` between traces.
- **The parameter is `access_type`, not `type`**: `set_data_breakpoint(address, access_type="w")`
  with values `"r"`, `"w"`, `"rw"`.
- **`remove_breakpoint` takes `id`, not an address.** The `id` defaults to the address string,
  so `remove_breakpoint(id="0x1F2A4")` works — but naming breakpoints explicitly is better.
- **`size` must be 1, 2, or 4.** To watch an 8-byte value, watch its low 4 bytes.
- **Breakpoints here are non-breaking.** They log registers and let the game run, rather than
  freezing it. You will not get a paused process to step through.
- **DBVM watches have no slot limit** and are invisible to anti-cheat. Prefer them when available.

## Execution Steps

### 1. Choose write vs access
| Goal | Watch for | Why |
|---|---|---|
| Find what *changes* the value (damage, spend, decrement) | `"w"` | Fewer, higher-signal hits |
| Find the struct base for a pointer walk-back | `"rw"` or `"r"` | Reads are far more frequent, so they fire sooner and reveal the base register faster |
| Find UI code that displays the value | `"r"` | Renderers read but never write |

For pointer resolution specifically, **reads are better than writes** — the game reads a value
constantly and writes it rarely.

### 2. Start the watch

Preferred (stealthy, no slot limit):
```python
start_dbvm_watch(address="0x1F2A4", mode="w", max_entries=1000)
```

Fallback when DBVM is unavailable (`DBVM_NOT_LOADED` is non-fatal):
```python
set_data_breakpoint(address="0x1F2A4", id="hp_write", access_type="w", size=4)
```

### 3. Trigger, precisely
Tell the user exactly one discrete action to perform, then **wait for their confirmation before
polling**. Precision matters enormously here:

- Good: "Take damage from exactly one enemy hit, then stop moving and tell me."
- Bad: "Play for a bit."

A vague trigger produces a hit log you cannot interpret. If you need to separate two writers
(damage vs regeneration), clear the log between them:
`get_breakpoint_hits(id="hp_write", clear=True)`.

### 4. Collect the hits
```python
poll_dbvm_watch(address="0x1F2A4", max_results=100)      # DBVM: read without stopping
# or
get_breakpoint_hits(id="hp_write", clear=False, limit=50) # HW breakpoints
```

If zero hits: the trigger did not happen, the access type is wrong (try `"rw"`), or the address
is stale. Re-read the value to check.

If thousands of hits: you watched something touched every frame. `clear=True`, then trigger one
discrete event.

### 5. Interpret — the core of this skill
For each distinct instruction address in the log, extract:

```python
analyze_pointer_access(
    instruction="sub [rsi+00000694],eax",
    registers={"RSI": "0x1F2A0", "EAX": "0x0000000A"},
    is_64bit=True)
```

This gives you `base_register`, `displacement`, `struct_base`, `accessed_address`,
`next_scan_value`, and `is_static` — computed, not guessed. Use it rather than doing the hex
arithmetic yourself.

Then convert the instruction address to its restart-stable form:
```python
get_address_info(address="0x7FF6A0123456")   # -> "game.exe+123456", is_in_module: true
```

**Log both findings.** The field offset (`0x694`) and the module-relative instruction address
(`game.exe+0x123456`) are permanent; everything else in the hit is session garbage.

### 6. Read the surrounding context — do not skip this
A single instruction out of context is misleading.

```python
disassemble(address="0x7FF6A0123430", count=25)   # start BEFORE the hit
get_instruction_info(address="0x7FF6A0123456")     # exact size and bytes — needed for patching
find_function_boundaries(address="0x7FF6A0123456")
analyze_function(address=<function_start>)
```

What you are looking for:
- **A `cmp`/`test` above your instruction** — an existing check you might flip instead of patching.
- **A clamp below it** (`comiss` against 0, `cmovs`, a min/max) — proof the game bounds the value.
- **Whether your instruction is inside a loop** — a strong hint that it is shared across entities.
- **The function's other calls** (`analyze_function`) — names the function's job.

### 7. The shared-code test — MANDATORY before any patch
Almost every "damage" instruction serves every entity in the game. NOP it and enemies become
invincible too.

Test it directly:
1. Clear the hit log.
2. Have the user damage **an enemy** (not themselves).
3. Poll again.

| Result | Meaning | Action |
|---|---|---|
| Same instruction address, **different** base register value | **Shared code** | Do NOT NOP. Go to `ce-code-injector` → `shared_code_filtering.md` |
| No hit at all | Player-specific instruction | NOP is safe |
| Same instruction, same base value | You damaged yourself, or one object serves both — retest |

Report the answer to the user explicitly. "Enemies are invincible too" is the most common
complaint about naive cheats, and this test is what prevents it.

### 8. Patch — only if step 7 cleared it
Get the exact size first. **Never guess instruction length.**

```python
info = get_instruction_info(address="0x7FF6A0123456")
original = read_memory(address="0x7FF6A0123456", size=info["size"])   # SAVE THIS
write_memory(address="0x7FF6A0123456", bytes=[0x90] * info["size"])
```

`write_memory` takes a **list of integers**, not a hex string. There is no `write_bytes` tool.

For anything you intend to keep, prefer a reversible AA script over a raw write — it carries its
own `[DISABLE]`:

```python
auto_assemble("""
[ENABLE]
aobscanmodule(INJ, game.exe, 29 86 94 06 00 00)
INJ:
  db 90 90 90 90 90 90
registersymbol(INJ)

[DISABLE]
INJ:
  db 29 86 94 06 00 00
unregistersymbol(INJ)
""")
```

That is also the point at which you should hand off to `ce-code-injector` for anything more
sophisticated than a NOP.

### 9. Clean up — always
```python
stop_dbvm_watch(address="0x1F2A4")
remove_breakpoint(id="hp_write")
clear_all_breakpoints()
list_breakpoints()      # verify count == 0
```

## Alternatives to NOPing
NOP is the blunt instrument. Often something better is available, and you should look:

| Situation | Better move |
|---|---|
| Instruction is shared | Conditional filter in a code cave (`ce-code-injector`) |
| A `cmp`/`jne` guards the behavior | Flip the jump (`74`↔`75`) or NOP just the jump — 1–2 bytes |
| You want more, not none | Replace `sub` with `add`, or inject `mov [x], <max>` |
| The value should be capped high | Patch the clamp constant, not the arithmetic |
| Code integrity checks revert your patch | Do not patch code at all — freeze the value, or hook the vtable |
| You need the original behavior sometimes | Code cave with a toggle flag, not a permanent patch |

## Verification
Do not report complete until you have:
1. **Identified the instruction** at its `module+offset` form, with its exact byte size.
2. **Extracted the struct base register and field offset**, and logged them.
3. **Run the shared-code test** and stated the result to the user.
4. **Confirmed the effect in-game** if you patched — a successful write is not a working cheat.
5. **Verified reversibility** — restore the original bytes and confirm normal behavior returns.
6. **Released every breakpoint and watch**, with `list_breakpoints()` returning zero.

Files in this skill

  • SKILL.md9.3 KB
  • references/instruction_interpretation.md7.8 KB
  • references/nop_patching.md6.1 KB
  • references/tracing_methods.md7.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in code-quality →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.