Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[C++]Minesweeper Pro

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming -> Binaries
View previous topic :: View next topic  
Author Message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Sun Aug 24, 2008 5:17 pm    Post subject: [C++]Minesweeper Pro Reply with quote

First of all I couldn't think of a name so I let my little brother name it. He is not very oringal.

Next, this is different from a normal minesweeper trainer because instead of stopping time or getting rid of mines, this plays for you. Laughing This is not 100% accurate, it is around 99%, it skips one sometimes.



The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Overload
Master Cheater
Reputation: 0

Joined: 08 Feb 2008
Posts: 293

PostPosted: Sun Aug 24, 2008 6:23 pm    Post subject: Reply with quote

Doesn't launch for me. Says the application configuration is incorrect. Is it me? Or you?
_________________
Blog

Quote:
Rhys says:
you can be my maid
Rhys says:
ill buy you a french maid outfit
Tyler says:
Sounds good
Rhys says:
ill hold you to that
Back to top
View user's profile Send private message MSN Messenger
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Mon Aug 25, 2008 2:38 am    Post subject: Reply with quote

Overload wrote:
Doesn't launch for me. Says the application configuration is incorrect. Is it me? Or you?
It's not you.
@HornyAZNBoy: please compile it again in release build.
Back to top
View user's profile Send private message
&Vage
Grandmaster Cheater Supreme
Reputation: 0

Joined: 25 Jul 2008
Posts: 1053

PostPosted: Mon Aug 25, 2008 5:43 am    Post subject: Reply with quote

HolyBlah wrote:
Overload wrote:
Doesn't launch for me. Says the application configuration is incorrect. Is it me? Or you?
It's not you.
@HornyAZNBoy: please compile it again in release build.


By looking at the size... I think it's released in Release lol.
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Mon Aug 25, 2008 7:57 am    Post subject: Reply with quote

I think it was in release build. Since I can't get it to work correctly outside of my computerhere is the source.


The Extension 'rar' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
HolyBlah
Master Cheater
Reputation: 2

Joined: 24 Aug 2007
Posts: 446

PostPosted: Mon Aug 25, 2008 8:40 am    Post subject: Reply with quote

PEiD wrote:
Microsoft Visual C++ 8.0 [Debug]
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Mon Aug 25, 2008 8:44 am    Post subject: Reply with quote

Oops, I guess I saw so preoccupied I forgot to switch it ti release. I hate school. Embarassed
_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
nog_lorp
Grandmaster Cheater
Reputation: 0

Joined: 26 Feb 2006
Posts: 743

PostPosted: Wed Aug 27, 2008 1:53 am    Post subject: Reply with quote

Does it cheat off the memory? It would be way cooler to make a bot that uses basic AI to play minesweeper. Not saying this isn't a cool project though Very Happy.
_________________
Mutilated lips give a kiss on the wrist of the worm-like tips of tentacles expanding in my mind
I'm fine accepting only fresh brine you can get another drop of this yeah you wish
Back to top
View user's profile Send private message
pkedpker
Master Cheater
Reputation: 1

Joined: 11 Oct 2006
Posts: 412

PostPosted: Wed Aug 27, 2008 3:30 am    Post subject: Reply with quote

here i fixed to compile for microsoft C++ 6.0. here is the working EXE


it almost worked.. but when the count down started.. 3 2 1 move your mouse.. didn't know what to do.. and my mouse started freaking out



The Extension 'zip' was deactivated by an board admin, therefore this Attachment is not displayed.


_________________
Hacks I made for kongregate.
Kongregate Universal Badge Hack: http://forum.cheatengine.org/viewtopic.php?p=4129411
Kongreate Auto Rating/Voter hack: http://forum.cheatengine.org/viewtopic.php?t=263576
Took a test lol
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Wed Aug 27, 2008 7:48 am    Post subject: Reply with quote

I hope this explains it. I also have bad spelling.

http://www.youtube.com/watch?v=Nxpsgtdlw8U

My friend upload this for me so, hope he has better spelling.

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Wed Aug 27, 2008 11:09 am    Post subject: Reply with quote

It doesn't work for me, because my windows is in Hebrew and mine sweeper title and class are diffrent, but you should use SendMessage instead and CreateProcess, then you get the handle when creating the process.
Back to top
View user's profile Send private message
Heartless
I post too much
Reputation: 0

