UPDATED [At End]
Got bored and trying to create an effective god mode in Minesweeper that will allow you to keep on playing even after you die.
If I can get it all to work properly, I may make a small hack of the game that allows you to set a number of lives per game, and then you loose after hitting that many mines.
Ill be updating the blog with posts as I research more.
This is what I have so far.
__________________________________
Pretty much everything of use so far has come from the GameOver function called here:
010035AB |> \E8 CCFEFFFF CALL winmine.GameOver ; (CALL winmine.0100347C)
After a bit of playing around, ive created a cave that allows me to continue playing even after hitting a mine:
Original
#########################
010034D4 85F6 TEST ESI,ESI
010034D6 C705 00500001 10000000 MOV DWORD PTR DS:[fStatus],10
010034E0 5E POP ESI
#########################
With Jump
#########################
010034D4 |. 85F6 TEST ESI,ESI 010034D6 E9 B4150000 JMP winmine.01004A8A 010034DB 90 NOP 010034DC 90 NOP 010034DD 90 NOP 010034DE 90 NOP 010034DF 90 NOP 010034E0 |. 5E POP ESI
#########################
Code Cave
#########################
01004A8A 833D 60510001 03 CMP DWORD PTR DS:[iButtonCur],3 01004A91 5E POP ESI 01004A92 ^ 0F85 77EAFFFF JNZ winmine.0100350F 01004A98 C705 00500001 10000000 MOV DWORD PTR DS:[fStatus],10 01004AA2 ^ E9 3CEAFFFF JMP winmine.010034E3
This little cave just checks to see if the game has been won or lost. If its been won, then it sets the gamestate to 0×10 (Game Over) else, it keeps the value as 0 and returns to the function.
__________________________________
Update:
I decided that instead of using a cave, just patching the function would work just as nicely:
Original
#########################
010034CF |. E8 19040000 CALL winmine.PlayTune 010034D4 85F6 TEST ESI,ESI 010034D6 C705 00500001 10000000 MOV DWORD PTR DS:[fStatus],10 010034E0 5E POP ESI 010034E1 74 2C JE SHORT winmine.0100350F 010034E3 66:A1 A0560001 MOV AX,WORD PTR DS:[Preferences] 010034E9 66:3D 0300 CMP AX,3 010034ED 74 20 JE SHORT winmine.0100350F 010034EF 8B0D 9C570001 MOV ECX,DWORD PTR DS:[cSec]
#############
PATCHED
#############
010034CF |. E8 19040000 CALL winmine.PlayTune 010034D4 66:A1 A0560001 MOV AX,WORD PTR DS:[Preferences] 010034DA 833D 60510001 03 CMP DWORD PTR DS:[iButtonCur],3 010034E1 5E POP ESI 010034E2 75 2B JNZ SHORT winmine.0100350F 010034E4 C705 00500001 10000000 MOV DWORD PTR DS:[fStatus],10 010034EE 90 NOP 010034EF 8B0D 9C570001 MOV ECX,DWORD PTR DS:[cSec]
0 Responses to “[ASM] Minesweeper God Mode Testing”