Skip to content

Assembly Execution #2949

Answered by ascpixi
SirBrahms asked this question in Q&A
Feb 12, 2024 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

If you know that the calling convention of the function you want to call is the same as IL2CPU's flavor of cdecl, then you should be able to just cast the memory address into a function pointer, and then call that.

If that doesn't work (I'm not sure if IL2CPU actually supports function pointers), you can also try creating a X# plug that does a call into your function of choice. This also allows you to translate between calling conventions (if it's the same as cdecl, then you can just jmp instead).

AuraOS has arbitrary binary execution, so you can take a look at how they implemented it.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@SirBrahms
Comment options

@ascpixi
Comment options

Answer selected by SirBrahms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants