Mega Mosaic

Mega Mosaic

Not enough ratings
Mega Mosaic Cheating Tool Guide
By ax_pokl
This tool is designed to help players cheat in the game "Mega Mosaic" by reading and modifying the game’s memory. It automatically solves the minefield by retrieving game process information, extracting map and grid data, modifying the grid status, and simulating clicks on cells to solve the game.
   
Award
Favorite
Favorited
Unfavorite
1. Obtaining the Game Process Handle
The tool first searches for the "Mega Mosaic" game window and retrieves the game’s process ID (pid).
Using OpenProcess, it opens the game’s process and gains sufficient permissions to read and write to the game’s memory, allowing it to manipulate the game state.
2. Memory Search and Data Extraction
The tool reads the game’s memory using ReadProcessMemory to extract the map and grid data, which is necessary to crack the minefield.

searchaddr_mn: This function searches the memory for map data related to the numbers on each tile (the number of mines around each grid).

searchaddr_ms: This function searches for the memory addresses related to the state of each tile (whether the tile has been clicked or is still hidden).
3. Initialization and Looping Through the Grid to Solve and Write Back Status
initmn: This function initializes each tile’s state, including whether it has been clicked or contains a mine. Using the `mnw` and `mnb` matrices, the tool calculates and stores information about each tile and the number of mines surrounding it, determining potential mine counts.

checkmn: This is the core function responsible for scanning through the grid. It loops through the map and checks whether each tile’s number matches the surrounding tiles' state. If a condition is met, it calls solvemn to process the tile further. The tool continues running checkmn until all qualifying tiles are processed.

solvemn: When the state of a tile meets certain criteria, the tool calls solvemn to unlock that tile and potentially reveal adjacent tiles.

setmn: This simulates clicking on the tile and updates the surrounding 9 tiles' status. This process modifies the memory directly to simulate real gameplay, automatically solving the grid.

writemn: Once the cracking process is complete, the tool writes the modified data back to the game’s memory, updating the game’s display. Using WriteProcessMemory, it writes the modified tile statuses back to the game, controlling the game’s display and logic directly.
Summary
This cheating tool enables players to fully control the game’s state by reading and writing memory data. The process works as follows:
  1. The tool retrieves the game’s process handle to gain memory access.
  2. It extracts the mine numbers and grid state from the game’s memory.
  3. It initializes the map and continuously checks each tile, automatically solving qualifying tiles.
  4. It simulates clicks to unlock the tiles and surrounding areas.
  5. The tool writes the modified data back to the game, updating the game display to reflect the solved state.
