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

I have a reading error #164

Open
BrandForIsFrog opened this issue Jul 16, 2023 · 2 comments
Open

I have a reading error #164

BrandForIsFrog opened this issue Jul 16, 2023 · 2 comments

Comments

@BrandForIsFrog
Copy link

I was trying to find and replace the return value in a float . I was looking for byte arrays. What's the matter?

Small snippet of code:

string norecoil = "00 00 B4 43 DB 0F 49 40 00 00 00 00 F0 B5 03 AF 93 B0 6C 46";
private void NoRecoil_Click(object sender, EventArgs e)
{
int PID = meme.GetProcIdFromName("HD-Player");
if (PID != 0)
{
meme.OpenProcess(PID);
meme.WriteMemory(norecoil, "float", "9999999");

Error:
Error in GetCode(). Failed to read address 00 00 B4 43 DB 0F 49 40 00 00 00 00 F0 B5 03 AF 93 B0 6C 46

@osadrac
Copy link

osadrac commented Jul 16, 2023

you are passing a string from AoB to a function that needs a pointer, without worrying about async your function should be like this.

var norecoil  = (UIntPtr)meme.AoBScan("00 00 B4 43 DB 0F 49 40 00 00 00 00 F0 B5 03 AF 93 B0 6C 46", false, true).FirstOrDefault();

private void NoRecoil_Click(object sender, EventArgs e)
{
     int PID = meme.GetProcIdFromName("HD-Player");
     if (PID != 0)
           return;
     meme.OpenProcess(PID);
     meme.WriteMemory(norecoil, "float", "9999999");
{

reading this part of the wiki will help you.
https://github.com/erfg12/memory.dll/wiki/AoB-Scanning
read the PID only once and store it in a variable for another use.

@BrandForIsFrog
Copy link
Author

I changed everything, but there are errors (

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