You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the compiler not being able to remove memset or memcpy or any other compiler builtin functions which must not be present in the hook code since it only can contain two functions which are $hook and $cbak, I poked around a lot and found that wasm32-wasi would not include any compiler builtins by default.
Below is the generated code with the target set as wasm32-wasi. Obviously because it doesn't do much, it doesn't have any reasons to insert compiler builtins anyway even if it were wasm32-unknown-unknown. But this is just to illustrate the problem that #![no_main] doesn't work yet for wasm32-wasi target.
So I tried modifying the code into this, effectively just deleting the functions related to the main function call and modifying function indexes (types):
And this will pass the guard checker and be able to successfully run as a hook as well.
But the problem is idk how to remove the main function call with the config. Otherwise I would need to write some simple script using sth like to strip off these functions related to the main function call, since their placement and appearance is quite deterministic (because they don't do anything).
The text was updated successfully, but these errors were encountered:
Due to the compiler not being able to remove
memset
ormemcpy
or any other compiler builtin functions which must not be present in the hook code since it only can contain two functions which are$hook
and$cbak
, I poked around a lot and found thatwasm32-wasi
would not include any compiler builtins by default.Below is the generated code with the target set as
wasm32-wasi
. Obviously because it doesn't do much, it doesn't have any reasons to insert compiler builtins anyway even if it werewasm32-unknown-unknown
. But this is just to illustrate the problem that#![no_main]
doesn't work yet forwasm32-wasi
target.Clearly, the main function is included.
So I tried modifying the code into this, effectively just deleting the functions related to the main function call and modifying function indexes (types):
And this will pass the guard checker and be able to successfully run as a hook as well.
But the problem is idk how to remove the main function call with the config. Otherwise I would need to write some simple script using sth like to strip off these functions related to the main function call, since their placement and appearance is quite deterministic (because they don't do anything).
The text was updated successfully, but these errors were encountered: