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
{
8
W32_NONE
,
9
W32_CONTINUE
,
10
W32_ATTACH
,
11
W32_DETACH
,
12
W32_WAIT
,
13
W32_STOP
,
14
W32_CALL_FUNC
15
}
w32dbg_wrap_req
;
16
17
typedef
struct
{
18
w32dbg_wrap_req
type
;
19
union
{
20
DWORD
continue_status
;
21
struct
{
22
DEBUG_EVENT *
de
;
23
DWORD
wait_time
;
24
} wait;
25
struct
{
26
int
(*func)(
void
*);
27
void
*
user
;
28
} func;
29
};
30
int
ret
;
31
DWORD
err
;
32
}
W32DbgWParams
;
33
34
typedef
struct
{
35
HANDLE
debugThread
;
36
W32DbgWParams
params
;
37
HANDLE
request_sem
;
38
HANDLE
result_sem
;
39
ULONG_PTR
winbase
;
40
PROCESS_INFORMATION
pi
;
41
// Stores the TID of the thread DebugBreakProcess creates to ignore it's breakpoint
42
DWORD
break_tid
;
43
}
W32DbgWInst
;
44
45
#define w32dbgw_ret(inst) inst->params.ret
46
#define w32dbgw_err(inst) (SetLastError(inst->params.err), inst->params.err)
47
48
W32DbgWInst
*
w32dbg_wrap_new
(
void
);
49
int
w32dbg_wrap_wait_ret
(
W32DbgWInst
*inst);
50
void
w32dbg_wrap_free
(
W32DbgWInst
*inst);
51
52
#endif
int
static int
Definition:
sfsocketcall.h:114
W32DbgWInst
Definition:
w32dbg_wrap.h:34
W32DbgWInst::result_sem
HANDLE result_sem
Definition:
w32dbg_wrap.h:38
W32DbgWInst::break_tid
DWORD break_tid
Definition:
w32dbg_wrap.h:42
W32DbgWInst::params
W32DbgWParams params
Definition:
w32dbg_wrap.h:36
W32DbgWInst::pi
PROCESS_INFORMATION pi
Definition:
w32dbg_wrap.h:40
W32DbgWInst::debugThread
HANDLE debugThread
Definition:
w32dbg_wrap.h:35
W32DbgWInst::winbase
ULONG_PTR winbase
Definition:
w32dbg_wrap.h:39
W32DbgWInst::request_sem
HANDLE request_sem
Definition:
w32dbg_wrap.h:37
W32DbgWParams
Definition:
w32dbg_wrap.h:17
W32DbgWParams::wait_time
DWORD wait_time
Definition:
w32dbg_wrap.h:23
W32DbgWParams::de
DEBUG_EVENT * de
Definition:
w32dbg_wrap.h:22
W32DbgWParams::continue_status
DWORD continue_status
Definition:
w32dbg_wrap.h:20
W32DbgWParams::type
w32dbg_wrap_req type
Definition:
w32dbg_wrap.h:18
W32DbgWParams::ret
int ret
Definition:
w32dbg_wrap.h:30
W32DbgWParams::user
void * user
Definition:
w32dbg_wrap.h:27
W32DbgWParams::err
DWORD err
Definition:
w32dbg_wrap.h:31
w32dbg_wrap_req
w32dbg_wrap_req
Definition:
w32dbg_wrap.h:7
W32_NONE
@ W32_NONE
Definition:
w32dbg_wrap.h:8
W32_ATTACH
@ W32_ATTACH
Definition:
w32dbg_wrap.h:10
W32_STOP
@ W32_STOP
Definition:
w32dbg_wrap.h:13
W32_CONTINUE
@ W32_CONTINUE
Definition:
w32dbg_wrap.h:9
W32_DETACH
@ W32_DETACH
Definition:
w32dbg_wrap.h:11
W32_CALL_FUNC
@ W32_CALL_FUNC
Definition:
w32dbg_wrap.h:14
W32_WAIT
@ W32_WAIT
Definition:
w32dbg_wrap.h:12
w32dbg_wrap_new
W32DbgWInst * w32dbg_wrap_new(void)
Definition:
w32dbg_wrap.c:48
w32dbg_wrap_wait_ret
int w32dbg_wrap_wait_ret(W32DbgWInst *inst)
Definition:
w32dbg_wrap.c:71
w32dbg_wrap_free
void w32dbg_wrap_free(W32DbgWInst *inst)
Definition:
w32dbg_wrap.c:58
HANDLE
DWORD * HANDLE
Definition:
windows_debug.h:119
DWORD
DWORD
Definition:
windows_debug.h:119
subprojects
rzw32dbg_wrap
include
w32dbg_wrap.h
Generated by
1.9.1