extism
extism copied to clipboard
request: List all functions
Right now we have function_exists but it would be nice if there was a method that listed all functions that have been implemented.
hey! we recommend using a separate extism plugin to parse and list the functions exported:
https://github.com/extism/extism/issues/714#issuecomment-2111497547
Kind of need the functionality at runtime. Can you point to where that code exists so I can take a look at it?
This would be executed at runtime - that demo just shows it used via the CLI. you’d load that modsurfer plugin alongside the plugin whose functions you want to list, then call the export used in that CLI demo, passing the target plugin wasm as input.
I don’t think we open sourced that modsurfer parsing code, but it’s wasm32-unknown, so it really doesn’t do anything besides parse.
The issue is that this would run on other peoples computers, so I can't expect them to have certain CLIs available. I'll investigate though.
ha, sorry for using that example — it’s not a CLI. it’s just another extism plugin that I’m demonstrating by using it in the extism CLI.
youd load the modsurfer.wasm plugin like any other plugin at runtime and call that export using the target plugin bytes as input (to list its exports).