Skip to content

meltedinhex/analyst-ai-pack / skills/debugging-malware-with-x64dbg

debugging-malware-with-x64dbg

Verified

Uses x64dbg to dynamically debug Windows malware: setting strategic breakpoints on APIs, stepping through unpacking and decryption, dumping memory at the right moment, and manipulating execution to reach hidden code. Activates for requests to debug malware with x64dbg, set API breakpoints, or step through unpacking in a debugger.

FileKindSize
LICENSEother340 B
SKILL.mdskill md3.8 KB
references/api-reference.mdmarkdown1.2 KB
scripts/analyst.pyscript2.5 KB

scripts/analyst.py

View on GitHub
#!/usr/bin/env python3
"""Generate x64dbg command scripts of strategic API breakpoints.

Emits a ``.txt`` script of ``bp`` commands (loadable in x64dbg) for a chosen analysis goal,
so a debugging session starts with the right breakpoints. This produces a text script only;
it does not attach to or run any process.
"""
from __future__ import annotations

import argparse
import sys

PRESETS: dict[str, list[str]] = {
    "unpacking": [
        "VirtualAlloc", "VirtualAllocEx", "VirtualProtect", "VirtualProtectEx",
        "LoadLibraryA", "LoadLibraryW", "GetProcAddress",
    ],
    "injection": [
        "VirtualAllocEx", "WriteProcessMemory", "CreateRemoteThread",
        "NtCreateThreadEx", "QueueUserAPC", "SetThreadContext", "ResumeThread",
        "NtUnmapViewOfSection", "CreateProcessInternalW",
    ],
    "crypto": [
        "CryptDecrypt", "CryptEncrypt", "CryptAcquireContextA", "CryptImportKey",
        "BCryptDecrypt", "BCryptEncrypt",
    ],
    "network": [
        "InternetOpenA", "InternetOpenW", "InternetConnectA", "HttpOpenRequestA",
        "HttpSendRequestA", "WinHttpConnect", "WinHttpSendRequest", "connect", "send",
    ],
    "persistence": [
        "RegSetValueExA", "RegSetValueExW", "RegCreateKeyExA",
        "CreateServiceA", "CreateServiceW",
    ],
}


def build_script(presets: list[str]) -> str:
    lines = ["// x64dbg breakpoint script generated by AnalystAIPack",
             "// load with: scriptload bp.txt  (or run line by line)"]
    seen: set[str] = set()
    for preset in presets:
        apis = PRESETS.get(preset)
        if not apis:
            lines.append(f"// unknown preset: {preset}")
            continue
        lines.append(f"// --- {preset} ---")
        for api in apis:
            if api not in seen:
                lines.append(f"bp {api}")
                seen.add(api)
    lines.append("// set log on hit, e.g.: bplog VirtualAlloc \"alloc size={p1}\"")
    return "\n".join(lines) + "\n"


def main(argv: list[str] | None = None) -> int:
    parser = argparse.ArgumentParser(description="Generate x64dbg breakpoint script")
    sub = parser.add_subparsers(dest="cmd", required=True)
    p = sub.add_parser("breakpoints")
    p.add_argument("--preset", action="append", required=True,
                   choices=sorted(PRESETS) + ["all"],
                   help="one or more presets, or 'all'")
    args = parser.parse_args(argv)

    presets = sorted(PRESETS) if "all" in args.preset else args.preset
    sys.stdout.write(build_script(presets))
    return 0


if __name__ == "__main__":
    sys.exit(main())
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 197kUpdated Claude CodeCodexVerifiedInstall