Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Pytanie] Pokerstars Bot - Memory Read


Rekomendowane odpowiedzi

Opublikowano

Fakt nie zauwazyłem. Okazuje się, że zmienna jest przechowywana jako text.... i na dodatek zmienia się co jakiś czas na inny adres. Macie jakiś pomysł jak ją znaleźć ?

Opublikowano

przy szukaniu wartości wpisz ją w całości bez przecinka czy kropki

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

Opublikowano

przy szukaniu wartości wpisz ją w całości bez przecinka czy kropki

Tak jak pisałem znalazłem ją. Problem w tym, że zmienna zmienia się w czasie... ląduje pod różnymi adresami.

Opublikowano

Jeśli jej adres zmienia się co jakiś czas, to znaczy, że tekst jest tworzony dynamicznie. Ustaw opcję "Pause game while scanning", żeby wartość się nie zmieniła i znajdź tę wartość. Następnie zobacz, jaka instrukcja instrukcja nadpisuje ten adres i jeśli zmieni się adres tekstu, to w tej instrukcji również adres się zmieni na ten właściwy. (tak sądzę. :P )

Opublikowano

dzienks.

Spam :P

 

 

 

Nie ma za co :]

Odróżniaj się od innych na MPC !

 

 

Wrzuć ten obrazek do sygnaturki:

userbarwb.png

 

 

Link do obrazka:

http://uploadonline.pl/images/userbarwb.png

Opublikowano

taa, zaraportuj administratora że spamuje we własnym temacie dziękując za pomoc :)

 

kokosz , jak będe w domu w najblizszym okresie podrzuce więcej rozwiazań dla gry jak nadal jesteś zainteresowany , hacka raczej nie tworzysz bo się nie da oszukać zabezpieczeń gry :P

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

Opublikowano

taa, zaraportuj administratora że spamuje we własnym temacie dziękując za pomoc :)

 

kokosz , jak będe w domu w najblizszym okresie podrzuce więcej rozwiazań dla gry jak nadal jesteś zainteresowany , hacka raczej nie tworzysz bo się nie da oszukać zabezpieczeń gry :P

Chodzi raczej o czytanie wartości, aby stworzyć interpretator strategii... W chwili obecnej mam na to sposób, ale nie jest wydajny. Zmienam temat na bardziej odpowiedni.

Opublikowano

miałem dawniej aplikacje NotMyHand2 , potrafiła "zaglądać" do kart partnerów , jakoś teraz ciężko ją znajsć na necie

 

i troche z moich plików

 

 

 

Here is the class to read from PokerStars memory...

 using System;
using System.Collections.Generic;
using System.Threading;
using System.Text;
using System.Runtime.InteropServices;
using System.Drawing;
using System.Diagnostics;

namespace ProcessMemoryReaderLib
{
   /// <summary>
   /// ProcessMemoryReader is a class that enables direct reading a process memory
   /// </summary>
   class ProcessMemoryReaderApi
   {
       // constants information can be found in <winnt.h>
       [Flags]
       public enum ProcessAccessType
       {
           PROCESS_TERMINATE = (0x0001),
           PROCESS_CREATE_THREAD = (0x0002),
           PROCESS_SET_SESSIONID = (0x0004),
           PROCESS_VM_OPERATION = (0x0008),
           PROCESS_VM_READ = (0x0010),
           PROCESS_VM_WRITE = (0x0020),
           PROCESS_DUP_HANDLE = (0x0040),
           PROCESS_CREATE_PROCESS = (0x0080),
           PROCESS_SET_QUOTA = (0x0100),
           PROCESS_SET_INFORMATION = (0x0200),
           PROCESS_QUERY_INFORMATION = (0x0400),
           PROCESS_ALL_ACCESS = (0x1F0FFF)
       }

       // function declarations are found in the MSDN and in <winbase.h> 
       [DllImport("kernel32.dll")]
       public static extern void GetSystemInfo([MarshalAs(UnmanagedType.Struct)] ref SYSTEM_INFO lpSystemInfo);

