mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-01 16:05:52 +00:00
tsh tests / update setregularkey tsh
This commit is contained in:
22
hookstests/hookset/wasm/rollback.c
Normal file
22
hookstests/hookset/wasm/rollback.c
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* This hook just accepts any transaction coming through it
|
||||
*/
|
||||
#include <stdint.h>
|
||||
|
||||
extern int32_t _g (uint32_t id, uint32_t maxiter);
|
||||
extern int64_t rollback (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
|
||||
extern int64_t accept (uint32_t read_ptr, uint32_t read_len, int64_t error_code);
|
||||
|
||||
int64_t cbak(uint32_t reserved)
|
||||
{
|
||||
accept(0,0,0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int64_t hook(uint32_t reserved )
|
||||
{
|
||||
rollback (0,0,0);
|
||||
_g(1,1); // every hook needs to import guard function and use it at least once
|
||||
// unreachable
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user