@@ -13193,9 +13193,12 @@ struct syshook_ret {
13193
13193
uint64_t retval ;
13194
13194
bool skip_syscall ;
13195
13195
};
13196
- struct syshook_ret (* libafl_syscall_hook )(int , uint64_t , uint64_t , uint64_t ,
13197
- uint64_t , uint64_t , uint64_t ,
13198
- uint64_t , uint64_t );
13196
+ struct syshook_ret (* libafl_pre_syscall_hook )(int , uint64_t , uint64_t , uint64_t ,
13197
+ uint64_t , uint64_t , uint64_t ,
13198
+ uint64_t , uint64_t );
13199
+ uint64_t (* libafl_post_syscall_hook )(uint64_t , int , uint64_t , uint64_t ,
13200
+ uint64_t , uint64_t , uint64_t , uint64_t ,
13201
+ uint64_t , uint64_t );
13199
13202
13200
13203
//// --- End LibAFL code ---
13201
13204
@@ -13230,8 +13233,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
13230
13233
13231
13234
//// --- Begin LibAFL code ---
13232
13235
13233
- if (libafl_syscall_hook ) {
13234
- struct syshook_ret hook_ret = libafl_syscall_hook (num ,
13236
+ if (libafl_pre_syscall_hook ) {
13237
+ struct syshook_ret hook_ret = libafl_pre_syscall_hook (num ,
13235
13238
(uint64_t )arg1 ,
13236
13239
(uint64_t )arg2 ,
13237
13240
(uint64_t )arg3 ,
@@ -13252,6 +13255,19 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,
13252
13255
arg5 , arg6 , arg7 , arg8 );
13253
13256
13254
13257
//// --- Begin LibAFL code ---
13258
+
13259
+ if (libafl_post_syscall_hook ) {
13260
+ ret = (abi_ulong )libafl_post_syscall_hook ((uint64_t )ret , num ,
13261
+ (uint64_t )arg1 ,
13262
+ (uint64_t )arg2 ,
13263
+ (uint64_t )arg3 ,
13264
+ (uint64_t )arg4 ,
13265
+ (uint64_t )arg5 ,
13266
+ (uint64_t )arg6 ,
13267
+ (uint64_t )arg7 ,
13268
+ (uint64_t )arg8 );
13269
+ }
13270
+
13255
13271
after_syscall :
13256
13272
//// --- End LibAFL code ---
13257
13273
0 commit comments