This problem comes from the yundun robot with water.
If you are interested in the purpose of this article, please read the post with water roughly. In this post, I used this method to write scissors No. 5
The record is good. Of course it is a cheating method.
The idea of scissors No. 5 is to try to win each other and scan the saved address of the game wins in the memory based on an address segment, after finding this information, you can get rid of the memory data when you get the game results. This is similar to the modification tool FPE used in previous standalone games. Of course, if the other party intentionally fouls and won't win in a single game, you won't be able to find his address, so that you can win through the normal channel.
After the core code of scissors 5 is simplified, it mainly serves three API functions.
OpenProcess, readprocessmemory, writeprocessmemory
The code is roughly as follows:
Using
System;
Using
System. Collections. Generic;
Using
System. text;
Using
System. runtime. interopservices;
Namespace
Leleapplication4
...
{
//
Enable Unsafe code: Right-click a project and choose Properties> Generate to allow Insecure code.
Class
Program
...
{
[Dllimport (
"
Kernel32.dll
"
)]
Public
Static
Extern
Intptr OpenProcess (uint32 dwdesiredaccess, int32 binherithandle, uint32 dwprocessid );
[Dllimport (
"
Kernel32.dll
"
)]
Public
Static
Extern
Int32 writeprocessmemory (intptr hprocess, intptr lpbaseaddress,
Uint
[] Lpbuffer, uint32 nsize, intptr lpnumberofbyteswritten );
[Dllimport (
"
Kernel32.dll
"
)]
Public
Static
Extern
Int32 readprocessmemory (intptr hprocess, intptr lpbaseaddress,
Uint
[] Lpbuffer, uint32 nsize, intptr lpnumberofbytesread );
Static
Intptr paddress
=
(Intptr)
0x12bdad8
;
Static
Uint
[] Read
=
New
Uint
[
1
];
Static
Uint
[] Write
=
New
Uint
[]
...
{
0x64
}
;
Static
Private
Int
Mm
=
999
;
Static
Void
Main (
String
[] ARGs)
...
{
Unsafe
...
{
Fixed
(
Int
*
I
=
&
Mm)
...
{Paddress
=
(Intptr) I ;}
}
Intptr H
=
OpenProcess (
0x1f0fff
,
0
, (Uint32) system. Diagnostics. process. getcurrentprocess (). Id );
Readprocessmemory (H, paddress, read,
4
, (Intptr)
0
);
//
Obtain memory data
Console. writeline (read [
0
]);
//
999 output
Writeprocessmemory (H, paddress, write,
4
, (Intptr)
0
);
//
Modify memory data
Console. writeline (mm );
//
100 output
Console. Read ();
}
}
}