HelpWould this works ?

Posts 1–15 of 19 · Page 1 of 2
Would this works ?
I hope anyone know C# enought to decide, if this would work or not:

Code:
static unsafe bool bCompare(byte* pData, byte bMask, char szMask)
        {
            for (; szMask != 0; ++szMask, ++pData, ++bMask)
                if ((szMask != '?') && (szMask == 'x' && *pData != bMask))
                    return false;
            return true;
        }

  static unsafe IntPtr FindPattern(IntPtr dwAddress, IntPtr dwLen, byte[] bMask, char[] szMask)
  {
       bool Return = false;
       for (int i = 0; i < (int)dwLen; i++)
       {
           for (int j = 0; j < bMask.Length; j++)
           {
              Return = Return && bCompare((byte*)(dwAddress + i), bMask[j], szMask[j]);
           }
           if (Return)
               return (IntPtr)(dwAddress + i);
       }
       return (IntPtr)0;
   }
I dont think it will work, anyways .. i pmed you a class for it
Quote Originally Posted by ARGB View Post
I dont think it will work, anyways .. i pmed you a class for it
Code:
public static unsafe IntPtr FindPattern(IntPtr StartAddress, int Length, byte[] Pattern, string Mask)
        {
            MenuForm.Console.Items.Add("Create Allocated Array");
            byte[] Dump = new byte[Length];

            //Create a Dump of the process
            MenuForm.Console.Items.Add("Dumping Process");
            for (int i = 0; i < Length; i++)
            {
                Dump[i] = *(byte*)(StartAddress + i);
            }

            MenuForm.Console.Items.Add("Scanning Pattern");
            //Scan for the pattern
            for (int i = 0; i < Length - Pattern.Length; i++)
            {
                bool Found = true;
                for (int k = 0; k < Pattern.Length; k++)
                {
                    Found = Found & (Dump[i + k] == Pattern[k]) && (Mask[k] == 'x');
                }
                if (Found)
                {
                    Dump = new byte[0]; //Free Up the Dump Memory
                    return (IntPtr)i; //Return the specified Address
                }
            }
            Dump = new byte[0]; //Free Up the Dump Memory
            return (IntPtr)0; //Pattern not found, return 0
            MenuForm.Console.Items.Add("Done");
        }
Code:
PatternScanner.FindPattern(MainClass.CShell, 0xFFFFFF, new byte[] { 0x8B, 0x4F, 0x04, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x85, 0xC0, 0x8B, 0x51, 0x04, 0x8B, 0x6A, 0x04 }, "xxxx????xxxxxxxx");
IDK If the method, or the pattern is wrong, but gives back 0... (WeaponMgr Pattern)
Or the "int" is too small... I should use a bigger one...
Quote Originally Posted by rabir007 View Post


Code:
public static unsafe IntPtr FindPattern(IntPtr StartAddress, int Length, byte[] Pattern, string Mask)
        {
            MenuForm.Console.Items.Add("Create Allocated Array");
            byte[] Dump = new byte[Length];

            //Create a Dump of the process
            MenuForm.Console.Items.Add("Dumping Process");
            for (int i = 0; i < Length; i++)
            {
                Dump[i] = *(byte*)(StartAddress + i);
            }

            MenuForm.Console.Items.Add("Scanning Pattern");
            //Scan for the pattern
            for (int i = 0; i < Length - Pattern.Length; i++)
            {
                bool Found = true;
                for (int k = 0; k < Pattern.Length; k++)
                {
                    Found = Found & (Dump[i + k] == Pattern[k]) && (Mask[k] == 'x');
                }
                if (Found)
                {
                    Dump = new byte[0]; //Free Up the Dump Memory
                    return (IntPtr)i; //Return the specified Address
                }
            }
            Dump = new byte[0]; //Free Up the Dump Memory
            return (IntPtr)0; //Pattern not found, return 0
            MenuForm.Console.Items.Add("Done");
        }
Code:
PatternScanner.FindPattern(MainClass.CShell, 0xFFFFFF, new byte[] { 0x8B, 0x4F, 0x04, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x85, 0xC0, 0x8B, 0x51, 0x04, 0x8B, 0x6A, 0x04 }, "xxxx????xxxxxxxx");
IDK If the method, or the pattern is wrong, but gives back 0... (WeaponMgr Pattern)
Or the "int" is too small... I should use a bigger one...
You do realize that c# is a managed language, right? Therefore it "cleans up" the memory for you. Also, in a c# application you don't have access to crossfires memory as you are outside of crossfires virtual address space. Idk if you've taken that into consideration or not, but odds are, you're scanning your own process.
Quote Originally Posted by ~FALLEN~ View Post
You do realize that c# is a managed language, right? Therefore it "cleans up" the memory for you. Also, in a c# application you don't have access to crossfires memory as you are outside of crossfires virtual address space. Idk if you've taken that into consideration or not, but odds are, you're scanning your own process.
You are late

1; I made a CLR Injector, so i can inject C# Dll into Crossfire...

2; I finished FindPattern and works well...
Quote Originally Posted by rabir007 View Post


You are late

1; I made a CLR Injector, so i can inject C# Dll into Crossfire...

2; I finished FindPattern and works well...
1. Retarded

2. Alright then. :P

p.s I got about halfway through your signature and got bored as fuck
Quote Originally Posted by ~FALLEN~ View Post
1. Retarded

2. Alright then. :P

p.s I got about halfway through your signature and got bored as fuck
1; You are dumb as fuck
2; And an asshole

p.s: Nobody said that you must read it...
Quote Originally Posted by ~FALLEN~ View Post
1. Retarded

2. Alright then. :P

p.s I got about halfway through your signature and got bored as fuck
His signature is cool!
Quote Originally Posted by rabir007 View Post


1; You are dumb as fuck
2; And an asshole

p.s: Nobody said that you must read it...
wtf?
1. I never said you were retarded, I said injecting a .net dll into an application is retarded.
2. I'm not stupid at all, actually.
3. Excuse me? I'm a very nice person, ask any of my friends.

-edit-
and regarding the signature, I have a short attention span, I wasn't insulting you.
Quote Originally Posted by ~FALLEN~ View Post
wtf?
1. I never said you were retarded, I said injecting a .net dll into an application is retarded.
2. I'm not stupid at all, actually.
3. Excuse me? I'm a very nice person, ask any of my friends.

-edit-
and regarding the signature, I have a short attention span, I wasn't insulting you.
you're both great coders, why are you flaming at each other?
Quote Originally Posted by Barstarzz View Post

you're both great coders, why are you flaming at each other?
Check previous posts...
I wasn't flaming him at all. He's the one that got butthurt and flamed me. Also don't compare me to him, thanks.
btw Injecting a managed ( .net or otherwise ) module into a unmanaged ( native ) application is a horrible idea, they can easily detect you through a variety of different methods, just so you know.
Quote Originally Posted by ~FALLEN~ View Post
I wasn't flaming him at all. He's the one that got butthurt and flamed me. Also don't compare me to him, thanks.
btw Injecting a managed ( .net or otherwise ) module into a unmanaged ( native ) application is a horrible idea, they can easily detect you through a variety of different methods, just so you know.
So i misanderstood you, then sorry...

Also, i'm very shitty with C++ so i prefer using C#...

I know they can detect it, thats why i don't release it, and keep it private hack...
Quote Originally Posted by rabir007 View Post


So i misanderstood you, then sorry...

Also, i'm very shitty with C++ so i prefer using C#...

I know they can detect it, thats why i don't release it, and keep it private hack...
They won't actually need a copy of your managed dll to detect it.
But atm i don't think they do any checks like that so hack away and have fun while you still can.

I also converted FindPattern and bCompare over to c#.
Using it like
Code:
FindPattern(StartingAddress, SearchLength, "0000000000000000000000", "xx????xxxxx");
But i'm gonna do away with szMask (xx????xxxxx) and allow wildcards to be put in the pattern.
Also add VirtualQueryEx so it can scan the entire process and/or a range.
I'll send you a copy if you want.
Quote Originally Posted by Pingo View Post
They won't actually need a copy of your managed dll to detect it.
But atm i don't think they do any checks like that so hack away and have fun while you still can.

I also converted FindPattern and bCompare over to c#.
Using it like
Code:
FindPattern(StartingAddress, SearchLength, "0000000000000000000000", "xx????xxxxx");
But i'm gonna do away with szMask (xx????xxxxx) and allow wildcards to be put in the pattern.
Also add VirtualQueryEx so it can scan the entire process and/or a range.
I'll send you a copy if you want.
I found a way:
-I trashed the C++ FindPattern
-And my my own, with my own logic and hey, it works
Posts 1–15 of 19 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us