Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Request: Please Add the way to get st0 and others as a Function<> result #2

Open
rspforhp opened this issue Aug 28, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@rspforhp
Copy link

rspforhp commented Aug 28, 2023

In ida a function i have saves its return value in the st0 which i dont seem to be able to get from calling a function at the moment, i would like it to be possible to specify the result location for it too

@rspforhp rspforhp added the enhancement New feature or request label Aug 28, 2023
@Sewer56 Sewer56 transferred this issue from Reloaded-Project/Reloaded-II Aug 28, 2023
@Sewer56
Copy link
Member

Sewer56 commented Aug 28, 2023

I moved this to Reloaded.Hooks-rs, since the hooks library will (eventually) be ported to Rust.

Most of the work here is done, however when I finish will depend on my health (right now I have not been feeling well) and whenever I finish updating CriFsV2Hook (bug needs fixing in new implementation). [I temporarily paused working on this to improve the CRI stuff which was long overdue]

This new Rust WIP port already supports some extra functionality such as arbitrary float registers in parameters (original only did not registers for custom call conventions). I don't see why I couldn't support return via float register.

@Sewer56
Copy link
Member

Sewer56 commented Aug 28, 2023

By the way thanks for this issue report; I've never seen an optimized function return in x87 register, so it's good to know it can happen.

@rspforhp
Copy link
Author

will it be in the c# library too? just got confused with ur wording here

@Sewer56
Copy link
Member

Sewer56 commented Aug 29, 2023

What I'll do is I'll make C exports and do 2 things.

  • A new C based API (entirely new).
  • Wrapper for old Reloaded.Hooks, which translates old API into new API. [i.e. Translate whatever's in Reloaded.Hooks.Definitions and use new API transparently under the hood]

The second one is particularly important because the DLL size (estimated ~500KB) improvements and startup size improvements (~60-80ms) compared to R2R Reloaded.Hools are pretty significant.

When doing the wrapper from old to new API, I can just extend the old API's register enum, since this would be a trivial, non-breaking.change. No big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants