Rizin
unix-like reverse engineering framework and cli tools
w32dbg_wrap.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2019-2020 GustavoLCR <gugulcr@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef W32DBG_WRAP
5 #define W32DBG_WRAP
6 
7 typedef enum {
16 
17 typedef struct {
19  union {
21  struct {
22  DEBUG_EVENT *de;
24  } wait;
25  struct {
26  int (*func)(void *);
27  void *user;
28  } func;
29  };
30  int ret;
33 
34 typedef struct {
39  ULONG_PTR winbase;
40  PROCESS_INFORMATION pi;
41  // Stores the TID of the thread DebugBreakProcess creates to ignore it's breakpoint
43 } W32DbgWInst;
44 
45 #define w32dbgw_ret(inst) inst->params.ret
46 #define w32dbgw_err(inst) (SetLastError(inst->params.err), inst->params.err)
47 
50 void w32dbg_wrap_free(W32DbgWInst *inst);
51 
52 #endif
static int
Definition: sfsocketcall.h:114
HANDLE result_sem
Definition: w32dbg_wrap.h:38
DWORD break_tid
Definition: w32dbg_wrap.h:42
W32DbgWParams params
Definition: w32dbg_wrap.h:36
PROCESS_INFORMATION pi
Definition: w32dbg_wrap.h:40
HANDLE debugThread
Definition: w32dbg_wrap.h:35
ULONG_PTR winbase
Definition: w32dbg_wrap.h:39
HANDLE request_sem
Definition: w32dbg_wrap.h:37
DWORD wait_time
Definition: w32dbg_wrap.h:23
DEBUG_EVENT * de
Definition: w32dbg_wrap.h:22
DWORD continue_status
Definition: w32dbg_wrap.h:20
w32dbg_wrap_req type
Definition: w32dbg_wrap.h:18
w32dbg_wrap_req
Definition: w32dbg_wrap.h:7
@ W32_NONE
Definition: w32dbg_wrap.h:8
@ W32_ATTACH
Definition: w32dbg_wrap.h:10
@ W32_STOP
Definition: w32dbg_wrap.h:13
@ W32_CONTINUE
Definition: w32dbg_wrap.h:9
@ W32_DETACH
Definition: w32dbg_wrap.h:11
@ W32_CALL_FUNC
Definition: w32dbg_wrap.h:14
@ W32_WAIT
Definition: w32dbg_wrap.h:12
W32DbgWInst * w32dbg_wrap_new(void)
Definition: w32dbg_wrap.c:48
int w32dbg_wrap_wait_ret(W32DbgWInst *inst)
Definition: w32dbg_wrap.c:71
void w32dbg_wrap_free(W32DbgWInst *inst)
Definition: w32dbg_wrap.c:58
DWORD * HANDLE
DWORD