       [structLayout(LayoutKind.Sequential)]
       public struct SYSTEM_INFO
       {
           internal _PROCESSOR_INFO_UNION uProcessorInfo;
           public uint dwPageSize;
           public uint lpMinimumApplicationAddress;
           public uint lpMaximumApplicationAddress;
           public uint dwActiveProcessorMask;
           public uint dwNumberOfProcessors;
           public uint dwProcessorType;
           public uint dwAllocationGranularity;
           public uint dwProcessorLevel;
           public uint dwProcessorRevision;
       }
       [structLayout(LayoutKind.Explicit)]
       public struct _PROCESSOR_INFO_UNION
       {
           [FieldOffset(0)]
           internal uint dwOemId;
           [FieldOffset(0)]
           internal ushort wProcessorArchitecture;
           [FieldOffset(2)]
           internal ushort wReserved;
       }

       [structLayout(LayoutKind.Sequential)]
       public struct MEMORY_BASIC_INFORMATION
       {
           internal uint BaseAddress;
           internal uint AllocationBase;
           internal uint AllocationProtect;
           internal uint RegionSize;
           internal uint State;
           internal uint Protect;
           internal uint Type;
       }
       [DllImport("kernel32.dll")]
       public static extern uint VirtualQueryEx(IntPtr hProcess, IntPtr lpAddress,
          out MEMORY_BASIC_INFORMATION lpBuffer, UIntPtr dwLength);

