Hpmason / retour-rs

A cross-platform detour library written in Rust
Other
99 stars 18 forks source link

Fastcall #25

Open Alex141642 opened 1 year ago

Alex141642 commented 1 year ago

Hey, i wanted to know if this crate support Borland fastcall detouring? It is a little bit different from C functions, because of the use of eax, edx and ecx.

If not, do you know how to get around it?

Hpmason commented 1 year ago

This library supports Rust's version of the fastcall ABI, but it doesn't seem to be the same as the Borland fastcall ABI (godbolt example which uses ecx, edx, then the stack). On top of that, Rust's fastcall ABI only seems to support 32-bit targets.

This crate does not support arbitrary calling conventions and would require a lot of work, especially getting it to work with the existing API. I would love to see support for such a feature, but I don't know if I have the time to work on it currently. I can try to work on it in parts, or if someone else is able to work on it I'd appreciate the help.

Alex141642 commented 1 year ago

Okay, thanks for the clarification! In my case i never worked on detouring lib, but i can git a try.