extism icon indicating copy to clipboard operation
extism copied to clipboard

request: List all functions

Open milesj opened this issue 5 months ago • 5 comments

Right now we have function_exists but it would be nice if there was a method that listed all functions that have been implemented.

milesj avatar Jul 03 '25 22:07 milesj

hey! we recommend using a separate extism plugin to parse and list the functions exported:

https://github.com/extism/extism/issues/714#issuecomment-2111497547

nilslice avatar Jul 04 '25 15:07 nilslice

Kind of need the functionality at runtime. Can you point to where that code exists so I can take a look at it?

milesj avatar Jul 04 '25 16:07 milesj

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.

nilslice avatar Jul 04 '25 16:07 nilslice

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.

milesj avatar Jul 04 '25 17:07 milesj

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).

nilslice avatar Jul 04 '25 17:07 nilslice