Welcome to our guide for using the Mega Mosaic Cheating Tool! This helpful tool is specifically designed for players of the game “Mega Mosaic” to cheat by accessing and changing the game’s memory. It can automatically solve the game’s minefield by gathering game data, manipulating the grid, and simulating clicks on cells. Let’s dive in and learn how to use this tool effectively.
1. Obtaining the Game Process Handle
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
- 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
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
- The tool retrieves the game’s process handle to gain memory access.
- It extracts the mine numbers and grid state from the game’s memory.
- It initializes the map and continuously checks each tile, automatically solving qualifying tiles.
- It simulates clicks to unlock the tiles and surrounding areas.
- The tool writes the modified data back to the game, updating the game display to reflect the solved state.
Source Code
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.
And that wraps up our share on Mega Mosaic: Mega Mosaic Cheating Tool Guide. If you have any additional insights or tips to contribute, don’t hesitate to drop a comment below. For a more in-depth read, you can refer to the original article here by ax_pokl, who deserves all the credit. Happy gaming!