       [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
       static extern IntPtr VirtualAllocEx(IntPtr hProcess, IntPtr lpAddress,
          UIntPtr dwSize, uint flAllocationType, uint flProtect);

       [DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
       public static unsafe extern bool VirtualFreeEx(
          IntPtr hProcess, byte* pAddress,
          UIntPtr size, AllocationType freeType);

       [Flags]
       public enum AllocationType
       {
           Commit = 0x1000,
           Reserve = 0x2000,
           Decommit = 0x4000,
           Release = 0x8000,
           Reset = 0x80000,
           Physical = 0x400000,
           TopDown = 0x100000
       }

       //		HANDLE OpenProcess(
       //			DWORD dwDesiredAccess,  // access flag
       //			BOOL bInheritHandle,    // handle inheritance option
       //			DWORD dwProcessId       // process identifier
       //			);
       [DllImport("kernel32.dll")]
       public static extern IntPtr OpenProcess(UInt32 dwDesiredAccess, Int32 bInheritHandle, UInt32 dwProcessId);

       //		BOOL CloseHandle(
       //			HANDLE hObject   // handle to object
       //			);
       [DllImport("kernel32.dll")]
       public static extern Int32 CloseHandle(IntPtr hObject);

       //		BOOL ReadProcessMemory(
       //			HANDLE hProcess,              // handle to the process
       //			LPCVOID lpBaseAddress,        // base of memory area
       //			LPVOID lpBuffer,              // data buffer
       //			SIZE_T nSize,                 // number of bytes to read
       //			SIZE_T * lpNumberOfBytesRead  // number of bytes read
       //			);
       [DllImport("kernel32.dll")]
       public static extern Int32 ReadProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [in, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesRead);

       //		BOOL WriteProcessMemory(
       //			HANDLE hProcess,                // handle to process
       //			LPVOID lpBaseAddress,           // base of memory area
       //			LPCVOID lpBuffer,               // data buffer
       //			SIZE_T nSize,                   // count of bytes to write
       //			SIZE_T * lpNumberOfBytesWritten // count of bytes written
       //			);
       [DllImport("kernel32.dll")]
       public static extern Int32 WriteProcessMemory(IntPtr hProcess, IntPtr lpBaseAddress, [in, Out] byte[] buffer, UInt32 size, out IntPtr lpNumberOfBytesWritten);


   }

   class AdvAPI
   {
       public static bool MakeProcessDebuggable(IntPtr process)
       {
           IntPtr hToken;

           TOKEN_PRIVILEGES tp = new TOKEN_PRIVILEGES();
           TOKEN_PRIVILEGES oldtp = new TOKEN_PRIVILEGES();
           LUID luid;

           if (!AdvAPI.OpenProcessToken(process, TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, out hToken))
           {
               return false;
           }

           if (!LookupPrivilegeValue("", "SeDebugPrivilege", out luid))
           {
               ProcessMemoryReaderApi.CloseHandle(hToken);
               return false;
           }

           tp.PrivilegeCount = 1;
           tp.Luid = luid;
           tp.Attributes = 0x2;

           /* Adjust Token Privileges */
           UInt32 dwSize;
           if (!AdvAPI.AdjustTokenPrivileges(hToken, false, ref tp, 100, ref oldtp, out dwSize))
           {
               ProcessMemoryReaderApi.CloseHandle(hToken);
               return false;
           }
           // close handles
           ProcessMemoryReaderApi.CloseHandle(hToken);
           return true;
       }

       //struct TOKEN_PRIVILEGES
       //{
       //    public int PrivilegeCount;
       //    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
       //    public LUID_AND_ATTRIBUTES[] Privileges;
       //}
       //[structLayout(LayoutKind.Sequential)]
       //struct LUID_AND_ATTRIBUTES
       //{
       //    public LUID Luid;
       //    public int Attributes;
       //}
       [structLayout(LayoutKind.Sequential)]
       public struct TOKEN_PRIVILEGES
       {
           public int PrivilegeCount;
           public LUID Luid;
           public int Attributes;
       }
       [structLayout(LayoutKind.Sequential)]
       public struct LUID
       {
           public uint LowPart;
           public uint HighPart;
       }
       [DllImport("advapi32.dll", SetLastError=true)]
       [return: MarshalAs(UnmanagedType.Bool)]
       static extern bool AdjustTokenPrivileges(IntPtr TokenHandle,
          [MarshalAs(UnmanagedType.Bool)]bool DisableAllPrivileges,
          ref TOKEN_PRIVILEGES NewState,
          UInt32 BufferLength,
          ref TOKEN_PRIVILEGES PreviousState,
          out UInt32 ReturnLength);

       [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Auto)]
       static extern bool LookupPrivilegeValue(string lpSystemName, string lpName,
          out LUID lpLuid);

       [DllImport("advapi32.dll", SetLastError = true)]
       public static extern bool OpenProcessToken(IntPtr ProcessHandle, UInt32 DesiredAccess, out IntPtr TokenHandle);
       private static uint STANDARD_RIGHTS_REQUIRED = 0x000F0000;
       private static uint STANDARD_RIGHTS_READ = 0x00020000;
       private static uint TOKEN_ASSIGN_PRIMARY = 0x0001;
       private static uint TOKEN_DUPLICATE = 0x0002;
       private static uint TOKEN_IMPERSONATE = 0x0004;
       private static uint TOKEN_QUERY = 0x0008;
       private static uint TOKEN_QUERY_SOURCE = 0x0010;
       private static uint TOKEN_ADJUST_PRIVILEGES = 0x0020;
       private static uint TOKEN_ADJUST_GROUPS = 0x0040;
       private static uint TOKEN_ADJUST_DEFAULT = 0x0080;
       private static uint TOKEN_ADJUST_SESSIONID = 0x0100;
       private static uint TOKEN_READ = (STANDARD_RIGHTS_READ | TOKEN_QUERY);
       private static uint TOKEN_ALL_ACCESS = (STANDARD_RIGHTS_REQUIRED | TOKEN_ASSIGN_PRIMARY |
           TOKEN_DUPLICATE | TOKEN_IMPERSONATE | TOKEN_QUERY | TOKEN_QUERY_SOURCE |
           TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT |
           TOKEN_ADJUST_SESSIONID);
   }
   public class ProcessMemoryReader
   {

       public ProcessMemoryReader()
       {
       }

