The old_func value is returned only null within xhook_register, but it seems to be related to the syntax below.
I think it needs to be modified as below, so please check if it is correct.
Line 478 in the xh_elf_replace_function function
if(NULL != old_func) *old_func = old_addr;
This phrase is
if(NULL == old_func) *old_func = old_addr;
The old_func value is returned only null within xhook_register, but it seems to be related to the syntax below. I think it needs to be modified as below, so please check if it is correct.
Line 478 in the xh_elf_replace_function function
if(NULL != old_func) *old_func = old_addr;
This phrase isif(NULL == old_func) *old_func = old_addr;