Joined: 03 Dec 2006
Posts: 2436

PostPosted: Wed Aug 27, 2008 11:24 am    Post subject: Reply with quote

Symbol wrote:
It doesn't work for me, because my windows is in Hebrew and mine sweeper title and class are diffrent, but you should use SendMessage instead and CreateProcess, then you get the handle when creating the process.


Shocked So you have a Jewish computer?

_________________
What dosen't kill you, usually does the second time.
Back to top
View user's profile Send private message
Symbol
I'm a spammer
Reputation: 0

Joined: 18 Apr 2007
Posts: 5094
Location: Israel.

PostPosted: Thu Aug 28, 2008 4:54 am    Post subject: Reply with quote

Hebrew, umm, yeah...
Well, you need the window handle to send the message, I improved your program a bit, it's pretty ugly though, cause it's late now so I don't really care, but at least it solves, I also had problems with getting the address of the mine so I just used inline asm Razz

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

__declspec(naked) LPCVOID GetAddress(int i, int j) //Gets the mine's address and reads 1 byte
{
   __asm
   {
      mov eax,dword ptr ds:[esp+8]
      shl eax,5
      add eax,dword ptr ds:[esp+4]
      add eax,0x1005340
      ret //8 //the compiler adds 8 to esp automatically
   }
}

void main()
{
   LPSTARTUPINFO StartupInfo = new STARTUPINFO();
   LPPROCESS_INFORMATION ProcessInfo = new PROCESS_INFORMATION();
   unsigned char* Buffer = new unsigned char[12];
   SIZE_T bytesRead;
   StartupInfo->cb = sizeof(StartupInfo);
   StartupInfo->dwX = 0;
   StartupInfo->dwY = 0;
   HWND MineSweeper;
   int Mines, Width, Height, XY;
   bool Running = true;
   wchar_t* Directory = new wchar_t[100];

   GetSystemDirectoryW(Directory, 50);
   
   wsprintf(Directory, L"%s\\winmine.exe", Directory);

   if (!CreateProcess(Directory, 0, 0, 0, 0, 0, 0, 0, StartupInfo, ProcessInfo))
   {
      printf("Error launching mine sweeper! (Error code: %d)\n", GetLastError());
      getchar();
      exit(0);
   }

   SetConsoleTitle(L"MineSweeper bot");

   Sleep(1000); //Let it load.

   do
   {
      ReadProcessMemory(ProcessInfo->hProcess, (LPCVOID)0x1005330, Buffer, 12, &bytesRead);

      if (bytesRead < 12)
      {
         printf("Error reading memory! (Error code: %d)\n", GetLastError());
         getchar();
         exit(0);
      }

      Mines = Buffer[0];
      Width = Buffer[4];
      Height = Buffer[8];
      printf("Height: %d\nWidth: %d\nMines: %d\n\nPress any key to continue...\n", Height, Width, Mines);
      getchar();
   
      MineSweeper = FindWindow(L"MineSweeper", 0); //Is this the class of English mine sweeper?
      if (MineSweeper)
      {
         printf("\nStarting bot...\n");
         Buffer[0] = 0;
         for (int i = 0; i <= Height; ++i)
         {
            for (int j = 0; j <= Width; ++j)
            {
               ReadProcessMemory(ProcessInfo->hProcess, GetAddress(j + 1, i + 1), Buffer, 1, &bytesRead);
               XY = MAKELONG((j * 16) + 20, (i * 16) + 65);
               if (Buffer[0] == 15)
               {
                  PostMessage(MineSweeper, WM_LBUTTONDOWN, MK_LBUTTON, XY);
                  PostMessage(MineSweeper, WM_LBUTTONUP, MK_LBUTTON, XY);
               }
               /*else
               {
                  PostMessage(MineSweeper, WM_RBUTTONDOWN, MK_RBUTTON, XY);
                  PostMessage(MineSweeper, WM_RBUTTONUP, MK_RBUTTON, XY);
               }*/ //Not really needed, unless you add "Sleep(100)" to see how it solves slowly
               //Sleep(1);
            }
         }
      }
      printf("[1] Continue\n[0] Exit\n");
      std::cin >> Running;
   }
   while (Running);
   
   delete[] Buffer;
}


I don't know if it'll work for you, but it works for me, no glitchs.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming -> Binaries All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites