kirin@pwnlab:~/projects$cat win-minesweeper-hack.md
WinMine board analysis and auto-win
The provided winmine.exe was analysed without modifying it, from two directions:
- In IDA, trace the RNG seeding, mine placement, board initialisation, click handling and win routines.
- Read the board array from the running process and click only cells without the mine bit, to verify the analysis.
Mine positions stay in a global board array in plaintext, so checking bit 0x80 of a cell tells whether it holds a mine.
Findings
| Item | Value |
|---|---|
| ImageBase | 0x01000000 |
| Board base | 0x01005340 |
| Cell address | board[32 * row + col] |
| Mine | cell & 0x80 != 0 |
| Opened | cell & 0x40 != 0 |
cell = *(uint8_t *)(0x01005340 + 32 * row + col);// click positionclient_x = 16 * col + 4;client_y = 16 * row + 47;On the 9 x 9 Beginner board it read all 10 mines and opened only the 71 safe cells, reaching the win state.
The full analysis and tools are in the repository.