Source Code
Program megamosaic_cheat; Uses Windows; const maxchr = 255; var phnd: thandle; var num: dword; var ret: boolean; const m = 250; var mn: longword; var mnw, mnb: array[0..m-1, 0..m-1] of cardinal; var msw, msb, ms, msc: array[0..m-1, 0..m-1] of shortint; var mso: array[0..m-1, 0..m-1] of longword; var msoaddr: longword; procedure initmn(); var i, j: longint; begin mn:=0; for i := 0 to m-1 do for j := 0 to m-1 do begin ms[i,j] := 0; msc[i,j] := 0; msb[i,j] := 0; msw[i,j] := 0; if mnw[i,j] = $FFFFFFFF then mnb[i,j] := $FFFFFFFF else begin mnb[i,j] := 9 - mnw[i,j]; if (i = 0) or (i = m-1) or (j = 0) or (j = m-1) then mnb[i,j] := 6 - mnw[i,j]; if ((i = 0) or (i = m-1)) and ((j = 0) or (j = m-1)) then mnb[i,j] := 4 - mnw[i,j]; end; end; end; procedure setmn(i, j: longint; s: shortint); var x, y: longint; begin ms[i,j] := s; mn := mn+1; for x := i-1 to i+1 do for y := j-1 to j+1 do if (x >= 0) and (x <= m-1) and (y >= 0) and (y <= m-1) then begin if (s = 1) then msw[x,y] := msw[x,y] + 1; if (s = 2) then msb[x,y] := msb[x,y] + 1; end; end; procedure solvemn(i, j: longint; s: shortint); var x, y: longint; begin msc[i,j] := s; for x := i-1 to i+1 do for y := j-1 to j+1 do if (x >= 0) and (x <= m-1) and (y >= 0) and (y <= m-1) then if ms[x,y] = 0 then setmn(x, y, s); end; function checkmn(): longword; var i, j: longint; var nb, nw, n: longword; begin nb := 0; nw := 0; for i := 0 to m - 1 do for j := 0 to m - 1 do if msc[i, j] = 0 then begin if (mnw[i, j] = msw[i, j]) then begin solvemn(i, j, 2); nw := nw + 1; end else if (mnb[i, j] = msb[i, j]) then begin solvemn(i, j, 1); nb := nb + 1; end; end; n := nw + nb; checkmn := n; writeln('!', #9, nb, #9, nw); end; procedure writemn(); var i,j:longint; begin for i := 0 to m-1 do for j := 0 to m-1 do begin if mso[j,i]=$FF0000FF then write(ms[i,j]) else begin if ms[i,j]=1 then mso[j,i]:=$FF000000; if ms[i,j]=2 then mso[j,i]:=$FFFFFFFF; end; end; WriteProcessMemory(phnd, pointer(msoaddr), @mso, sizeof(mso), num); end; procedure getphnd; var pid: dword; win: hwnd; winname: pchar; begin getmem(winname, maxchr); repeat win := FindWindow(nil, 'Mega Mosaic'); GetWindowText(win, winname, maxchr); if pos('Mega Mosaic', winname) = 0 then win := 0; if win = 0 then begin win := GetForegroundWindow(); GetWindowText(win, winname, maxchr); if pos('Mega Mosaic', winname) = 0 then win := 0; end; if win = 0 then sleep(1); until win <> 0; GetWindowThreadProcessId(win, @pid); writeln(pid); repeat phnd := OpenProcess(PROCESS_ALL_ACCESS, false, pid); if phnd = 0 then sleep(1); until phnd <> 0; end; procedure searchaddr_mn(base, lang: cardinal); var offset, addr, buff: cardinal; begin offset := $C; while (offset <= lang) do begin buff := 0; addr := base + offset; ret := ReadProcessMemory(phnd, pointer(addr), @buff, sizeof(buff), num); if ret and (buff = 62500) then begin buff := 0; addr := base + offset + 4; ret := ReadProcessMemory(phnd, pointer(addr), @buff, sizeof(buff), num); if ret and (buff = $FFFFFFFF) then begin buff := 0; addr := base + offset + 4; ReadProcessMemory(phnd, pointer(addr), @mnw, sizeof(mnw), num); end; end; offset := offset + $1000; end; end; procedure searchaddr_ms(base, lang: cardinal); const maxbuff = $10000; var offset, addr: cardinal; var buff: array[0..maxbuff] of cardinal; var k: longword; begin offset := 0; while (offset <= lang) do begin addr := base + offset; ret := ReadProcessMemory(phnd, pointer(addr), @buff, sizeof(buff), num); if ret then begin for k := 0 to maxbuff - 2 do if buff[k] = 335874 then begin if buff[k + 1] = $FF808080 then begin msoaddr := addr + (k+1) * 4; end; end; end; offset := offset + maxbuff * 4; end; ReadProcessMemory(phnd, pointer(msoaddr), @mso, sizeof(mso), num); end; procedure getaddr(); var MBI: MEMORY_BASIC_INFORMATION; currentmem: cardinal; nextmem: cardinal; nextmemp: ^cardinal; begin currentmem := 0; MBI.RegionSize := 0; repeat currentmem := currentmem + MBI.RegionSize; VirtualQueryEx(phnd, pointer(currentmem), MBI, sizeof(MBI)); nextmemp := @MBI.BaseAddress; nextmem := nextmemp^; with MBI do begin if (RegionSize >= $100000) and (AllocationProtect = PAGE_READWRITE) and (Protect = PAGE_READWRITE) and (State = MEM_COMMIT) and (_Type = MEM_PRIVATE) then begin searchaddr_mn(nextmem, MBI.RegionSize); end; if (RegionSize >= $100000) and (AllocationProtect = PAGE_NOACCESS) and (Protect = PAGE_READWRITE) and (State = MEM_COMMIT) and (_Type = MEM_PRIVATE) then begin searchaddr_ms(nextmem, MBI.RegionSize); end; end; until (currentmem <> nextmem) or (MBI.RegionSize = $FFFFFFFF); end; begin getphnd(); writeln(phnd); getaddr(); initmn(); while checkmn() > 0 do; writemn(); end.
2 Comments
ax_pokl  [author] 9 Sep @ 9:08am 
I can prove that the game can be solved 100% logically with the number exist on the board.
xWinG 驫麤 9 Sep @ 7:06am 
so you buy a game to solve it with a program?