FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
FpsCheatLearning/Common.cpp at main · LYingSiMon/FpsCheatLearning · GitHub
LYingSiMon
/
FpsCheatLearning
Public
Notifications
You must be signed in to change notification settings
Fork
3
Star
18
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
FpsCheatLearning
/
Common.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (48 loc) · 1.04 KB
Breadcrumbs
FpsCheatLearning
/
Common.cpp
Copy path
File metadata and controls
57 lines (48 loc) · 1.04 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#
include
"
pch.h
"
#
include
"
Common.h
"
#
include
<
tlhelp32.h
>
#
include
<
psapi.h
>
ULONG_PTR
GetModuleBaseByPid
(
DWORD
Pid,
PCHAR
ModuleName)
{
HANDLE
hModuleSnap =
CreateToolhelp32Snapshot
(
TH32CS_SNAPMODULE
, Pid);
MODULEENTRY32
Module = {
sizeof
(
MODULEENTRY32
) };
if
(!
Module32First
(hModuleSnap, &Module))
{
return
0
;
}
do
{
if
(
_stricmp
(ModuleName, Module.
szModule
) ==
0
)
{
return
(
ULONG_PTR
)Module.
modBaseAddr
;
}
}
while
(
Module32Next
(hModuleSnap, &Module));
return
0
;
}
BOOL
ReadProcMemByOffset
(
HANDLE
hProc,
ULONG_PTR
Offset[],
DWORD
OffsetCount,
PVOID
Result,
DWORD
Size)
{
BYTE
Buffer[
256
] = {
0
};
ULONG_PTR
Temp =
0
;
for
(
UINT
i =
0
; i <= OffsetCount; ++i)
{
Temp = *(
PULONG_PTR
)Buffer;
Temp += Offset[i];
memset
(Buffer,
0
,
256
);
if
(i == OffsetCount)
{
if
(!
ReadProcessMemory
(hProc, (
PVOID
)Temp, Buffer, Size,
0
))
{
return
FALSE
;
}
}
else
{
if
(!
ReadProcessMemory
(hProc, (
PVOID
)Temp, Buffer,
sizeof
(
ULONG_PTR
),
0
))
{
return
FALSE
;
}
}
}
memcpy
(Result, Buffer, Size);
return
TRUE
;
}
Back
|
FazBrowse Home
|
New Git URL