View previous topic :: View next topic |
Author |
Message |
Heartless I post too much Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Sun Aug 24, 2008 5:17 pm Post subject: [C++]Minesweeper Pro |
|
|
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. This is not 100% accurate, it is around 99%, it skips one sometimes.
_________________
What dosen't kill you, usually does the second time. |
|
Back to top |
|
|
Overload Master Cheater Reputation: 0
Joined: 08 Feb 2008 Posts: 293
|
Posted: Sun Aug 24, 2008 6:23 pm Post subject: |
|
|
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 |
|
|
HolyBlah Master Cheater Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Aug 25, 2008 2:38 am Post subject: |
|
|
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 |
|
|
&Vage Grandmaster Cheater Supreme Reputation: 0
Joined: 25 Jul 2008 Posts: 1053
|
Posted: Mon Aug 25, 2008 5:43 am Post subject: |
|
|
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 |
|
|
Heartless I post too much Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Mon Aug 25, 2008 7:57 am Post subject: |
|
|
I think it was in release build. Since I can't get it to work correctly outside of my computerhere is the source.
_________________
What dosen't kill you, usually does the second time. |
|
Back to top |
|
|
HolyBlah Master Cheater Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Mon Aug 25, 2008 8:40 am Post subject: |
|
|
PEiD wrote: | Microsoft Visual C++ 8.0 [Debug] |
|
|
Back to top |
|
|
Heartless I post too much Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
|
Back to top |
|
|
nog_lorp Grandmaster Cheater Reputation: 0
Joined: 26 Feb 2006 Posts: 743
|
|
Back to top |
|
|
pkedpker Master Cheater Reputation: 1
Joined: 11 Oct 2006 Posts: 412
|
Posted: Wed Aug 27, 2008 3:30 am Post subject: |
|
|
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
_________________
|
|
Back to top |
|
|
Heartless I post too much Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Wed Aug 27, 2008 7:48 am Post subject: |
|
|
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 |
|
|
Symbol I'm a spammer Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Wed Aug 27, 2008 11:09 am Post subject: |
|
|
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 |
|
|
Heartless I post too much Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
|
Back to top |
|
|
Symbol I'm a spammer Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Thu Aug 28, 2008 4:54 am Post subject: |
|
|
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
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 |
|
|
|