Thread: Offsets

Results 1 to 9 of 9
  1. #1
    penis922's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    216

    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
    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.

  2. The Following User Says Thank You to penis922 For This Useful Post:

    Mizzle420420 (11-05-2014)

  3. #2
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    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, *****)

    ?

     


    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";
    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.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  4. #3
    penis922's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    216
    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, *****)

    ?

     


    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.

  5. #4
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    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, ***);
    }
    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.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  6. #5
    penis922's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    216
    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.

  7. #6
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    Quote Originally Posted by penis922 View Post
    .
    No, sorry. If you have a question, ask.
    'Some things that can be counted, don't matter. And some things that matter, can't be counted' - A.E.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  8. #7
    penis922's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    216
    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
    Last edited by penis922; 11-02-2013 at 12:58 AM.

  9. #8
    abuckau907's Avatar
    Join Date
    Dec 2012
    Gender
    male
    Location
    other side of the wire
    Posts
    1,342
    Reputation
    162
    Thanks
    239
    My Mood
    Cold
    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.
    --
     

    My posts have some inaccuracies/are wrong/wrong keyword(s) used.
    They're (maybe) pretty close, and I hope they helped you, not created confusion. Take with grain of salt.

    -if you give rep, please leave a comment, else it means less.

  10. #9
    penis922's Avatar
    Join Date
    Jul 2013
    Gender
    male
    Posts
    34
    Reputation
    10
    Thanks
    216
    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.

  11. The Following User Says Thank You to penis922 For This Useful Post:

    abuckau907 (11-02-2013)

Similar Threads

  1. need help with offset problem
    By qplazm in forum General Game Hacking
    Replies: 1
    Last Post: 12-31-2008, 01:45 PM
  2. offsets
    By silent1990 in forum Combat Arms Hacks & Cheats
    Replies: 0
    Last Post: 12-03-2008, 06:01 AM
  3. CombatArms addys pointers & offsets?
    By nitro107 in forum Combat Arms Hacks & Cheats
    Replies: 4
    Last Post: 08-20-2008, 05:31 AM
  4. Offset addresses
    By thomtim in forum WarRock - International Hacks
    Replies: 0
    Last Post: 07-22-2008, 02:21 AM
  5. Offsets
    By radnomguywfq3 in forum Visual Basic Programming
    Replies: 2
    Last Post: 09-01-2007, 09:50 AM