namespace axl::spy

namespace spy {

// typedefs

typedef HookAction HookEnterFunc(
    void *targetFunc,
    void *callbackParam,
    size_t frameBase
    );

typedef void HookLeaveFunc(
    void *targetFunc,
    void *callbackParam,
    size_t frameBase
    );

// enums

enum FrameOffset;
enum HookAction;

// structs

struct ImportWriteProtectionBackup;
struct VaList;

// classes

class HookArena;
class ImportIteratorBase;

// global functions

void
vaStart(
    VaList& va,
    size_t frameBase
    );

template <typename T>
T&
vaArg(VaList& va);

void
vaEnd(VaList& va);

void
setHookTargetFunc(
    Hook* hook,
    void* targetFunc
    );

void
enableHooks();

void
disableHooks();

void
enableCurrentThreadHooks();

void
disableCurrentThreadHooks();

bool
enumerateImports(
    ImportIterator* iterator,
    void* module = NULL
    );

bool
enumerateImports(
    ImportIterator* importIterator,
    const ModuleIterator& moduleIterator
    );

ImportIterator
enumerateImports(void* module = NULL);

ImportIterator
enumerateImports(const ModuleIterator& moduleIterator);

bool
disableImportWriteProtection(
    void* module,
    ImportWriteProtectionBackup* backup
    );

bool
disableImportWriteProtection(
    const ModuleIterator& moduleIterator,
    ImportWriteProtectionBackup* backup
    );

bool
restoreImportWriteProtection(const ImportWriteProtectionBackup* backup);

bool
enumerateModules(ModuleIterator* iterator);

ModuleIterator
enumerateModules();

} // namespace spy