@@ -422,33 +422,39 @@ typedef struct HookedRegion {
422
422
} HookedRegion ;
423
423
424
424
// hooked_regions related functions
425
- static inline guint hooked_regions_hash (const void * p ) {
426
- HookedRegion * region = (HookedRegion * )p ;
425
+ static inline guint hooked_regions_hash (const void * p )
426
+ {
427
+ HookedRegion * region = (HookedRegion * )p ;
427
428
428
429
return qemu_xxhash4 (region -> start , region -> length );
429
430
}
430
431
431
- static inline gboolean hooked_regions_equal (const void * lhs , const void * rhs ) {
432
- HookedRegion * l = (HookedRegion * )lhs ;
433
- HookedRegion * r = (HookedRegion * )rhs ;
432
+ static inline gboolean hooked_regions_equal (const void * lhs , const void * rhs )
433
+ {
434
+ HookedRegion * l = (HookedRegion * )lhs ;
435
+ HookedRegion * r = (HookedRegion * )rhs ;
434
436
435
437
return l -> start == r -> start && l -> length == r -> length ;
436
438
}
437
439
438
- static inline void hooked_regions_add (struct hook * h , uint64_t start , uint64_t length ) {
440
+ static inline void hooked_regions_add (struct hook * h , uint64_t start ,
441
+ uint64_t length )
442
+ {
439
443
HookedRegion tmp ;
440
444
tmp .start = start ;
441
445
tmp .length = length ;
442
446
443
- if (!g_hash_table_lookup (h -> hooked_regions , (void * )& tmp )) {
444
- HookedRegion * r = malloc (sizeof (HookedRegion ));
447
+ if (!g_hash_table_lookup (h -> hooked_regions , (void * )& tmp )) {
448
+ HookedRegion * r = malloc (sizeof (HookedRegion ));
445
449
r -> start = start ;
446
450
r -> length = length ;
447
- g_hash_table_insert (h -> hooked_regions , (void * )r , (void * )1 );
451
+ g_hash_table_insert (h -> hooked_regions , (void * )r , (void * )1 );
448
452
}
449
453
}
450
454
451
- static inline void hooked_regions_check_single (struct list_item * cur , uint64_t start , uint64_t length ) {
455
+ static inline void hooked_regions_check_single (struct list_item * cur ,
456
+ uint64_t start , uint64_t length )
457
+ {
452
458
while (cur != NULL ) {
453
459
if (HOOK_BOUND_CHECK ((struct hook * )cur -> data , start )) {
454
460
hooked_regions_add ((struct hook * )cur -> data , start , length );
@@ -457,10 +463,13 @@ static inline void hooked_regions_check_single(struct list_item *cur, uint64_t s
457
463
}
458
464
}
459
465
460
- static inline void hooked_regions_check (uc_engine * uc , uint64_t start , uint64_t length ) {
466
+ static inline void hooked_regions_check (uc_engine * uc , uint64_t start ,
467
+ uint64_t length )
468
+ {
461
469
// Only UC_HOOK_BLOCK and UC_HOOK_CODE might be wrongle cached!
462
470
hooked_regions_check_single (uc -> hook [UC_HOOK_CODE_IDX ].head , start , length );
463
- hooked_regions_check_single (uc -> hook [UC_HOOK_BLOCK_IDX ].head , start , length );
471
+ hooked_regions_check_single (uc -> hook [UC_HOOK_BLOCK_IDX ].head , start ,
472
+ length );
464
473
}
465
474
466
475
#ifdef UNICORN_TRACER
0 commit comments