windows-x86-debugger

🐞 A simple Windows x86 debugging framework written in C++20 that supports software breakpoints and hardware breakpoints. It can be used to create custom debuggers.(使用C++20开发的简易Windows x86调试框架,支持软件断点和硬件断点,可以用于创建自定义调试器。)

https://github.com/zhuagenborn/windows-x86-debugger

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.1%) to scientific vocabulary

Keywords

cpp20 debugger framework windows
Last synced: 4 months ago · JSON representation ·

Repository

🐞 A simple Windows x86 debugging framework written in C++20 that supports software breakpoints and hardware breakpoints. It can be used to create custom debuggers.(使用C++20开发的简易Windows x86调试框架,支持软件断点和硬件断点,可以用于创建自定义调试器。)

Basic Info
  • Host: GitHub
  • Owner: Zhuagenborn
  • License: mit
  • Language: C++
  • Default Branch: main
  • Homepage:
  • Size: 93.8 KB
Statistics
  • Stars: 12
  • Watchers: 4
  • Forks: 3
  • Open Issues: 0
  • Releases: 0
Topics
cpp20 debugger framework windows
Created about 4 years ago · Last pushed 9 months ago
Metadata Files
Readme License Citation

README.md

Windows x86 Debugger

C++ CMake Visual-Studio Windows License

Introduction

Cover

A simple Windows x86 debugging framework written in C++20 that supports software breakpoints and hardware breakpoints. It can be used to create custom debuggers. Some design patterns came from GleeBug.

Getting Started

Prerequisites

Building

Set the location to the project folder and run:

bash mkdir -p build cd build cmake .. -G "Visual Studio 17 2022" -A Win32 cmake --build .

Usage

Users can create derived classes inheriting from Debugger class and override or implement provided event callbacks.

  • Debugger does not provide any implementation for event callbacks whose names start with cb.
  • Debugger provides the basic implementation for event callbacks whose names start with On.

```c++ class MyDebugger : public Debugger { private: void cbCreateProcess(const CREATEPROCESSDEBUG_INFO& details, const Process& process) override { std::cout << std::format("The process {} has been created.", process.Id()) << std::endl; }

void cbExitProcess(const EXIT_PROCESS_DEBUG_INFO& details,
                   const Process& process) override {
    std::cout << std::format("The process {} has exited.",
                             process.Id())
              << std::endl;
}

}; ```

Documents

Code comments follow Doxygen specification.

Class Diagram

```mermaid classDiagram

namespace register {

class RegisterIndex {
    <<enumeration>>
    EAX
    EBX
    ECX
    EDX
}

class Register {
    Set(int)
    Reset()
    Get() int
}

class Flag {
    <<enumeration>>
    CF
    AF
    PF
    ZF
}

class FlagRegister {
    SetCF()
    ResetCF()
    CF() bool
}

class DebugStatusRegister {
    SetB0()
    ResetB0()
    B0() bool
}

class DebugControlRegister {
    SetL0()
    ResetL0()
    L0() bool
    SetRW0(val)
    RW0() int
}

class Registers {
    Register EAX
    FlagRegister EFLAGS
    DebugStatusRegister DR6
    DebugControlRegister DR7
}

}

Register --> RegisterIndex Register <|-- FlagRegister FlagRegister ..> Flag Register <|-- DebugStatusRegister Register <|-- DebugControlRegister Registers o-- Register

namespace breakpoint {

class Breakpoint {
    int address
}

class HardwareBreakpointSlot {
    <<enumeration>>
    DR0
    DR1
    DR2
    DR3
}

class HardwareBreakpointType {
    <<enumeration>>
    Execute
    Write
    ReadWrite
}

class HardwareBreakpointSize {
    <<enumeration>>
    Byte
    Word
    Dword
}

class HardwareBreakpoint {
    HardwareBreakpointSlot slot
    HardwareBreakpointType access
    HardwareBreakpointSize size
}

class SoftwareBreakpoint {
    byte origin
}

}

Breakpoint <|-- HardwareBreakpoint HardwareBreakpoint --> HardwareBreakpointSlot HardwareBreakpoint --> HardwareBreakpointType HardwareBreakpoint --> HardwareBreakpointSize Breakpoint <|-- SoftwareBreakpoint

class Thread { Suspend() Resume() StepInto() SetHardwareBreakpoint(addr, slot, type, size) DeleteHardwareBreakpoint(slot) }

Thread *-- HardwareBreakpoint Thread --> Registers

class Process { Suspend() Resume() FindThread(id) Thread NewThread(thread) RemoveThread(thread) SetSoftwareBreakpoint(addr, callback) DeleteSoftwareBreakpoint(addr) FindSoftwareBreakpoint(addr) SoftwareBreakpoint SetHardwareBreakpoint(addr, slot, type, size, callback) DeleteHardwareBreakpoint(addr) FindHardwareBreakpoint(addr) HardwareBreakpoint WriteMemory(addr, data) ReadMemory(addr, size) vector~byte~ }

Process *-- Thread Process *-- SoftwareBreakpoint

class Debugger { Create(file, cmd) Attach(proc) Start() Detach() Stop() }

Debugger o-- Process ```

License

Distributed under the MIT License. See LICENSE for more information.

Owner

  • Name: Zhuagenborn
  • Login: Zhuagenborn
  • Kind: organization
  • Location: Ireland

Software Development | Artificial Intelligence | Reverse Engineering.

Citation (CITATION.cff)

cff-version: 1.2.0
authors:
- family-names: Chen
  given-names: Zhenshuo
  orcid: https://orcid.org/0000-0003-2091-4160
- family-names: Liu
  given-names: Guowen
  orcid: https://orcid.org/0000-0002-8375-5729
title: Windows x86 Debugger
date-released: 2022-11-05
url: https://github.com/Zhuagenborn/Windows-x86-Debugger

GitHub Events

Total
  • Watch event: 1
  • Push event: 2
Last Year
  • Watch event: 1
  • Push event: 2

Committers

Last synced: 5 months ago

All Time
  • Total Commits: 19
  • Total Committers: 1
  • Avg Commits per committer: 19.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Chenzs108 c****8@o****m 19

Issues and Pull Requests

Last synced: 5 months ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels