Showing results 1 to 14 of 14

Thread: problem in coding hack program

  1. #1
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default problem in coding hack program

    howdy?
    I'm interested about making hack program using C language.

    I have a problem using C(compiler: Dev-C++(=mingw gcc)).
    I don't know about using WinAPI(as if it's used in C), so i can't understand WinAPI hack source code such as BwAPI Source.
    so I googled(?) and found a helpful(even if i can't use) ersource like this:
    [quota]
    0057F0D8 Minerals (4 * 12)
    0057F108 Gas (4 * 12)
    0057F138 Gas Score (4 * 12)
    0057F168 Mineral Score (4 * 12)

    [/quota]
    i think '0x0057F0D8' is address, so I code it:


    #include <stdio.h>
    #include <windows.h>

    #define M_DEF 0x0057F0F0
    #define G_DEF 0x0057F120

    int main()
    {
    unsigned int *p_m[8], *p_g[8];
    int i;

    for (i=0; i<8; i++)
    {
    p_m[i] = M_DEF + i*4;
    p_g[i] = G_DEF + i*4;
    }

    while(1)
    {
    system("cls");

    for (i=0; i<8; i++)
    printf("%d : %d(%p) | %d(%p) \n", i+1, **(p_m+i), p_m[i], **(p_g+i), p_g[i]);
    }

    return 0;
    }



    and I'm hit by JIT Debugger error message TT
    so I want to get help for you.



    What I want to ask for you is ---
    1) (After looking that trash code(........)) what should i do? how can i use code about '0057F0D8'?
    2) At first I planned my program to use multiplay(not Battle.net, UDP). then would I use this like now?


    Sorry for you, but I'm korean, so I can't use english. just a little.
    please give me your help ;_;



    ----------
    p.s.
    I can't use any of other language - like Assembly, python, ruby, etc.
    but I can use LITTLE - VB, C++(thanks to C?).

    I want to make my program with my own hand, but i have no ability(?) to make it. so I want you to show example source code using C. T_T
    Last edited by MarniTto : 11-28-2009 at 12:11 AM

  2. #2

    Default

    A korean that hacks...?
    Now ive seen everything.

  3. #3
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default ah?

    Quote Originally Posted by fire1337-fire1337 View Post
    A korean that hacks...?
    Now ive seen everything.
    What I know about hack made by korean is, really, REALLY SELDOM korean can make hack and most those people's level is script kiddies --- can imitate other's code but can't make own code ---, so I want to get help HERE.

    I can read english, but can't speak well, so plz help me even if it's written by English T-T


    p.s.
    should I learn about assembly?..

  4. #4

    Default

    I can type in korean, so if you have any trouble reading anything here, just PM me.

  5. #5
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default

    I really appreciate about your kindness! Thank you!
    But I want to communicate more people regardless of language or ability(?).

    so I'll post korean if I can't express well, and english if I can.


    hm.. i'll search and try to get a good information

  6. #6
    =) Senior Member
    Developer

    Supreme Being
    K? Pŕo?ćtiόnŹ's Avatar
    Join Date
    Oct 2004
    Posts
    11,794

    Default

    Code:
    int main(int argc, char *argv[])
    {
      unsigned int starcraft_minerals[]={0,1,2,3,4,5,6,7,8,9,10,11};
      unsigned int *inourdll_minerals;
      inourdll_minerals=starcraft_minerals;//RIGHT HERE is where you would put 0x0057F0D8
      
      inourdll_minerals[5]=100;
      
      printf("Player 6 has %u minerals.\n",starcraft_minerals[5]);
      
      system("PAUSE");	
      return 0;
    }
    And this method would have to be used inside of Starcrafts process, otherwise you'll most likely have to be using ReadProcessMemory or the like. And from the looks of it you're not inside Starcrafts process.
    Last edited by K? Pŕo?ćtiόnŹ : 11-28-2009 at 04:19 PM
    Quote Originally Posted by Voice Of Korhal View Post
    Let us hope so, if that Reverse Engineering crap actually works, I'll be amazed.

  7. #7
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default

    I'm really happy to get help ^0^/
    and now I searched MSDN and type some code like this....

    Code:
    #include <stdio.h>
    #include <windows.h>
    
    int main()
    {
        HWND hWnd;
        DWORD dwID=0;
        HANDLE hProcess;
        DWORD dwVar=0;
        int i;
        
        hWnd = FindWindow(NULL, STAR_WINDOW);
        if (!hWnd)
        {
            perror("windows not found.");
            return 0;
        }
        
        GetWindowThreadProcessId(hWnd, &dwID);
        hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, dwID);
    
        for (i=0; i<12; i++)
        {
            ReadProcessMemory(hProcess, (LPVOID)(0x57F0D8+i*4), (LPVOID)&dwVar, 4, NULL);
            printf("Read value(p%0.2d) : %u, is it correct?\n", i+1, dwVar);
        }
        return 0;
    }
    but every return value(dwVar) is 0 T-T
    what would I do?


    ----------------

    add.
    I've try to code like this(named 'step_2')

    Code:
    #include <stdio.h>
    int main(int argc, char *argv[])
    {
        unsigned int starcraft_minerals[]={0,1,2,3,4,5,6,7,8,9,10,11};
        unsigned int *inourdll_minerals;
        int i;
    
        inourdll_minerals = (unsigned int *)0x57F0D8;    
    
        for (i=0; i<12; i++)
        {
            printf("Player %d has %u minerals.\n", i+1, inourdll_minerals[i]);
        }
    
        system("PAUSE");	
        return 0;
    }
    and program was exited with error[.........]

    I want to use first code... hm[.
    Last edited by MarniTto : 11-29-2009 at 03:52 AM

  8. #8
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default

    I used function GetLastError() and found a problem --- I think if I fix it, I can do well ---;

    code is:
    Code:
     hProcess = OpenProcess(PROCESS_VM_READ, 0, dwID);
    and GetLastError() returns 0x5 - it means 'You've no permission to use it'.
    but MSDN said that this is the minimum permission to use ReadProcessMemory().

    hm... how can I conquer it?.

  9. #9

    Evangelist
    -187-'s Avatar
    Join Date
    Dec 2005
    Location
    Oak Harbor, Washington
    Posts
    1,253

    Default

    Quote Originally Posted by MarniTto View Post
    I used function GetLastError() and found a problem --- I think if I fix it, I can do well ---;

    code is:
    Code:
     hProcess = OpenProcess(PROCESS_VM_READ, 0, dwID);
    and GetLastError() returns 0x5 - it means 'You've no permission to use it'.
    but MSDN said that this is the minimum permission to use ReadProcessMemory().

    hm... how can I conquer it?.
    You have to give your application debug privileges, then you can use it to open SC's process.

    edit:

    I ripped this from a Spoofer I wrote 2 years back...

    Code:
    	HANDLE hToken;
    	TOKEN_PRIVILEGES oldtp;
    	DWORD dwSize;
    	HANDLE hProc;
    	LUID luid;
    	TOKEN_PRIVILEGES tp;
    
    	hProc = GetCurrentProcess();
    
    	if (!OpenProcessToken(hProc, TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES, &hToken))
    	{
    		return 0;
    	}
    
    	if (!LookupPrivilegeValue(NULL, SE_DEBUG_NAME, &luid))
    	{
    		CloseHandle(hToken);
    		return 0;
    	}
    	
    	ZeroMemory(&tp, sizeof (tp));
    
    	tp.PrivilegeCount = 1;
    	tp.Privileges[0].Luid = luid;
    	tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
    
    	if (!AdjustTokenPrivileges(hToken, FALSE, &tp, sizeof(TOKEN_PRIVILEGES), &oldtp, &dwSize))
    	{
    		CloseHandle(hToken);
    	}
    
    	hwnd = FindWindow(L"SWarClass", NULL);
    
    	if (!hwnd)
    	{
    		printf("Could not find Starcraft or Brood War window\n");
    		system("pause");
    		return 0;
    	}
    
    	GetWindowThreadProcessId(hwnd, &procID);
    	pHandle = OpenProcess(PROCESS_ALL_ACCESS, 0, procID);
    
    	if (!pHandle)
    	{
    		printf("Could not open Starcraft or Brood War's Process\n");
    		system("pause");
    		return 0;
    	}

  10. #10

    Default

    Holy **** what the **** am I seeing here, geek porn?

  11. #11
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default

    Thank you -187-, your precious source make my program almost normal!
    like your advise, I modify my code, and successfully get a privilege. That's pretty good.

    hmmm I think just one huddle is in front of me..

    I'll try to find NEW ADDRESS CODE - I think it's wrong..



    Thank you everyone, your kindness makes me toddle and walk
    Last edited by MarniTto : 11-29-2009 at 03:35 AM

  12. #12
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default

    Quote Originally Posted by Sparkle View Post
    Holy **** what the **** am I seeing here, geek porn?
    umm, sorry, I don't get it. What it means?
    if that means I said that pron message, I didn't. Is "What the hell" porn? ...

  13. #13
    Mortal
    Join Date
    Nov 2009
    Location
    South Korea
    Posts
    9

    Default

    I think I'm successfully made my program!

    My discussion is right. Mineral code isn't 0x57F0D8
    http://img510.imageshack.us/img510/1...2009201202.png <- that's result


    :D THANK YOU FOR EVERYONE!!! If I can help something at here, I'll help everything I can do! >_<)//
    Last edited by MarniTto : 11-29-2009 at 03:55 AM

  14. #14
    =) Senior Member
    Developer

    Supreme Being
    K? Pŕo?ćtiόnŹ's Avatar
    Join Date
    Oct 2004
    Posts
    11,794

    Default

    Hey, gj.
    Quote Originally Posted by Voice Of Korhal View Post
    Let us hope so, if that Reverse Engineering crap actually works, I'll be amazed.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [Starcraft] Race Changer 1.00
    By nano351 in forum Old downloads
    Replies: 80
    Last Post: 06-04-2008, 07:33 PM
  2. Yay, ggnormhs
    By Cantinflas in forum General Chat
    Replies: 16
    Last Post: 05-23-2008, 03:25 PM
  3. [Starcraft] Real-time Ownage Hack v5.18.8
    By AgentGOD in forum Old downloads
    Replies: 24
    Last Post: 12-17-2007, 04:01 PM
  4. Hacks On Loaders
    By whodiszbee in forum Hardware and Software
    Replies: 8
    Last Post: 08-17-2004, 05:03 AM

Posting Rules

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