Jump to content

How can I make a trainer for minesweeper?


Recommended Posts

Ok here is my basic code that I made with help of members of this great forum!:

$answer = MsgBox(4, "Minesweeper Trainer", "Do you want to open the minesweeper Trainer?");This will make a message box asking if you want the trainer
    If $answer = 7 Then;This will close it if someone presses no
Exit
EndIf
    If $answer = 6 Then
    run ("winmine.exe") ;This will run minesweeper if someone presses yes
EndIf

That pretty much just opens and message boxes that tells you if you want to open the trainer or not

if Yes minesweeper will open if no then it will just close.

Please tell me how I can make it a trainer for minesweeper.

Link to comment
Share on other sites

by trainer do you mean tutorial?

any way you do it, you need to click, recognise numbers in surrounding areas, work out whether there is a mine there, and it goes on and on.

can I recommend the good old helpfile, particular parts referring to pixel stuff. also search the forums, many people have played around with character recognition.

Link to comment
Share on other sites

by trainer do you mean tutorial?

any way you do it, you need to click, recognise numbers in surrounding areas, work out whether there is a mine there, and it goes on and on.

can I recommend the good old helpfile, particular parts referring to pixel stuff. also search the forums, many people have played around with character recognition.

maby he means this

minesweep.au3

0x616e2069646561206973206c696b652061206d616e20776974686f7574206120626f64792c20746f206669676874206f6e6520697320746f206e657665722077696e2e2e2e2e

Link to comment
Share on other sites

  • 1 month later...

Sorry for reviving this old topic, but perhaps he meant one of the all-too-common trainers that edit a program's memory?

If you know the addresses of the values you want to edit, you could always change them (probably using one of the memory libraries somewhere in Example Scripts)

eg:

The following addresses are only for this specific file:
Winmine.exe - Windows XP - Service Pack 2 (File Size: 119,808 bytes; File Version: 5.1.2600.0)

Time - 4 bytes
    STATIC: 0100579C (Current time elasped in seconds)
Records - 4 bytes - (value assigned when the "Enter name" window appears)
    STATIC: 010056CC (Beginner)
    STATIC: 010056D0 (Intermediate)
    STATIC: 010056D4 (Expert)
Record Holders - Unicode String
    STATIC: 010056D8 (Beginner)
    STATIC: 01005718 (Intermediate)
    STATIC: 01005758 (Expert)
(for winmine, 0100HHHH = winmine.exe+HHHH)
Notes: records and record holders appear to be loaded when the program starts and saved when it ends - editing works.

And, as above - the addresses here are only for that specific file. If you have a different version of the file, you're on your own - which is why most memory-based trainers either need constant updates or are abandoned.

Notes, ex: This Thread had one attachment doing some minesweeper memory editing.

Corgano's script works for the same minesweeper version as this (towards a different goal), but I think memory editing is much more productive. (But also more dangerous if you have the wrong address/value.)

Example:

This script should reset the time elapsed/counter to 000 (display will change at 001)

WARNING! This code should ONLY be used with the posted program version!

(Note: Just edited w0uter's 2005 script)

Global Const $MEM_O = 0x8
Global Const $MEM_R = 0x10
Global Const $MEM_W = 0x20

Func _MemOpen($i_dwDesiredAccess, $i_bInheritHandle, $i_dwProcessId)

    $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $i_dwDesiredAccess, 'int', $i_bInheritHandle, 'int', $i_dwProcessId)
    If @error Then
        SetError(1)
        Return 0
    EndIf

    Return $ai_Handle[0]
EndFunc ;==> _MemOpen()

Func _MemRead($i_hProcess, $i_lpBaseAddress, $i_nSize, $v_lpNumberOfBytesRead = '')

    Local $v_Struct = DllStructCreate ('byte[' & $i_nSize & ']')
    DllCall('kernel32.dll', 'int', 'ReadProcessMemory', 'int', $i_hProcess, 'int', $i_lpBaseAddress, 'int', DllStructGetPtr ($v_Struct, 1), 'int', $i_nSize, 'int', $v_lpNumberOfBytesRead)

    Local $v_Return = DllStructGetData ($v_Struct, 1)

    $v_Struct=0

    Return $v_Return

EndFunc ;==> _MemRead()

Func _MemWrite($i_hProcess, $i_lpBaseAddress, $v_Inject, $i_nSize, $v_lpNumberOfBytesRead = '')

    Local $v_Struct = DllStructCreate ('byte[' & $i_nSize & ']')
    DllStructSetData ($v_Struct, 1, $v_Inject)

    $i_Call = DllCall('kernel32.dll', 'int', 'WriteProcessMemory', 'int', $i_hProcess, 'int', $i_lpBaseAddress, 'int', DllStructGetPtr ($v_Struct, 1), 'int', $i_nSize, 'int', $v_lpNumberOfBytesRead)

    $v_Struct=0

    Return $i_Call[0]

EndFunc ;==> _MemWrite()

Func _MemClose($i_hProcess)

    $av_CloseHandle = DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $i_hProcess)
    Return $av_CloseHandle[0]

EndFunc ;==> _MemClose()

$v_Open = _MemOpen($MEM_W + $MEM_O, False, ProcessExists('winmine.exe'))
$v_Read = _MemWrite($v_Open, 0x0100579C, 0, 4)
$v_Close = _MemClose($v_Open)

There's probably an updated library to access memory with but I didn't look hard enough. :D

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

I didn't have time to play with NomadMemory, but this may work as a Minesweeper trainer.

(for the above program version)

EDIT: moved my script to a new thread so I can stop hijacking this one with the example.

Link to the trainer's thread.

Edited by crashdemons

My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...