Skip to content

ek0/lena

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lena

Lena is a small SDK that allows you to quickly write effective tracers for windows. Written in C++ it allows for an easy integration in existing SDK. Currently, we only support one tracer per thread.

Usage

See tests/test_lena.cpp for a quick example.

Upcoming features

  • Support more tracer (up to 4 per thread?)
  • Build a C API

Documentation

LenaInit

void lena::Init(LenaDebugger* debugger)

Initialize the library. LenaInit must be called first in order to use tracing functionalities.

Parameters

debugger

LenaDebugger that will be used to set and unset hardware breakpoints.

Remarks

Lena uses debug registers internally to initialize its tracers. To avoid incompatibilities with external SDKs, the user must provide its own debugger managing the different hardware breakpoints himself.

LenaDebugger

struct lena::Debugger
{
    // Callback handling the initialization of the hardware breakpoint.
    void (*SetHardwareBreakpoint)(CONTEXT* ctx, uintptr_t address, uint32_t thread_id);

    // Callback only called when the hardware breakpoint is hit.
    void (*UnsetHardwareBreakpoint)(CONTEXT* context, uint32_t thread_id);
};

User defined callbacks to set and unset hardware breakpoints. Hardware breakpoints are used internally to know when to start tracing.

SetHardwareBreakpoint