Thread: 2 Questions

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    archey's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    2

    2 Questions

    Hello, Everyone.

    I am making a trainer for a single player game, and I have an address i need to NOP, for no reload, how can i NOP an address in C++?

    Also, I want to make an item traine for Fallout 3, is there a way to have a .dll or .exe write commands into the console, such as player.additem <ITEM #> <AMOUNT> ? As I have found a complete list of item #'s.

    Thanks,
    Archey

  2. #2
    Retoxified's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    148
    Reputation
    8
    Thanks
    171
    Quote Originally Posted by archey View Post
    Hello, Everyone.

    I am making a trainer for a single player game, and I have an address i need to NOP, for no reload, how can i NOP an address in C++?

    Also, I want to make an item traine for Fallout 3, is there a way to have a .dll or .exe write commands into the console, such as player.additem <ITEM #> <AMOUNT> ? As I have found a complete list of item #'s.

    Thanks,
    Archey
    Code:
    void PatchMem(LPVOID dwAddress, LPVOID bytes, DWORD dwSize)
    {
    	DWORD flOldProtect = 0;
    	VirtualProtect((void*)dwAddress, dwSize, PAGE_EXECUTE_READWRITE, &flOldProtect);
    	memcpy((void*) dwAddress, bytes, dwSize);
    	VirtualProtect((void*)dwAddress, dwSize, flOldProtect, &flOldProtect);
    }
    BYTE noptwo = {0x90, 0x90};
    LPVOID addy = 0x9403299;
    memcpy(addy, noptwo, 2);
    should work

  3. The Following 2 Users Say Thank You to Retoxified For This Useful Post:

    Void (03-21-2010),why06 (03-21-2010)

  4. #3
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Quote Originally Posted by Retoxified View Post
    Code:
    void PatchMem(LPVOID dwAddress, LPVOID bytes, DWORD dwSize)
    {
    	DWORD flOldProtect = 0;
    	VirtualProtect((void*)dwAddress, dwSize, PAGE_EXECUTE_READWRITE, &flOldProtect);
    	memcpy((void*) dwAddress, bytes, dwSize);
    	VirtualProtect((void*)dwAddress, dwSize, flOldProtect, &flOldProtect);
    }
    BYTE noptwo = {0x90, 0x90};
    LPVOID addy = 0x9403299;
    memcpy(addy, noptwo, 2);
    should work
    Keep in mind this is if you're going to inject your own module. If you plan on making an actual trainer, use WriteProcessMemory/ReadProcessMemory.

    WriteProcessMemory

  5. The Following 2 Users Say Thank You to Void For This Useful Post:

    Retoxified (03-21-2010),why06 (03-21-2010)

  6. #4
    archey's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    2
    This is my current code

    Code:
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    DWORD proc_id;
    HANDLE hProcess;
    
    
    int main()
    {
    HWND hWnd = FindWindow(0, "Modern Warfare 2");
    GetWindowThreadProcessId(hWnd, &proc_id);
    hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, proc_id);
    
    main();
    BYTE Nop[ ] = {(0x90)};
    WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x0108DFB8), &Nop, sizeof(Nop), NULL);	
    }
    It crashes when i run it though, not sure how many 0x90's i need and also not sure which adress to use from cheat engine, i did find out what writes to this address, and i tried using the one highlighted in red, and the one where it says 'the value the pointer need to find this address is probably'

  7. #5
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Hmm, it's possible the address is wrong. Or, if you're NOP'ing an instruction that actually does something ( rather than bytes being read as values ), NOP'ing 1 byte will leave the instruction semi-broken ( it won't do the same thing ) and when it comes time to execute it won't make sense. If you used CE to test this out, try NOP'ing them from there and it's going to show how many bytes it NOP'd.

    Also, why did you use that recursive call after getting the process handle? It never gets to the WriteProcessMemory function.

  8. #6
    archey's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    2
    This is my updates code, i looked in the disassembler and it showed 4 bytes, so i assume i need 4 0x90's? The address i am using seems to be right, as last night when i did write this address in CE, same address showed up in red. Also i found most of this code on the internet on other forums.

    Code:
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    DWORD proc_id;
    HANDLE hProcess;
    
    
    int main()
    {
    HWND hWnd = FindWindow(0, "Modern Warfare 2");
    GetWindowThreadProcessId(hWnd, &proc_id);
    hProcess = OpenProcess(PROCESS_ALL_ACCESS|PROCESS_VM_OPERATION|PROCESS_VM_READ|PROCESS_VM_WRITE|PROCESS_QUERY_INFORMATION, FALSE, proc_id);
    
    main();
    BYTE Nop[ ] = {(0x90, 0x90, 0x90, 0x90)};
    WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x004C6E0D), &Nop, sizeof(Nop), NULL);	
    WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x004C6E0D), &Nop, sizeof(Nop), NULL);	
    WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x004C6E0D), &Nop, sizeof(Nop), NULL);
    WriteProcessMemory(hProcess, (LPVOID*)(DWORD) (0x004C6E0D), &Nop, sizeof(Nop), NULL);
    }

  9. #7
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Did that code work? Remove the 3 last WriteProcessMemory, the first one will write all 4 bytes. Remove the call to 'main' right before BYTE Nop[ ].

  10. #8
    archey's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by Davidm44 View Post
    Did that code work? Remove the 3 last WriteProcessMemory, the first one will write all 4 bytes. Remove the call to 'main' right before BYTE Nop[ ].
    Okay did those two things compiled fine, didnt crash when i ran it, but when i go into game, then shoot game crashes

  11. #9
    Retoxified's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    148
    Reputation
    8
    Thanks
    171
    what is it ur trying to do? xD

  12. #10
    archey's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by Retoxified View Post
    what is it ur trying to do? xD
    NOP an address in MW2 single player, for no reload As i am new to trainer making im starting wiht something easy, just for some reason it crashes the game when i try shoot now (see my above post)

  13. #11
    Retoxified's Avatar
    Join Date
    Feb 2010
    Gender
    male
    Posts
    148
    Reputation
    8
    Thanks
    171
    Quote Originally Posted by archey View Post
    NOP an address in MW2 single player, for no reload As i am new to trainer making im starting wiht something easy, just for some reason it crashes the game when i try shoot now (see my above post)
    You sure the addy is correct?

  14. #12
    archey's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by Retoxified View Post
    You sure the addy is correct?
    It should be, not sure how to tell.

  15. #13
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Quote Originally Posted by archey View Post
    It should be, not sure how to tell.
    NOP it with CE or olly, if it doesn't work there, you have to find another method of making no reload.

    Why not find the instruction that decreases the number of bullets, and NOP it. I believe it would look something like:
    [php]
    mov [ebx],eax
    [/php]

    EAX being -1 or something.

    CE has that 'Find out what accesses/writes to this address', find the address that holds the number of bullets you have, and use that feature on the address found.

  16. #14
    archey's Avatar
    Join Date
    Mar 2010
    Gender
    male
    Posts
    48
    Reputation
    10
    Thanks
    2
    Quote Originally Posted by Davidm44 View Post
    NOP it with CE or olly, if it doesn't work there, you have to find another method of making no reload.

    Why not find the instruction that decreases the number of bullets, and NOP it. I believe it would look something like:
    [php]
    mov [ebx],eax
    [/php]

    EAX being -1 or something.

    CE has that 'Find out what accesses/writes to this address', find the address that holds the number of bullets you have, and use that feature on the address found.
    Yeah i have NOPed it before

  17. #15
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    Quote Originally Posted by archey View Post
    Okay did those two things compiled fine, didnt crash when i ran it, but when i go into game, then shoot game crashes
    Might not work just noping:
    1. the function could return value that needs to be checked so ur game is failing (doubt it)

    2. Most likely you are only noping 4 bytes and you need to nop 5 bytes. That means noping the opcode that call the address your noping. Other wise your still left with a call instruction, but with no address to call. =/

    EDIT: If you could post the disassembly ur looking at we could probably make the right judgment.
    Last edited by why06; 03-21-2010 at 03:14 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

Page 1 of 2 12 LastLast

Similar Threads

  1. WPE Pro Question...
    By OutZida in forum General Game Hacking
    Replies: 4
    Last Post: 08-08-2011, 01:02 AM
  2. Hacking world of warcraft? & a noob question
    By arsholio in forum General Game Hacking
    Replies: 9
    Last Post: 04-08-2006, 01:55 PM
  3. Photoshop Question
    By arunforce in forum Art & Graphic Design
    Replies: 6
    Last Post: 01-15-2006, 11:38 AM
  4. Quick Question..Please Answer
    By ypg_gamer in forum WarRock - International Hacks
    Replies: 4
    Last Post: 01-04-2006, 10:32 AM
  5. question
    By wardo1926 in forum WarRock - International Hacks
    Replies: 0
    Last Post: 12-30-2005, 07:36 PM