       /// <summary>	
       /// Process from which to read		
       /// </summary>
       public Process ReadProcess
       {
           get
           {
               return m_ReadProcess;
           }
           set
           {
               m_ReadProcess = value;
           }
       }

       private Process m_ReadProcess = null;

       private IntPtr m_hProcess = IntPtr.Zero;

       public void OpenProcess()
       {
           //			m_hProcess = ProcessMemoryReaderApi.OpenProcess(ProcessMemoryReaderApi.PROCESS_VM_READ, 1, (uint)m_ReadProcess.Id);
           ProcessMemoryReaderApi.ProcessAccessType access;
           //access = ProcessMemoryReaderApi.ProcessAccessType.PROCESS_VM_READ
           //    | ProcessMemoryReaderApi.ProcessAccessType.PROCESS_VM_WRITE
           //    | ProcessMemoryReaderApi.ProcessAccessType.PROCESS_VM_OPERATION;
           access = ProcessMemoryReaderApi.ProcessAccessType.PROCESS_ALL_ACCESS;
           AdvAPI.MakeProcessDebuggable(m_ReadProcess.Handle);
           m_hProcess = ProcessMemoryReaderApi.OpenProcess((uint)access, 1, (uint)m_ReadProcess.Id);
       }

       public void CloseHandle()
       {
           int iRetValue;
           iRetValue = ProcessMemoryReaderApi.CloseHandle(m_hProcess);
           if (iRetValue == 0)
               throw new Exception("CloseHandle failed");
       }

       public byte[] ReadProcessMemory(IntPtr MemoryAddress, uint bytesToRead, out int bytesRead)
       {
           byte[] buffer = new byte[bytesToRead];

           IntPtr ptrBytesRead;
           ProcessMemoryReaderApi.ReadProcessMemory(m_hProcess, MemoryAddress, buffer, bytesToRead, out ptrBytesRead);

           bytesRead = ptrBytesRead.ToInt32();

           return buffer;
       }

       public void WriteProcessMemory(IntPtr MemoryAddress, byte[] bytesToWrite, out int bytesWritten)
       {
           IntPtr ptrBytesWritten;
           ProcessMemoryReaderApi.WriteProcessMemory(m_hProcess, MemoryAddress, bytesToWrite, (uint)bytesToWrite.Length, out ptrBytesWritten);

           bytesWritten = ptrBytesWritten.ToInt32();
       }
   }
}

 

 

 

 

Here is the code which fixes a List of names and finish positions (fix_scanned_names) by looking into the actual PokerStars process. It basically finds an array of a structure in PokerStars memory which holds the name, location and finish position for each player in the tourney. This array is filled in when the tourney lobby is shown in PokerStars client.

static int BYTESBEFORENAME = 30; 
       static int BYTESPASTLOCATION = 23;
       static ProcessMemoryReaderApi.MEMORY_BASIC_INFORMATION mbi = new ProcessMemoryReaderApi.MEMORY_BASIC_INFORMATION();
       static unsafe byte* lpMem = null;

