Mizzle420420 (11-05-2014)
How do i add a offset of 30 to this address im baffled 687138C8.
I want to change this bit here v to this address <687138C8> with the offset of 30.
if(!ReadProcessMemory(hprocess, (void *)0x6EC3F940, (void *)&lua, sizeof(lua), NULL)) {
And make it so this write works.this address is shity no static address 6EC3F940.
if(!WriteProcessMemory(hprocess, (void *)0x6EC3F940, &luamore, (DWORD)sizeof(luamore), NULL)) {
Some body help
it gets the value and sets it to 1 or what ever i have luamore set to but i need to add a offset so i can use a permanent address
https://imgur.com/s7sjwvM,W7DCbQz
// sc2min.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <Windows.h>
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << "Mpgh.\n\n";
HWND sc2window = FindWindow(0, _T("mpgh"));
HANDLE hprocess;
DWORD pid;
int lua;
int luamore = 1;
if(!sc2window) {
cout << "mpgh not found";
} else {
GetWindowThreadProcessId(sc2window, &pid);
hprocess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
if(!hprocess) {
cout << "Couldnt open process";
} else {
if(!ReadProcessMemory(hprocess, (void *)0x6EC3F940, (void *)&lua, sizeof(lua), NULL)) {
cout << "Failed to read memory";
} else {
cout << "Value found: " << lua << "\n\n";
if(!WriteProcessMemory(hprocess, (void *)0x6EC3F940, &luamore, (DWORD)sizeof(luamore), NULL)) {
cout << "failed to write memory";
} else {
cout << "mpgh.\n\n";
if(!ReadProcessMemory(hprocess, (void *)0x6EC3F940, (void *)&lua, sizeof(lua), NULL));
cout << "Value = " << lua << "\n\n";
}
}
}
}
CloseHandle(hprocess);
cout << "Completed sucessfully.";
cin.get();
return 0;
}
Last edited by penis922; 11-01-2013 at 09:57 PM.
Mizzle420420 (11-05-2014)
huh? is 0x63C3F940 a pointer? ie. the value stored there is another address?
Then rpm() and store that value, then add 30? Not sure what you mean.
Assuming success, after that point lua will hold the value that was stored there. (An address?)Code:if(!ReadProcessMemory(hprocess, (void *)0x6EC3F940, (void *)&lua, sizeof(lua), NULL))
lua += 30; // add offset to the value we read
WriteProcessMemory(_handle,(void*) lua, *****)
?
Last edited by abuckau907; 11-01-2013 at 08:00 PM.
'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
--
everything runs fine like it will set the value to 1 or what ever i change luamore to but i cant figure out how to add ofsets for the pointer.
im very new to this but 63C3F940 is a non static address of the value i want to change.this here be the permanent address 687138C8 i need to add an offset of 30 to it. its the pointer.
to add an offset, use the + sign? I don't know what you mean?
What data type are you using to store your addresses? void*, DWORD, something else? It probably supports the + operator.
687138C8 == holds the real address, right? And in that specific case, it held the value 63C3F940?
So you need to read 687138C8 and store that value in a variable. Then variableName += offset;
You have to read the value from that address (PTR_BASE), and store it somewhere. In my case, _ptr1. I created a second variable to store the final address, but you could have said _ptr1 += OFFSET_1; and then used _ptr1 instead of _finalAddr. I'm hoping that separating it out piece by piece will help. ?Code:const DWORD PTR_BASE= 0x687138C8 ; const int OFFSET_1 = 0x30; // DWORD _ptr1 = 0; DWORD _finalAdr = 0; ReadProcessMemory(_handle,PTR_BASE, &_ptr1,sizeof(_ptr1),NULL); // _ptr1 will have the addr stored at PTR_BASE _finalAddr = _ptr1 + OFFSET_1; // add the offset WriteProcessMemory(_handle, _finalAddr, ****) // write new value
That what you meant?
Code:const DWORD PTR_BASE= 0x687138C8 ; const DWORD OFFSET_1 = 0x30; // int lua = 0; if(ReadProcessMemory(hprocess, (void *)PTR_BASE, (void *)&lua, sizeof(lua), NULL)) { //lua now has the addr stored in it lua += OFFSET_1; WriteProcessMemory(hProcess, (void*)lua, ***); }
Last edited by abuckau907; 11-01-2013 at 11:20 PM.
'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
--
you did a little typo here DWORD _finalAdr = 0;.
not to worry about that tho i cant figure out how to get this working
i realize what im meant to be doing not but i cant figure out where to put that stuff and how to make it work.
could you try fixing it and pasting it here :l.if not ill try rewriting the whole thing.
i tryed puting this shit in i tryed doing multiple things.
this first bit goes up the top right?
when ever i try adding this stuff it all ways come up with some error cant change dword into lcpvoid or some thing or the other.Code:const DWORD PTR_BASE= 0x687138C8 ; const int OFFSET_1 = 0x30; // DWORD _ptr1 = 0; DWORD _finalAdr = 0;
or cant find _handle idk how to fix this shit.
ReadProcessMemory(_handle,PTR_BASE, &_ptr1,sizeof(_ptr1),NULL); // _ptr1 will have the addr stored at PTR_BASE
_finalAddr = _ptr1 + OFFSET_1; // add the offset
WriteProcessMemory(_handle, _finalAddr, ****) // write new value
Last edited by penis922; 11-02-2013 at 12:58 AM.
Yes, variables have to be declared before you can use them. If that was your question?
If you don't know "where to put the code", I can't help you. I'm sorry my variable names were not the same as your, you should be able to tell what my code was doing and copy it. About the type errors, you could use c-style casts (void*), (LPCVOID), etc.
'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
--
abuckau907 (11-02-2013)