Closed innosflew closed 2 years ago
What does the memory at that address look like in Cheat Engine? In the hex display is there a null terminator after the name of the location?
Can you show me the next line of memory too?
The memory address is 7FF60D7CE4F8
and this is what it looks like in Memory Viewer in Cheat Engine:
Here is a bigger pic of it:
Replace all the code from L440 to L473 with this:
char value[1000000];
ReadProcessMemory(handle, (LPVOID) address, value, 1000000, NULL);
if (args.Length() == 4) argv[1] = String::NewFromUtf8(isolate, str.c_str());
else args.GetReturnValue().Set(String::NewFromUtf8(isolate, str.c_str()));
Recompile, and see if that works?
Essentially what it's doing right now is reading 1 character at a time continuously until it finds a null terminator (but this is probably a terrible method), and the 4 lines of code above just try to read 1 million chars at once, but it should include a null terminator. So try that and see if it helps?
By the way, I haven't tested this but hopefully it's directly copy-pastable and works without any errors?
I'm not very well versed in C++ but I modified the file with your suggestion and tried to compile it and it gave me this error:
You aren't compiling it correctly, in the module directory run npm run build32
or npm run build64
.
Oh sorry, I feel stupid now 😅
But anyways, I replaced the code like this:
And I tried to compile, but I got an error:
Oops it's because the code I gave you was wrong, sorry it's because I just typed it out without testing:
char value[1000000];
ReadProcessMemory(handle, (LPVOID) address, value, 1000000, NULL);
if (args.Length() == 4) argv[1] = String::NewFromUtf8(isolate, value);
else args.GetReturnValue().Set(String::NewFromUtf8(isolate, value));
That should hopefully work!
I've since updated the reading/writing of strings, closing the issue for now.
I'm trying to use memory.js to read the in game data, such as location, of Red Dead Redemption 2, to display it in Discord. My only issue is that the same memory addresses stop working at random after a while.
I checked with Cheat Engine to make sure the addresses haven't changed between gaming sessions and from what I've seen they haven't. The addresses I use still display the same values. Memory.js gives me the following error:
At line 42 in my code is the ReadMemory function:
memoryjs.readMemory(handle, address, memoryjs.STRING)