+ Reply to Thread
Page 1 of 2 1 2 LastLast
Showing results 1 to 20 of 30

Thread: Tutorial help

  1. #1

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default Tutorial help

    I read the tutorial "Making Hacks in C++". I'm wondering if someone could make a small program to use those functions in action. I'm somewhat new to C++ and I'm having trouble following the pseudo code in the tutorial.

    BTW thanks for tutorial ;)

  2. #2
    ?▪▫▪ PaRaNoiA EvOlUtIoN ▪▫▪? Senior Member

    Messiah
    Dr. Silence is a glorious beacon of light Dr. Silence is a glorious beacon of light Dr. Silence is a glorious beacon of light Dr. Silence's Avatar
    Join Date
    Jun 2004
    Location
    Dumpster (bearcave)
    Posts
    8,962

    Default

    I woud help but.... dam im bad at excuses..

    meh without giving away crap here are some key word that google may be nice with

    asm is assembly

    it's raw cpu code

    if you ever get into game cracking
    you'll read alot about NOP

    and other 3 letter acronyms

    they're the cpu code

    hex workshop

    WDASM

    soft ice ..... which is a **** to install, because it sits in the shell, like between windows and the cpu you'll need to understand hex
    and what breaks are
    Last edited by Silence : 11-22-2004 at 12:43 PM
    Silence, your signature is to fuking big, next time you do this your signature will be disabled.
    <3 LCS

    [/QUOTE]

    d2V.

  3. #3
    Arbiter Senior Member
    Retired Staff Member

    Blessed
    TheTempest is a glorious beacon of light TheTempest is a glorious beacon of light TheTempest is a glorious beacon of light TheTempest's Avatar
    Join Date
    Apr 2004
    Posts
    2,086

    Default

    Quote Originally Posted by Silence
    if you ever get into game cracking
    you'll read alot about NOP
    only if you're not any good ;)

    My signature is back!! Hell YES!

    Click the link, I DEMAND YOU! :-D
    http://www.bwhacks.com/forums/showthread.php?t=24873

  4. #4

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    I would like a simple program that demonstrates WriteProcessMemory() OpenProcess() and GetWindowThreadProcessId(); preferably on Starcraft. I don't need help with assembly or SoftIce and I know what a NOP instruction is =/.

  5. #5
    Bass > Guitar Retired Staff Member

    Enlightened
    Fish Beans is just really nice Fish Beans is just really nice Fish Beans's Avatar
    Join Date
    Jul 2004
    Location
    Hell, Alabama
    Posts
    3,006

    Default

    I specifically made the tutorial somewhat cryptic so those who wanted to use it would actually need to learn a bit of C++. Nothing in there is that hard, just go read some beginner tutorials and try to piece it all together.
    This space still for rent.

  6. #6
    Senior Member
    Moderator

    Inquisitor
    SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder has a reputation beyond repute SC_Modder's Avatar
    Join Date
    Nov 2004
    Posts
    4,836
    Blog Entries
    1

    Default

    I tried piecing stuff together, but I drove myself crazy trying to figure out which variable type to declare everything. Anyone want to point those out for me?

  7. #7
    ?▪▫▪ PaRaNoiA EvOlUtIoN ▪▫▪? Senior Member

    Messiah
    Dr. Silence is a glorious beacon of light Dr. Silence is a glorious beacon of light Dr. Silence is a glorious beacon of light Dr. Silence's Avatar
    Join Date
    Jun 2004
    Location
    Dumpster (bearcave)
    Posts
    8,962

    Default

    One thing, dont make your hacks dll style........ takes ages ( :( )
    Silence, your signature is to fuking big, next time you do this your signature will be disabled.
    <3 LCS

    [/QUOTE]

    d2V.

  8. #8

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    I'm not asking for a spoon feeding just something to jump start with. The best tutorials give examples to employ.

    There really aren't any good C++ tutorials online and most don't go beyond console programming (loops, arrays, ect.) and basic win32 programming. Some tutorials are outdated and some mix regular C with C++. Still others mix and match compilers. Worse of all are the books that talk to you like you're an MIT grad. Another obfuscated tutorial by itself isn't helping ^(-.-)^

    And silence, no offense, but you are way off topic. Nobody is talking about assembly, softice, or dll's in the thread.

  9. #9
    Administrator

    Saint
    llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod has a reputation beyond repute llafnwod's Avatar
    Join Date
    Jul 2004
    Posts
    6,020

    Default

    Quote Originally Posted by NoFinalTruth
    I'm not asking for a spoon feeding just something to jump start with. The best tutorials give examples to employ.

    There really aren't any good C++ tutorials online and most don't go beyond console programming (loops, arrays, ect.) and basic win32 programming. Some tutorials are outdated and some mix regular C with C++. Still others mix and match compilers. Worse of all are the books that talk to you like you're an MIT grad. Another obfuscated tutorial by itself isn't helping ^(-.-)^
    Get a good C++ book. You don't need much in-depth knowledge to follow Fish Beans' tutorial, just the bare basics. You will also end up learning other aspects of C++ while reading a book (as opposed to someone clarifying for you) which are very useful outside of hacking and, when you get better, in game hacking as well.
    NEWS YOU CAN USE. IF YOU CHOOSE NOT TO USE THIS NEWS YOU WILL BE KILLED.

  10. #10

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    Well, I went looking at different tutorials and I put together this program. I'm trying to change my minerals to 100 (brood war). Clearly I'm new to C++ and this isn't working so can someone help me?

    Code:
    #include "stdafx.h"
    #include <windows.h>
    #include <string.h>
    
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
        LPSTR lpCmdLine, int nCmdShow)
    {
    
    HWND windowHandle;
    LPDWORD pid;
    DWORD pid2;
    HANDLE processHandel;
    bool wpm;
    int DataToWrite;
    DataToWrite = 100;
    
    windowHandle = FindWindow(NULL,"Brood War");
    
    pid2 = GetWindowThreadProcessId(windowHandle,pid);
    
    
    processHandel = OpenProcess( PROCESS_ALL_ACCESS, 0, pid2 );
    
    wpm = WriteProcessMemory(processHandel,(void*)0x004FD4A4,&DataToWrite,4,NULL);
    
    }

  11. #11
    Retired Staff Member

    High Priest
    nickolay is just really nice nickolay is just really nice
    Join Date
    Mar 2004
    Location
    Marietta, Ga
    Posts
    1,711

    Default

    There is no need to store the return value of GetWindowThreadProcessId. You need to use the second parameter of it when calling OpenProcess instead of its return value. Simply change OpenProcess(PROCESS_ALL_ACCESS, 0, pid2); to OpenProcess(PROCESS_ALL_ACCESS, 0, *pid);. You need to use the indirection operator (*) here, because the variable type of pid is LPDWORD, a pointer to a dword, and OpenProcess doesn't need the address of it (pid), but the actual value (*pid).

    edit: typo
    Last edited by nickolay : 11-29-2004 at 03:25 AM

  12. #12

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    I made the changes to the program including setting pid to NULL, and the following code builds just fine:

    Code:
    #include "stdafx.h"
    #include <windows.h>
    #include <string.h>
    
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
        LPSTR lpCmdLine, int nCmdShow)
    {
    
    HWND windowHandle;
    LPDWORD pid = NULL;
    HANDLE processHandel;
    int DataToWrite;
    DataToWrite = 100;
    
    windowHandle = FindWindow(NULL,"Brood War");
    
    GetWindowThreadProcessId(windowHandle, pid);
    
    processHandel = OpenProcess(PROCESS_ALL_ACCESS,0,*pid);
    
    WriteProcessMemory(processHandel,(void*)0x004FD4A4,&DataToWrite,4,NULL);
    
    }
    When I debug the program I get the following error:
    Code:
    An unhandled exception of type 'System.NullReferenceException' occurred in man.exe
    
    Additional information: Object reference not set to an instance of an object.
    The compiler points to the following line:

    processHandel = OpenProcess(PROCESS_ALL_ACCESS,0,*pid);

    and says *pid is null which I'm assuming means something is wrong with the prior function. what am I missing?

    Thanks for help ;)

  13. #13
    F7 F1EF Senior Member
    Retired Staff Member

    Crusader
    bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me's Avatar
    Join Date
    Jun 2004
    Location
    Torreón, Coah. México
    Posts
    3,317
    Blog Entries
    1

    Default

    LPDWORD *pid; //<-- use this

  14. #14

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    nm that didnt see the *

  15. #15

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    error C2664: 'GetWindowThreadProcessId' : cannot convert parameter 2 from 'LPDWORD * ' to 'LPDWORD'

    error C2664: 'OpenProcess' : cannot convert parameter 3 from 'LPDWORD' to 'DWORD'

    don't think that will work =/

  16. #16
    F7 F1EF Senior Member
    Retired Staff Member

    Crusader
    bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me's Avatar
    Join Date
    Jun 2004
    Location
    Torreón, Coah. México
    Posts
    3,317
    Blog Entries
    1

    Default

    Code:
    DWORD pid; //change var type
    
    
    
    GetWindowThreadProcessId(windowHandle, &pid); // add the &
    processHandel = OpenProcess(PROCESS_ALL_ACCESS,0,pid);
    Should work now ;)

  17. #17

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    SWEET! it worked and it also worked on BW. Thanks guys. Learned how to use API's and make windows in the process.

    Heres the working code for anyone that wants it:
    Code:
    #include "stdafx.h"
    #include <windows.h>
    #include <string.h>
    
    
    int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, 
        LPSTR lpCmdLine, int nCmdShow)
    {
    
    HWND windowHandle;
    DWORD pid;
    HANDLE processHandel;
    int DataToWrite;
    DataToWrite = 100;
    
    windowHandle = FindWindow(NULL,"Brood War");
    
    GetWindowThreadProcessId(windowHandle, &pid);
    
    processHandel = OpenProcess(PROCESS_ALL_ACCESS,0,pid);
    
    WriteProcessMemory(processHandel,(void*)0x004FD4A4,&DataToWrite,4,NULL);
    
    }

  18. #18
    F7 F1EF Senior Member
    Retired Staff Member

    Crusader
    bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me has much to be proud of bulk_4me's Avatar
    Join Date
    Jun 2004
    Location
    Torreón, Coah. México
    Posts
    3,317
    Blog Entries
    1

    Default

    Keep the good work!

    P.S: Trolls bitching that BWHacks staff dont help people you can now STFU!!

  19. #19

    Heretic
    NoFinalTruth is on a distinguished road
    Join Date
    Nov 2004
    Posts
    29

    Default

    The parts I did myself actually took me a long time. Theres a good API tutorial that I used to figure most of it out: http://www.winprog.org/tutorial/index.html

    Compiler helped me with the variable types and I serfed the web for solutions to the error messages.

  20. #20
    Retired Staff Member

    High Priest
    nickolay is just really nice nickolay is just really nice
    Join Date
    Mar 2004
    Location
    Marietta, Ga
    Posts
    1,711

    Default

    The reason it didn't work with the fix I suggested was because you initialized pid to NULL. Had you not done so, it would have worked as intended. Pid is a pointer, so you should not set it to NULL if you expect a function to access the data it points to. Initializing it with *pid = NULL; would have been the correct way of doing so. Also, including string.h is unnecessary.

+ Reply to Thread
Page 1 of 2 1 2 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Advanced: Name Spoofer Tutorial
    By OverFlow636 in forum Hacking Tutorials
    Replies: 5
    Last Post: 01-25-2010, 02:09 PM
  2. Gamehacking tutorial
    By NickF in forum Starcraft/Brood War
    Replies: 85
    Last Post: 01-08-2008, 10:37 PM
  3. Paint Filter Tutorial
    By LCSBSSRHXXX in forum Graphics and Arts
    Replies: 5
    Last Post: 04-04-2005, 02:11 AM
  4. Need tutorial to get started that doesnt ask for TMK
    By Saint(305) in forum Starcraft/Brood War
    Replies: 0
    Last Post: 09-17-2004, 04:13 PM

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts