Page 2 of 2 FirstFirst 12
Results 16 to 18 of 18
  1. #16
    DecoderBack's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    111
    Reputation
    10
    Thanks
    12
    good job yoda

    C#(.net)/C++ Coder
    Assembly coder [Current learning more]

  2. #17
    yodaliketaco's Avatar
    Join Date
    Jan 2010
    Gender
    male
    Location
    winsock.dll
    Posts
    645
    Reputation
    45
    Thanks
    514
    My Mood
    Tired
    A little bit of an update, I don't know if it works yet, my hack still crashes the game even if I just declare the correct addresses. Please let me know if it works for you.

    The point of this update it to make the function easier to C+P... since pretty much everyone uses the function with the prototype:

    Code:
    DWORD FindPattern(DWORD dwAddress,DWORD dwLen,BYTE *bMask,char *szMask)
    This is my method:

    Includes:

    Code:
    #include <Windows.h>
    #include <string.h>

    And the functions:


    Code:
    #define realAddy( cast, base, offset ) (cast)((DWORD)(base) + (DWORD)(offset))
    bool bExist(BYTE part, BYTE *whole, char *mask)
    {
    	BYTE *start = (BYTE*)(whole + sizeof(whole) - 1);
    	for(DWORD loc = 0; loc < sizeof(whole); loc++)
    		if((*(BYTE*)(start - loc) == part) || (*(mask + (strlen(mask) - 1) - loc) == '?')) return true;
    	return false;
    }
    DWORD lastLocationOfByte(BYTE part, BYTE *whole, char *mask)
    {
    	BYTE *start = (BYTE*)(whole + sizeof(whole) - 1);
    	for(DWORD loc = 0; loc < sizeof(whole); loc++)
    		if((*(BYTE*)(start - loc) == part) || (*(mask + (strlen(mask) - 1) - loc) == '?')) return (sizeof(whole) - loc);
    }
    DWORD FindPattern(DWORD first, DWORD total, BYTE *val, char *mask)
    {
    	size_t next = sizeof(*val);
    	BYTE *addy = (BYTE*)((val + next) - 1);
    	bool exist = false;
    	BYTE *loc;
    	for(DWORD n = (next - 1); n < total;)
    	{
    		DWORD spot;
    		for(spot = 0; (*(unsigned char*)(first + n - spot) == *(unsigned char*)(addy - spot)) || (*(mask + (strlen(mask) - 1) - spot) == '?'); spot++);
    		if(spot == next) return realAddy( DWORD, first, n );
    		else if(bExist(*(BYTE*)(first + n), val, mask))
    			n += lastLocationOfByte(*(BYTE*)(first + n), val, mask);
    		else n += next;
    	}
    	return false;
    }
    Last edited by yodaliketaco; 08-03-2011 at 01:41 PM.

  3. The Following User Says Thank You to yodaliketaco For This Useful Post:

    DecoderBack (08-05-2011)

  4. #18
    DecoderBack's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    111
    Reputation
    10
    Thanks
    12
    i'll test it when i come to my home yoda and i really like your work brother

    C#(.net)/C++ Coder
    Assembly coder [Current learning more]

  5. The Following User Says Thank You to DecoderBack For This Useful Post:

    yodaliketaco (08-04-2011)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. finding and hooking an unknown function
    By JonnyD in forum General Game Hacking
    Replies: 1
    Last Post: 08-26-2010, 06:51 AM
  2. Replies: 8
    Last Post: 07-09-2007, 03:15 PM
  3. Replies: 37
    Last Post: 06-20-2006, 04:24 PM
  4. hi can any1 help me make or find a cheat code
    By CrUsHa in forum WarRock - International Hacks
    Replies: 3
    Last Post: 05-19-2006, 04:39 PM
  5. Where do i find WPE Pro?
    By Rileyman1211 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 01-16-2006, 09:52 AM