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

How can i use NtOpenProcess with bananaphone #6

Closed
timwhitez opened this issue Feb 18, 2021 · 5 comments
Closed

How can i use NtOpenProcess with bananaphone #6

timwhitez opened this issue Feb 18, 2021 · 5 comments

Comments

@timwhitez
Copy link

How can i use NtOpenProcess with bananaphone

@C-Sto
Copy link
Owner

C-Sto commented Feb 18, 2021

Check out the mkwinsyscall example for (imo) the best way of handling API calls - create a comment with the function in the right format, and then generate the stub with go generate. The function is publicly documented (https://docs.microsoft.com/en-us/windows-hardware/drivers/ddi/ntddk/nf-ntddk-ntopenprocess), so it should be easy enough to pick the right parameter types.

@C-Sto
Copy link
Owner

C-Sto commented Feb 2, 2022

OK so apologies - you were encountering a bug that I'm jsut getting to the bottom of now where functions that have a certain number of arguments would make the stub calculate weird stack stuff and get into a unsafe state and crash. I'll reopen this for now - but you appear to have worked around it by adding a zero to the function call. That pushes the stack to the correct length, and is a totally unexpected solution... so congrats?

@C-Sto C-Sto reopened this Feb 2, 2022
@timwhitez
Copy link
Author

lol, i do work it well by adding a zero. wish you get a better solution.

@C-Sto
Copy link
Owner

C-Sto commented Feb 3, 2022

your wish is my command - the issue should be resolved as of 1526021

@C-Sto C-Sto closed this as completed Feb 3, 2022
@timwhitez
Copy link
Author

Awesome!

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