# Build an AngrDBG frontend for your debugger

DevFeed: [Build an AngrDBG frontend for your debugger](<https://devfeed.tech/articles/build-an-angrdbg-frontend-for-your-debugger-41512.md>)

Original publisher: [Read original article](<https://andreafioraldi.github.io/articles/2018/09/22/angrdbg-frontend.html>)

Author: malweisse's corruptions

Published: 2018-09-22T00:00:00Z

Content type: tutorial

Language: en

Sources: [The blog of malweisse's corruptions](<https://devfeed.tech/sources/the-blog-of-malweisse-s-corruptions.md>)

Topics: [synchronization](<https://devfeed.tech/topics/synchronization.md>), [gdb](<https://devfeed.tech/topics/gdb.md>), [debugging](<https://devfeed.tech/topics/debugging.md>), [Process](<https://devfeed.tech/topics/process.md>)

Tags: [debugger](<https://devfeed.tech/tags/debugger.md>), [gdb](<https://devfeed.tech/tags/gdb.md>), [process](<https://devfeed.tech/tags/process.md>), [python](<https://devfeed.tech/tags/python.md>), [subclass](<https://devfeed.tech/tags/subclass.md>), [synchronization](<https://devfeed.tech/tags/synchronization.md>)

## AI overview

This tutorial explains how to build a frontend for a debugger using AngrDBG. It describes the subclass and registration required to synchronize a concrete process state with an angr state, along with methods for process control, memory and register access, executable metadata, and symbol resolution.

## Source excerpt

AngrDBG is the library that I developed to synchronize a concrete process state with an angr state. The library is debugger agnostic. A frontend library that integrates AngrDBG with a specific debugger must implements a subclass of angrdbg.Debugger and register an istance of that class as source of data using angrdbg.register_debugger. The methods that must be implemented are the following: before_stateshot(self) An event handler triggered before the synchronization setup in StateShot, just after the empty state creation after_stateshot(self, state) An event handler triggered before the StateShot return is_active(self) Return True if the debugger is running the target process input_file(self) Return a python file-like object of the target executable image_base(self) Return the process base address get_<byte|word|dword|qword>(self, addr) Read an byte|word|dword|qword from the memory as a python int (4 distinct methods) get_bytes(self, addr, size) Read a string from the memory put_<byte|word|dword|qword>(self, addr, value) Write a python in as a byte|word|dword|qword to the memory (4 distinct methods) put_bytes(self, addr, value) Write a string to the memory get_reg(self, name) Get a register value set_reg(self, name, value) Set a register value step_into(self) Call the debugger step into command run(self) Run the process inside the debugger wait_ready(self) Wait until the debugged process is ready to be inspected refresh_memory(self) Refresh the memory API of the debugger seg_by_name(self, name) Get a Segment object by the name seg_by_addr(self, name) Get a Segment object by the address get_got(self) Get a tuple (start address, end address) related to the GOT section get_plt(self) Get a tuple (start address, end address) related to the PLT section resolve_name(self, name) Resolve a symbol to its address using the name You can find here the GDBDebugger class used in the GDB frontend.