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

Allow C#-side nint functions to be called with Lua numbers #507

Open
s5bug opened this issue Dec 1, 2023 · 2 comments
Open

Allow C#-side nint functions to be called with Lua numbers #507

s5bug opened this issue Dec 1, 2023 · 2 comments

Comments

@s5bug
Copy link

s5bug commented Dec 1, 2023

How do I modify a Lua state such that it can translate Lua numbers into nints?

public uint ReadInt(nint address, bool absolute = false) {
    return Read<uint>(address, absolute);
}
local input = ReadInt(0x29F89B0-0x56450E) -- invalid call according to NLua
@viniciusjarina
Copy link
Member

Why not use long and cast to nint in the C# side ?

@s5bug
Copy link
Author

s5bug commented Dec 1, 2023

That is what I'm doing for now, but it doesn't properly reflect the actual behavior of the functions. These are functions that read and write to raw process memory.

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

No branches or pull requests

2 participants