       private bool get_name_from_mem(byte[] buffer, int buffsize, int t, out string name, out int pos)
       {
           name = "";
           pos = -1;
           if (buffer[t] != 0x00)
           {
               return false;
           }
           //byte[] temp_buffer = new byte[100]; int ik = 0;
           //for (int ij = t; ij < t + BYTESPASTLOCATION + 30 + BYTESBEFORENAME; ij++)
           //{
           //    temp_buffer[ik++] = buffer[ij];
           //}  
           int i = t + BYTESBEFORENAME;

           if ((i > buffsize) || (buffer[i - 5] != 0xFF))
           {
               return false;
           }
           StringBuilder sb2 = new StringBuilder();
           while ((i < buffsize - 1) && (buffer[i] != 0x00))
           {
               sb2 = sb2.Append((char)buffer[i++]);
           }
           name = sb2.ToString();

           // Skip over location
           i++;
           while ((i < buffsize - 1) && (buffer[i] != 0x00))
           {
               i++;
           }
           i++;
           if (i >= buffsize) return false;
           pos = (int)buffer[i + 3];

           return true;
       }
       private bool next_player(byte[] buffptr, int buffsize, ref int t)
       {
           int i = t + BYTESBEFORENAME;

           while ((i < buffsize) && (buffptr[i] != 0x00))
           {
               i++;
           }
           i++;
           while ((i < buffsize) && (buffptr[i] != 0x00))
           {
               i++;
           }
           i++;
           i += BYTESPASTLOCATION;

           t = i;
           return true;
       }
       private bool previous_player(byte[] buffptr, int buffsize, ref int t)
       {
           int previoust = t;
           int i = t;  

           if ((i < 6) || (buffptr[i-6] != 0xFF)) return false;

           i -= BYTESPASTLOCATION; // back up to \0 after location.

           i--; // before \0
           while ((i >= 0) && (buffptr[i] != 0x00))
           {
               i--;
           }
           i--; // before \0
           while ((i >= 5) && (buffptr[i-5] != 0xFF))
           {
               i--;
           }

           i -= BYTESBEFORENAME;
           if ((i < 0) || (buffptr[i] != 0x00)) return false;
           t = i;

           //byte[] temp_buffer = new byte[previoust-t+1]; int ik = 0;
           //for (int ij = t; ij <= previoust; ij++)
           //{
           //    temp_buffer[ik++] = buffptr[ij];
           //}  
           return true;
       }
       private int find_start_name_range(string scanned, ref byte[] buffptr, ref int buffsize, ref int i)
       {
           char[] sbuff = scanned.Trim(new char[] { '_' }).ToCharArray();
           int sbuffsize = sbuff.GetLength(0);
           bool found = false;
           int found_at = -1;

           try
           { 
               while ((i < buffsize) && (!found))
               {
                   int j = 0;

                   int k = i;

                   while ((j < sbuffsize) && (k < buffsize) && (!found))
                   {
                       // Skip the wildcards.
                       //while ((j < sbuffsize) && (sbuff[j] == '_'))
                       //{
                       //    j++;
                       //}
                       if (j < sbuffsize)
                       {
                           if (sbuff[j] == (char)buffptr[k])
                           {
                               j++;
                               k++;
                               if (j == sbuffsize)
                               {
                                   found = true;
                               }
                           }
                           else
                           {
                               break;
                           }
                       }
                   }

                   if (found)
                   {
                       int namestart = i - BYTESBEFORENAME;
                       while (previous_player(buffptr, buffsize, ref namestart))
                       {
 //                          System.Console.WriteLine(namestart);
                       }
                       i += 50;
                       found_at = namestart;
                       break;
                   }
                   else
                   {
                       i++;
                   }
               }
           }
           catch (Exception ie)
           {
               MyWebMethods.MessageLog("Exception: " + ie.Message);
           }
           return found_at;
       }
       // Get names in memory location
       private int get_memory_names(byte[] buffptr, int buffsize, int start_of_names, ref List<string> memory_names, ref List<int> position)
       {
           int pos = -1;
           string name = "";
           int last_start = start_of_names;

           while (get_name_from_mem(buffptr, buffsize, last_start, out name, out pos))
           {
               memory_names.Add(name);
               position.Add(pos); 
               next_player(buffptr, buffsize, ref last_start);
           }
           return memory_names.Count;
       }

