Offsets

Posts 1–9 of 9 · Page 1 of 1
Offsets
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
http://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;
}
Quote Originally Posted by penis922 View Post
..
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.

Code:
if(!ReadProcessMemory(hprocess, (void *)0x6EC3F940, (void *)&lua, sizeof(lua), NULL))
Assuming success, after that point lua will hold the value that was stored there. (An address?)

lua += 30; // add offset to the value we read

WriteProcessMemory(_handle,(void*) lua, *****)

?

 
small bug


Is there supposed to be a semi-colon at the end of the IF statement?

if(!ReadProcessMemory(hprocess, (void *)0x6EC3F940, (void *)&lua, sizeof(lua), NULL));
cout << "Value = " << lua << "\n\n";
Quote Originally Posted by abuckau907 View Post
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.

Code:
if(!ReadProcessMemory(hprocess, (void *)0x6EC3F940, (void *)&lua, sizeof(lua), NULL))
Assuming success, after that point lua will hold the value that was stored there. (An address?)

lua += 30; // add offset to the value we read

WriteProcessMemory(_handle,(void*) lua, *****)

?

 
small bug


Is there supposed to be a semi-colon at the end of the IF statement?


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.
Quote Originally Posted by penis922 View Post
.
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;
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
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. ?

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, ***);
}
Quote Originally Posted by abuckau907 View Post
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;
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
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. ?

That what you meant?
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.
Quote Originally Posted by penis922 View Post
.
No, sorry. If you have a question, ask.
Quote Originally Posted by abuckau907 View Post
No, sorry. If you have a question, ask.
i tryed puting this shit in i tryed doing multiple things.
this first bit goes up the top right?
Code:
const DWORD PTR_BASE= 0x687138C8 ;
const int OFFSET_1 = 0x30; // 
DWORD _ptr1 = 0;
DWORD _finalAdr = 0;
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.
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
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.
Quote Originally Posted by abuckau907 View Post
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.
i got it working Some one close the thread please.
Posts 1–9 of 9 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us