@@ -15,30 +15,15 @@ pub type uc_hook = *mut c_void;
15
15
pub type uc_context = * mut c_void ;
16
16
17
17
extern "C" {
18
- pub fn uc_version (
19
- major : * mut u32 ,
20
- minor : * mut u32 ,
21
- ) -> u32 ;
18
+ pub fn uc_version ( major : * mut u32 , minor : * mut u32 ) -> u32 ;
22
19
pub fn uc_arch_supported ( arch : Arch ) -> bool ;
23
- pub fn uc_open (
24
- arch : Arch ,
25
- mode : Mode ,
26
- engine : * mut uc_handle ,
27
- ) -> uc_error ;
20
+ pub fn uc_open ( arch : Arch , mode : Mode , engine : * mut uc_handle ) -> uc_error ;
28
21
pub fn uc_close ( engine : uc_handle ) -> uc_error ;
29
22
pub fn uc_context_free ( mem : uc_context ) -> uc_error ;
30
23
pub fn uc_errno ( engine : uc_handle ) -> uc_error ;
31
24
pub fn uc_strerror ( error_code : uc_error ) -> * const c_char ;
32
- pub fn uc_reg_write (
33
- engine : uc_handle ,
34
- regid : c_int ,
35
- value : * const c_void ,
36
- ) -> uc_error ;
37
- pub fn uc_reg_read (
38
- engine : uc_handle ,
39
- regid : c_int ,
40
- value : * mut c_void ,
41
- ) -> uc_error ;
25
+ pub fn uc_reg_write ( engine : uc_handle , regid : c_int , value : * const c_void ) -> uc_error ;
26
+ pub fn uc_reg_read ( engine : uc_handle , regid : c_int , value : * mut c_void ) -> uc_error ;
42
27
pub fn uc_mem_write (
43
28
engine : uc_handle ,
44
29
address : u64 ,
@@ -51,12 +36,7 @@ extern "C" {
51
36
bytes : * mut u8 ,
52
37
size : libc:: size_t ,
53
38
) -> uc_error ;
54
- pub fn uc_mem_map (
55
- engine : uc_handle ,
56
- address : u64 ,
57
- size : libc:: size_t ,
58
- perms : u32 ,
59
- ) -> uc_error ;
39
+ pub fn uc_mem_map ( engine : uc_handle , address : u64 , size : libc:: size_t , perms : u32 ) -> uc_error ;
60
40
pub fn uc_mem_map_ptr (
61
41
engine : uc_handle ,
62
42
address : u64 ,
@@ -73,11 +53,7 @@ extern "C" {
73
53
write_cb : * mut c_void ,
74
54
user_data_write : * mut c_void ,
75
55
) -> uc_error ;
76
- pub fn uc_mem_unmap (
77
- engine : uc_handle ,
78
- address : u64 ,
79
- size : libc:: size_t ,
80
- ) -> uc_error ;
56
+ pub fn uc_mem_unmap ( engine : uc_handle , address : u64 , size : libc:: size_t ) -> uc_error ;
81
57
pub fn uc_mem_protect (
82
58
engine : uc_handle ,
83
59
address : u64 ,
@@ -107,32 +83,12 @@ extern "C" {
107
83
end : u64 ,
108
84
...
109
85
) -> uc_error ;
110
- pub fn uc_hook_del (
111
- engine : uc_handle ,
112
- hook : uc_hook ,
113
- ) -> uc_error ;
114
- pub fn uc_query (
115
- engine : uc_handle ,
116
- query_type : Query ,
117
- result : * mut libc:: size_t ,
118
- ) -> uc_error ;
119
- pub fn uc_context_alloc (
120
- engine : uc_handle ,
121
- context : * mut uc_context ,
122
- ) -> uc_error ;
123
- pub fn uc_context_save (
124
- engine : uc_handle ,
125
- context : uc_context ,
126
- ) -> uc_error ;
127
- pub fn uc_context_restore (
128
- engine : uc_handle ,
129
- context : uc_context ,
130
- ) -> uc_error ;
131
- pub fn uc_ctl (
132
- engine : uc_handle ,
133
- control : u32 ,
134
- ...
135
- ) -> uc_error ;
86
+ pub fn uc_hook_del ( engine : uc_handle , hook : uc_hook ) -> uc_error ;
87
+ pub fn uc_query ( engine : uc_handle , query_type : Query , result : * mut libc:: size_t ) -> uc_error ;
88
+ pub fn uc_context_alloc ( engine : uc_handle , context : * mut uc_context ) -> uc_error ;
89
+ pub fn uc_context_save ( engine : uc_handle , context : uc_context ) -> uc_error ;
90
+ pub fn uc_context_restore ( engine : uc_handle , context : uc_context ) -> uc_error ;
91
+ pub fn uc_ctl ( engine : uc_handle , control : u32 , ...) -> uc_error ;
136
92
}
137
93
138
94
pub struct UcHook < ' a , D : ' a , F : ' a > {
@@ -293,10 +249,8 @@ pub unsafe extern "C" fn insn_out_hook_proxy<D, F>(
293
249
( user_data. callback ) ( & mut user_data_uc, port, size, value) ;
294
250
}
295
251
296
- pub unsafe extern "C" fn insn_sys_hook_proxy < D , F > (
297
- uc : uc_handle ,
298
- user_data : * mut UcHook < D , F > ,
299
- ) where
252
+ pub unsafe extern "C" fn insn_sys_hook_proxy < D , F > ( uc : uc_handle , user_data : * mut UcHook < D , F > )
253
+ where
300
254
F : FnMut ( & mut crate :: Unicorn < D > ) ,
301
255
{
302
256
let user_data = & mut * user_data;
0 commit comments