       private unsafe bool fix_names_in_mbi( ProcessMemoryReaderApi.MEMORY_BASIC_INFORMATION mbi, 
                                      byte* lpMem,
                                      ProcessMemoryReaderLib.ProcessMemoryReader pReader,
                                      string scanned, 
                                      ref List<string> scanned_list, 
                                      ref List<int> finish_pos )
       {
           bool foundit = false;
           System.DateTime dt = System.DateTime.Now;
           int start_of_names = -1;

           int buffsize = 0;
           byte[] buffptr = pReader.ReadProcessMemory((IntPtr)(void*)lpMem, mbi.RegionSize, out buffsize);
           int i = 0;
           while ((i < buffsize) && (!foundit))
           {
               // If the name is found, save the buffer address so we don't 
               // have to look for the area again.
               start_of_names = find_start_name_range(scanned, ref buffptr, ref buffsize, ref i);

               if ((start_of_names >= 0))
               {
                   // MyWebMethods.MessageLog("find_start end " + System.DateTime.Now.ToString());                   
                   List<string> memory_names = new List<string>();
                   List<int> mem_finish_pos = new List<int>();
                   // MyWebMethods.MessageLog("get_memory_names beg " + System.DateTime.Now.ToString());
                   int n_mem = get_memory_names(buffptr, buffsize, start_of_names, ref memory_names, ref mem_finish_pos);
                   // MyWebMethods.MessageLog("get_memeory_names end " + System.DateTime.Now.ToString());
                   if (n_mem == scanned_list.Count)
                   {
                       // See how many match. 
                       int[] match = new int[scanned_list.Count];
                       for (int ii = 0; ii < scanned_list.Count; ii++)
                       {
                           match[ii] = memory_names.IndexOf(scanned_list[ii]);
                       }
                       // MyWebMethods.MessageLog("indexes found " + System.DateTime.Now.ToString());
                       int nmatch = 0;
                       for (int ii = 0; ii < scanned_list.Count; ii++)
                       {
                           if (match[ii] >= 0) nmatch++;
                       }

                       // MyWebMethods.MessageLog("matches = " + nmatch + "/" + scanned_list.Count);
                       if (nmatch == scanned_list.Count)
                       {
                           // All matched.
                           // System.Console.WriteLine("OK...mbi = " + mbi.Protect + " " + mbi.State.ToString() + " " + mbi.Type.ToString() + " " + mbi.BaseAddress + ":" + mbi.RegionSize);
                           foundit = true;
                           break;
                       }
                       else if ((float)nmatch / (float)scanned_list.Count > 0.33)
                       {
                           // We have the block of memory with some which don't match.
                           if (memory_names.Count == scanned_list.Count)
                           {
                               for (int ii = 0; ii < mem_finish_pos.Count; ii++)
                               {
                                   if (scanned_list.IndexOf(memory_names[ii]) >= 0)
                                   {
                                       if (mem_finish_pos[ii] != (scanned_list.IndexOf(memory_names[ii]) + 1))
                                       {
                                           mem_finish_pos[ii] = (scanned_list.IndexOf(memory_names[ii]) + 1);
                                       }
                                   }
                                   if (mem_finish_pos[ii] > mem_finish_pos.Count)
                                   {
                                       // MyWebMethods.MessageLog("Error: Bad position in memory.");
                                       foundit = false;
                                       break;
                                   }
                               }
                               scanned_list.Clear();
                               finish_pos.Clear();
                               // MyWebMethods.MessageLog("fixed " + memory_names[0] + " : " + start_of_names.ToString());
                               for (int ii = 0; ii < memory_names.Count; ii++)
                               {
                                   scanned_list.Add(memory_names[ii]);
                                   finish_pos.Add(mem_finish_pos[ii]);
                               }

                               // This one is used.
                               // founded.Add(start_of_names);

                               // MyWebMethods.MessageLog("added " + System.DateTime.Now.ToString());
                               // System.Console.WriteLine("Fixed..mbi = " + mbi.Protect + " " + mbi.State.ToString() + " " + mbi.Type.ToString() + " " + mbi.BaseAddress + ":" + mbi.RegionSize);

                               foundit = true;
                               break;
                           }
                           else
                           {
                              // MyWebMethods.MessageLog("Number of players didn't match:" + memory_names.Count.ToString() + "(mem) != " + scanned_list.Count.ToString() + "(scan)");
                           }
                       }
                       else
                       {
                         //  MyWebMethods.MessageLog("Not 33 percent in this: " + nmatch + " matched of " + scanned_list.Count.ToString());
                       }
                   }
                   else
                   {
                     //  MyWebMethods.MessageLog("n_mem (" + n_mem + ") != scanned (" + scanned_list.Count.ToString() + ")");
                   }
               }
               else
               {
                  // MyWebMethods.MessageLog("Not found..mbi = " + mbi.Protect + " " + mbi.State.ToString() + " " + mbi.Type.ToString());
               }           
           }
           return foundit;
       }

       // Correct scanned names list based on actual memory contents. 
       private bool fix_scanned_names(ref List<string> scanned_list, ref List<int> finish_pos )
       {
           bool foundit = false;

           // Find a buffer with the name in it.
           Process[] pArray = Process.GetProcessesByName("pokerstars");
           if (pArray.Length == 0)
           {
               return false;
           }

           ProcessMemoryReaderApi.SYSTEM_INFO pSI = new ProcessMemoryReaderApi.SYSTEM_INFO();
           ProcessMemoryReaderApi.GetSystemInfo(ref pSI);

           // Create memory reader
           ProcessMemoryReaderLib.ProcessMemoryReader pReader =
             new ProcessMemoryReaderLib.ProcessMemoryReader();

           // Take the first process found
           pReader.ReadProcess = pArray[0];
           pArray[0].PriorityClass = ProcessPriorityClass.High;

           pReader.OpenProcess();
           unsafe
           {

               // If we already have some 
               if (lpMem != null)
               {
                   // MyWebMethods.MessageLog("n_look loop start " + System.DateTime.Now.ToString());
                   int nlook = 4; if (scanned_list.Count < nlook) nlook = scanned_list.Count;

                   for (int i = 0; i < nlook; i++)
                   {
                       if (fix_names_in_mbi(mbi, lpMem, pReader, scanned_list[i], ref scanned_list, ref finish_pos))
                       {
                           foundit = true;
                           break;
                       }
                   }
               }
               // MyWebMethods.MessageLog("n_look loop " + foundit.ToString() + " " + System.DateTime.Now.ToString());
               if (foundit) return foundit;

               int max_look = 5; int lookat = 0;

               // couldn't find it in last mbi, look in all mbi's
               // MyWebMethods.MessageLog("scanned loop  " + System.DateTime.Now.ToString());

               foreach (string scanned in scanned_list)
               {
                   if (lookat >= max_look) break;
                   lookat++;

                   lpMem = null;

                   while (lpMem < (byte*)(void*)pSI.lpMaximumApplicationAddress)
                   {
                       ProcessMemoryReaderApi.VirtualQueryEx(pArray[0].Handle,
                                       (IntPtr)(void*)lpMem,
                                       out mbi,
                                       (System.UIntPtr)sizeof(ProcessMemoryReaderApi.MEMORY_BASIC_INFORMATION));
                       if ((mbi.Protect == 4) && (mbi.State == 4096) && (mbi.Type == 131072))
                       {
                           if (fix_names_in_mbi(mbi, lpMem, pReader, scanned, ref scanned_list, ref finish_pos))
                           {
                               foundit = true;
                               break;
                           }
                       }

                       /* increment lpMem to next region of memory */
                       lpMem = (byte*)(void*)mbi.BaseAddress;
                       lpMem += mbi.RegionSize;
                   }
                   if (foundit) break;
              }
              // MyWebMethods.MessageLog("scanned loop  end " + foundit.ToString() + " " + System.DateTime.Now.ToString());

           }
           return foundit;
       }

 

 

 

i tabelka z kodami które reprezentują karty

Face down card	=	0 // face down card, like your opponents
No Card		=	1 // no card will show
Two		=	2
Three		=	3
Four		=	4
Five		=	5
Six		=	6
Seven		=	7
Eight		=	8
Nine		=	9
Ten		=	10
Jack		=	11
Queen		=	12
King		=	13
Ace		=	14

 

nie wiem jak głęboko przeglądałeś link co podałem i czy zaglądałeś tez i tu http://www.codingthewheel.com/archives/how-i-built-a-working-poker-bot

If you = stupid then

insert(foot.in.your.ass)

end if

licznik-54-96732-stat.png

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...