mirror of
https://github.com/360NENZ/Taiga74164-Akebi-GC.git
synced 2024-12-23 03:27:58 +08:00
Add project files.
This commit is contained in:
commit
759118f830
63
.gitattributes
vendored
Normal file
63
.gitattributes
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
###############################################################################
|
||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
###############################################################################
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set default behavior for command prompt diff.
|
||||||
|
#
|
||||||
|
# This is need for earlier builds of msysgit that does not have it on by
|
||||||
|
# default for csharp files.
|
||||||
|
# Note: This is only used by command line
|
||||||
|
###############################################################################
|
||||||
|
#*.cs diff=csharp
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set the merge driver for project and solution files
|
||||||
|
#
|
||||||
|
# Merging from the command prompt will add diff markers to the files if there
|
||||||
|
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||||
|
# the diff markers are never inserted). Diff markers may cause the following
|
||||||
|
# file extensions to fail to load in VS. An alternative would be to treat
|
||||||
|
# these files as binary and thus will always conflict and require user
|
||||||
|
# intervention with every merge. To do so, just uncomment the entries below
|
||||||
|
###############################################################################
|
||||||
|
#*.sln merge=binary
|
||||||
|
#*.csproj merge=binary
|
||||||
|
#*.vbproj merge=binary
|
||||||
|
#*.vcxproj merge=binary
|
||||||
|
#*.vcproj merge=binary
|
||||||
|
#*.dbproj merge=binary
|
||||||
|
#*.fsproj merge=binary
|
||||||
|
#*.lsproj merge=binary
|
||||||
|
#*.wixproj merge=binary
|
||||||
|
#*.modelproj merge=binary
|
||||||
|
#*.sqlproj merge=binary
|
||||||
|
#*.wwaproj merge=binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# behavior for image files
|
||||||
|
#
|
||||||
|
# image files are treated as binary by default.
|
||||||
|
###############################################################################
|
||||||
|
#*.jpg binary
|
||||||
|
#*.png binary
|
||||||
|
#*.gif binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# diff behavior for common document formats
|
||||||
|
#
|
||||||
|
# Convert binary document formats to text before diffing them. This feature
|
||||||
|
# is only available from the command line. Turn it on by uncommenting the
|
||||||
|
# entries below.
|
||||||
|
###############################################################################
|
||||||
|
#*.doc diff=astextplain
|
||||||
|
#*.DOC diff=astextplain
|
||||||
|
#*.docx diff=astextplain
|
||||||
|
#*.DOCX diff=astextplain
|
||||||
|
#*.dot diff=astextplain
|
||||||
|
#*.DOT diff=astextplain
|
||||||
|
#*.pdf diff=astextplain
|
||||||
|
#*.PDF diff=astextplain
|
||||||
|
#*.rtf diff=astextplain
|
||||||
|
#*.RTF diff=astextplain
|
363
.gitignore
vendored
Normal file
363
.gitignore
vendored
Normal file
@ -0,0 +1,363 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Mono auto generated files
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Oo]ut/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# Files built by Visual Studio
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Chutzpah Test files
|
||||||
|
_Chutzpah*
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage results
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# MightyMoose
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
# Web workbench (sass)
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
|
# in these scripts will be unencrypted
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/[Pp]ackages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Microsoft Azure Build Output
|
||||||
|
csx/
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Microsoft Azure Emulator
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
|
||||||
|
# Windows Store app package directories and files
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
|
||||||
|
# Visual Studio cache files
|
||||||
|
# files ending in .cache can be ignored
|
||||||
|
*.[Cc]ache
|
||||||
|
# but keep track of directories ending in .cache
|
||||||
|
!?*.[Cc]ache/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Including strong name files can present a security risk
|
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
|
#bower_components/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file
|
||||||
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
|
# because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||||
|
*.vbw
|
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Tabs Studio
|
||||||
|
*.tss
|
||||||
|
|
||||||
|
# Telerik's JustMock configuration file
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# BizTalk build output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# OpenCover UI analysis results
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# Azure Stream Analytics local run output
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# Local History for Visual Studio
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||||
|
MigrationBackup/
|
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Fody - auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
271
cheat-library/cheat-library.vcxproj
Normal file
271
cheat-library/cheat-library.vcxproj
Normal file
@ -0,0 +1,271 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>16.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{704c8746-1bd9-4bc8-9ebe-8187f1a1ad72}</ProjectGuid>
|
||||||
|
<RootNamespace>cheatlibrary</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<TargetName>CLibrary</TargetName>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
<CustomBuildBeforeTargets>
|
||||||
|
</CustomBuildBeforeTargets>
|
||||||
|
<CustomBuildAfterTargets>BuildCompile</CustomBuildAfterTargets>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<TargetName>CLibrary</TargetName>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
<CustomBuildBeforeTargets>Run</CustomBuildBeforeTargets>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
<TargetName>CLibrary</TargetName>
|
||||||
|
<CustomBuildBeforeTargets>
|
||||||
|
</CustomBuildBeforeTargets>
|
||||||
|
<CustomBuildAfterTargets>BuildCompile</CustomBuildAfterTargets>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
<TargetName>CLibrary</TargetName>
|
||||||
|
<CustomBuildBeforeTargets>Run</CustomBuildBeforeTargets>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING; _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;WIN32;_DEBUG;CHEATLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<LanguageStandard>Default</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)src/appdata;$(ProjectDir)src/framework;$(ProjectDir)src/user;$(ProjectDir)vendor/include;</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)vendor/libraries/</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>HookLib\HookLib-$(PlatformShortName)-$(Configuration).lib;ntdll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" /Y "$(SolutionDir)injector\bin\$(PlatformShortName)\$(Configuration)\CLibrary.dll" </Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
<CustomBuildStep>
|
||||||
|
<Command>cd $(ProjectDir)batch
|
||||||
|
inject-dll.bat "$(SolutionDir)injector\bin\$(PlatformShortName)\$(Configuration)\injector.exe" "$(OutDir)$(TargetFileName)" "GenshinImpact.exe"</Command>
|
||||||
|
<Outputs>
|
||||||
|
</Outputs>
|
||||||
|
</CustomBuildStep>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING; _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;WIN32;NDEBUG;CHEATLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<LanguageStandard>Default</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)src/appdata;$(ProjectDir)src/framework;$(ProjectDir)src/user;$(ProjectDir)vendor/include;</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)vendor/libraries/</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>spdlogd.lib;HookLib\HookLib-$(PlatformShortName)-$(Configuration).lib;ntdll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" /Y "$(SolutionDir)injector\bin\$(PlatformShortName)\$(Configuration)\CLibrary.dll" </Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING; _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;_DEBUG;CHEATLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch-il2cpp.h</PrecompiledHeaderFile>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)src/appdata;$(ProjectDir)src/framework;$(ProjectDir)src/user;$(ProjectDir)vendor/include;</AdditionalIncludeDirectories>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<BufferSecurityCheck>
|
||||||
|
</BufferSecurityCheck>
|
||||||
|
<LanguageStandard_C>Default</LanguageStandard_C>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)vendor/libraries/</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>HookLib\HookLib-$(PlatformShortName)-$(Configuration).lib;ntdll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>
|
||||||
|
copy "$(OutDir)$(TargetName)$(TargetExt)" /Y "$(SolutionDir)injector\bin\$(PlatformShortName)\$(Configuration)\CLibrary.dll"
|
||||||
|
exit 0</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
<CustomBuildStep>
|
||||||
|
<Command>cd $(ProjectDir)batch
|
||||||
|
inject-dll.bat "$(SolutionDir)injector\bin\$(PlatformShortName)\$(Configuration)\injector.exe" "$(OutDir)$(TargetFileName)" "GenshinImpact.exe"</Command>
|
||||||
|
<Outputs>
|
||||||
|
</Outputs>
|
||||||
|
</CustomBuildStep>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING; _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS;NDEBUG;CHEATLIBRARY_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
|
||||||
|
<LanguageStandard>Default</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)src/appdata;$(ProjectDir)src/framework;$(ProjectDir)src/user;$(ProjectDir)vendor/include;</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<EnableUAC>false</EnableUAC>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
<AdditionalLibraryDirectories>$(ProjectDir)vendor/libraries/</AdditionalLibraryDirectories>
|
||||||
|
<AdditionalDependencies>spdlogd.lib;HookLib\HookLib-$(PlatformShortName)-$(Configuration).lib;ntdll.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>copy "$(OutDir)$(TargetName)$(TargetExt)" /Y "$(SolutionDir)injector\bin\$(PlatformShortName)\$(Configuration)\CLibrary.dll" </Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\user\debug-hooks.h" />
|
||||||
|
<ClInclude Include="src\user\util\HookManager.h" />
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-unityplayer-functions.h" />
|
||||||
|
<ClInclude Include="src\user\protection-bypass.h" />
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-api-functions-ptr.h" />
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-api-functions.h" />
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-functions.h" />
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-metadata-version.h" />
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-types-ptr.h" />
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-types.h" />
|
||||||
|
<ClInclude Include="src\framework\helpers.h" />
|
||||||
|
<ClInclude Include="src\framework\il2cpp-appdata.h" />
|
||||||
|
<ClInclude Include="src\framework\il2cpp-init.h" />
|
||||||
|
<ClInclude Include="src\framework\pch-il2cpp.h" />
|
||||||
|
<ClInclude Include="src\user\util\util.h" />
|
||||||
|
<ClInclude Include="src\user\main.h" />
|
||||||
|
<ClInclude Include="vendor\include\HookLib.h" />
|
||||||
|
<ClInclude Include="vendor\include\simple-ini.hpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\user\util\Config.cpp" />
|
||||||
|
<ClInclude Include="src\user\util\Config.h">
|
||||||
|
<FileType>CppCode</FileType>
|
||||||
|
</ClInclude>
|
||||||
|
<ClCompile Include="src\user\debug-hooks.cpp" />
|
||||||
|
<ClCompile Include="src\user\util\HookManager.cpp" />
|
||||||
|
<ClCompile Include="src\user\protection-bypass.cpp" />
|
||||||
|
<ClCompile Include="src\framework\dllmain.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\framework\helpers.cpp" />
|
||||||
|
<ClCompile Include="src\framework\il2cpp-init.cpp" />
|
||||||
|
<ClCompile Include="src\framework\pch-il2cpp.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\main.cpp" />
|
||||||
|
<ClCompile Include="src\user\util\util.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
111
cheat-library/cheat-library.vcxproj.filters
Normal file
111
cheat-library/cheat-library.vcxproj.filters
Normal file
@ -0,0 +1,111 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-api-functions.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-api-functions-ptr.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-functions.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-metadata-version.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-types.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-types-ptr.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\framework\helpers.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\framework\il2cpp-appdata.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\framework\il2cpp-init.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\framework\pch-il2cpp.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\user\main.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="vendor\include\HookLib.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\user\util\util.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\user\protection-bypass.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\appdata\il2cpp-unityplayer-functions.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\user\util\HookManager.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="vendor\include\simple-ini.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\user\util\Config.h">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\user\debug-hooks.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\framework\dllmain.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\framework\helpers.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\framework\il2cpp-init.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\framework\pch-il2cpp.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\util\util.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\protection-bypass.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\util\HookManager.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\util\Config.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\user\debug-hooks.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
4
cheat-library/packages.config
Normal file
4
cheat-library/packages.config
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="EasyHook" version="2.7.7097" targetFramework="native" />
|
||||||
|
</packages>
|
207
cheat-library/src/appdata/il2cpp-api-functions-ptr.h
Normal file
207
cheat-library/src/appdata/il2cpp-api-functions-ptr.h
Normal file
@ -0,0 +1,207 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Target Unity version: 2017.4.15 - 2017.4.40
|
||||||
|
|
||||||
|
// ******************************************************************************
|
||||||
|
// * IL2CPP API function pointers
|
||||||
|
// ******************************************************************************
|
||||||
|
|
||||||
|
#define il2cpp_add_internal_call_ptr 0x084D67A0
|
||||||
|
#define il2cpp_alloc_ptr 0x084D67B0
|
||||||
|
#define il2cpp_array_class_get_ptr 0x084D67C0
|
||||||
|
#define il2cpp_array_element_size_ptr 0x084D67D0
|
||||||
|
#define il2cpp_array_get_byte_length_ptr 0x084D67E0
|
||||||
|
#define il2cpp_array_length_ptr 0x084D67F0
|
||||||
|
#define il2cpp_array_new_ptr 0x084D6800
|
||||||
|
#define il2cpp_array_new_full_ptr 0x084D6810
|
||||||
|
#define il2cpp_array_new_specific_ptr 0x084D6820
|
||||||
|
#define il2cpp_assembly_get_image_ptr 0x084D6830
|
||||||
|
#define il2cpp_bounded_array_class_get_ptr 0x084D6840
|
||||||
|
#define il2cpp_capture_memory_snapshot_ptr 0x084D6850
|
||||||
|
#define il2cpp_class_array_element_size_ptr 0x084D6860
|
||||||
|
#define il2cpp_class_enum_basetype_ptr 0x084D6870
|
||||||
|
#define il2cpp_class_from_il2cpp_type_ptr 0x084D68A0
|
||||||
|
#define il2cpp_class_from_name_ptr 0x084D6880
|
||||||
|
#define il2cpp_class_from_system_type_ptr 0x084D6890
|
||||||
|
#define il2cpp_class_from_type_ptr 0x084D68A0
|
||||||
|
#define il2cpp_class_get_assemblyname_ptr 0x084D68B0
|
||||||
|
#define il2cpp_class_get_bitmap_ptr 0x084D68C0
|
||||||
|
#define il2cpp_class_get_bitmap_size_ptr 0x084D68E0
|
||||||
|
#define il2cpp_class_get_declaring_type_ptr 0x084D68F0
|
||||||
|
#define il2cpp_class_get_element_class_ptr 0x084D6900
|
||||||
|
#define il2cpp_class_get_events_ptr 0x084D6910
|
||||||
|
#define il2cpp_class_get_field_from_name_ptr 0x084D6920
|
||||||
|
#define il2cpp_class_get_fields_ptr 0x084D6930
|
||||||
|
#define il2cpp_class_get_flags_ptr 0x084D6940
|
||||||
|
#define il2cpp_class_get_image_ptr 0x084D6EF0
|
||||||
|
#define il2cpp_class_get_interfaces_ptr 0x084D6950
|
||||||
|
#define il2cpp_class_get_method_from_name_ptr 0x084D6960
|
||||||
|
#define il2cpp_class_get_methods_ptr 0x084D6970
|
||||||
|
#define il2cpp_class_get_name_ptr 0x084D7050
|
||||||
|
#define il2cpp_class_get_namespace_ptr 0x084D7010
|
||||||
|
#define il2cpp_class_get_nested_types_ptr 0x084D6980
|
||||||
|
#define il2cpp_class_get_parent_ptr 0x084D6990
|
||||||
|
#define il2cpp_class_get_properties_ptr 0x084D69A0
|
||||||
|
#define il2cpp_class_get_property_from_name_ptr 0x084D69B0
|
||||||
|
#define il2cpp_class_get_type_ptr 0x084D70A0
|
||||||
|
#define il2cpp_class_has_attribute_ptr 0x084D69C0
|
||||||
|
#define il2cpp_class_has_parent_ptr 0x084D69D0
|
||||||
|
#define il2cpp_class_has_references_ptr 0x084D69E0
|
||||||
|
#define il2cpp_class_instance_size_ptr 0x084D69F0
|
||||||
|
#define il2cpp_class_is_abstract_ptr 0x084D6A00
|
||||||
|
#define il2cpp_class_is_assignable_from_ptr 0x0048D2A0
|
||||||
|
#define il2cpp_class_is_blittable_ptr 0x084D6A10
|
||||||
|
#define il2cpp_class_is_enum_ptr 0x084D6A20
|
||||||
|
#define il2cpp_class_is_generic_ptr 0x084D6A30
|
||||||
|
#define il2cpp_class_is_inflated_ptr 0x084D6A40
|
||||||
|
#define il2cpp_class_is_interface_ptr 0x084D6A50
|
||||||
|
#define il2cpp_class_is_subclass_of_ptr 0x084D6A60
|
||||||
|
#define il2cpp_class_is_valuetype_ptr 0x084D6A70
|
||||||
|
#define il2cpp_class_num_fields_ptr 0x084D6A80
|
||||||
|
#define il2cpp_class_value_size_ptr 0x084D6A90
|
||||||
|
#define il2cpp_current_thread_get_frame_at_ptr 0x084D6AA0
|
||||||
|
#define il2cpp_current_thread_get_stack_depth_ptr 0x084D6AB0
|
||||||
|
#define il2cpp_current_thread_get_top_frame_ptr 0x084D6AD0
|
||||||
|
#define il2cpp_current_thread_walk_frame_stack_ptr 0x084D6AE0
|
||||||
|
#define il2cpp_domain_assembly_open_ptr 0x084D6AF0
|
||||||
|
#define il2cpp_domain_get_ptr 0x084D6B00
|
||||||
|
#define il2cpp_domain_get_assemblies_ptr 0x084D6B10
|
||||||
|
#define il2cpp_enable_object_type_mutex_ptr 0x084D6B40
|
||||||
|
#define il2cpp_exception_from_name_msg_ptr 0x084D6B50
|
||||||
|
#define il2cpp_field_get_flags_ptr 0x084D6B60
|
||||||
|
#define il2cpp_field_get_name_ptr 0x084D6EF0
|
||||||
|
#define il2cpp_field_get_offset_ptr 0x084D6B70
|
||||||
|
#define il2cpp_field_get_parent_ptr 0x084D7050
|
||||||
|
#define il2cpp_field_get_type_ptr 0x084D6B80
|
||||||
|
#define il2cpp_field_get_value_ptr 0x084D6B90
|
||||||
|
#define il2cpp_field_get_value_object_ptr 0x084D6BA0
|
||||||
|
#define il2cpp_field_has_attribute_ptr 0x084D6BB0
|
||||||
|
#define il2cpp_field_set_value_ptr 0x084D6BC0
|
||||||
|
#define il2cpp_field_set_value_object_ptr 0x084D6BD0
|
||||||
|
#define il2cpp_field_static_get_value_ptr 0x084D6BE0
|
||||||
|
#define il2cpp_field_static_set_value_ptr 0x084D6BF0
|
||||||
|
#define il2cpp_format_exception_ptr 0x084D6C00
|
||||||
|
#define il2cpp_format_stack_trace_ptr 0x084D6CB0
|
||||||
|
#define il2cpp_free_ptr 0x084D6D60
|
||||||
|
#define il2cpp_free_captured_memory_snapshot_ptr 0x084D6D70
|
||||||
|
#define il2cpp_gc_collect_ptr 0x08520560
|
||||||
|
#define il2cpp_gc_collect_a_little_ptr 0x084D6D80
|
||||||
|
#define il2cpp_gc_disable_ptr 0x084D6D90
|
||||||
|
#define il2cpp_gc_dump_append_text_to_log_ptr 0x084D6DA0
|
||||||
|
#define il2cpp_gc_dump_info_ptr 0x084D6DB0
|
||||||
|
#define il2cpp_gc_dump_set_large_allocated_block_found_callback_ptr 0x084D6DC0
|
||||||
|
#define il2cpp_gc_dump_set_small_allocated_block_found_callback_ptr 0x084D6DD0
|
||||||
|
#define il2cpp_gc_enable_ptr 0x084D6DE0
|
||||||
|
#define il2cpp_gc_get_heap_size_ptr 0x084D6DF0
|
||||||
|
#define il2cpp_gc_get_used_size_ptr 0x084D6E00
|
||||||
|
#define il2cpp_gc_set_object_malloc_callback_ptr 0x084D6E10
|
||||||
|
#define il2cpp_gc_set_object_return_freelist_callback_ptr 0x084D6E20
|
||||||
|
#define il2cpp_gchandle_free_ptr 0x085116A0
|
||||||
|
#define il2cpp_gchandle_get_target_ptr 0x084D6E30
|
||||||
|
#define il2cpp_gchandle_new_ptr 0x084D6E40
|
||||||
|
#define il2cpp_gchandle_new_weakref_ptr 0x084D6E50
|
||||||
|
#define il2cpp_get_committed_memory_size_ptr 0x084D6E60
|
||||||
|
#define il2cpp_get_corlib_ptr 0x084D6E70
|
||||||
|
#define il2cpp_get_exception_argument_null_ptr 0x084D6E80
|
||||||
|
#define il2cpp_get_gc_suspend_wait_tick_ptr 0x084D6E90
|
||||||
|
#define il2cpp_get_hash_table_memory_ptr 0x084D6EA0
|
||||||
|
#define il2cpp_get_meta_data_pool_memory_ptr 0x084D6EB0
|
||||||
|
#define il2cpp_image_get_assembly_ptr 0x084D6ED0
|
||||||
|
#define il2cpp_image_get_entry_point_ptr 0x084D6EE0
|
||||||
|
#define il2cpp_image_get_filename_ptr 0x084D6EF0
|
||||||
|
#define il2cpp_image_get_name_ptr 0x084D6EF0
|
||||||
|
#define il2cpp_init_ptr 0x084D6F00
|
||||||
|
#define il2cpp_init_security_ptr 0x084D6F30
|
||||||
|
#define il2cpp_init_utf16_ptr 0x084D6F50
|
||||||
|
#define il2cpp_is_vm_thread_ptr 0x084D7000
|
||||||
|
#define il2cpp_method_get_class_ptr 0x084D7010
|
||||||
|
#define il2cpp_method_get_declaring_type_ptr 0x084D7010
|
||||||
|
#define il2cpp_method_get_flags_ptr 0x084D7020
|
||||||
|
#define il2cpp_method_get_name_ptr 0x084D7050
|
||||||
|
#define il2cpp_method_get_object_ptr 0x084D7060
|
||||||
|
#define il2cpp_method_get_param_ptr 0x084D7070
|
||||||
|
#define il2cpp_method_get_param_count_ptr 0x084D7080
|
||||||
|
#define il2cpp_method_get_param_name_ptr 0x084D7090
|
||||||
|
#define il2cpp_method_get_return_type_ptr 0x084D70A0
|
||||||
|
#define il2cpp_method_get_token_ptr 0x084D70B0
|
||||||
|
#define il2cpp_method_has_attribute_ptr 0x084D70C0
|
||||||
|
#define il2cpp_method_is_generic_ptr 0x084D70D0
|
||||||
|
#define il2cpp_method_is_inflated_ptr 0x084D70E0
|
||||||
|
#define il2cpp_method_is_instance_ptr 0x084D70F0
|
||||||
|
#define il2cpp_monitor_enter_ptr 0x084D7100
|
||||||
|
#define il2cpp_monitor_exit_ptr 0x084D7110
|
||||||
|
#define il2cpp_monitor_pulse_ptr 0x084D7120
|
||||||
|
#define il2cpp_monitor_pulse_all_ptr 0x084D7130
|
||||||
|
#define il2cpp_monitor_try_enter_ptr 0x084D7140
|
||||||
|
#define il2cpp_monitor_try_wait_ptr 0x084D7150
|
||||||
|
#define il2cpp_monitor_wait_ptr 0x084D7160
|
||||||
|
#define il2cpp_object_get_class_ptr 0x084D6EF0
|
||||||
|
#define il2cpp_object_get_size_ptr 0x084D7170
|
||||||
|
#define il2cpp_object_get_virtual_method_ptr 0x084D7180
|
||||||
|
#define il2cpp_object_new_ptr 0x084D7190
|
||||||
|
#define il2cpp_object_unbox_ptr 0x084D71B0
|
||||||
|
#define il2cpp_profiler_install_ptr 0x084D71C0
|
||||||
|
#define il2cpp_profiler_install_allocation_ptr 0x084D71D0
|
||||||
|
#define il2cpp_profiler_install_enter_leave_ptr 0x084D71E0
|
||||||
|
#define il2cpp_profiler_install_fileio_ptr 0x084D71F0
|
||||||
|
#define il2cpp_profiler_install_gc_ptr 0x084D7200
|
||||||
|
#define il2cpp_profiler_set_events_ptr 0x084D7210
|
||||||
|
#define il2cpp_property_get_flags_ptr 0x084D7220
|
||||||
|
#define il2cpp_property_get_get_method_ptr 0x084D7050
|
||||||
|
#define il2cpp_property_get_name_ptr 0x084D6B80
|
||||||
|
#define il2cpp_property_get_parent_ptr 0x084D6EF0
|
||||||
|
#define il2cpp_property_get_set_method_ptr 0x084D7010
|
||||||
|
#define il2cpp_raise_exception_ptr 0x084D7230
|
||||||
|
#define il2cpp_register_filedelete_callback_ptr 0x084D7240
|
||||||
|
#define il2cpp_register_filemodify_callback_ptr 0x084D7250
|
||||||
|
#define il2cpp_register_log_callback_ptr 0x084D7260
|
||||||
|
#define il2cpp_resolve_icall_ptr 0x084D7270
|
||||||
|
#define il2cpp_runtime_class_init_ptr 0x084D7280
|
||||||
|
#define il2cpp_runtime_invoke_ptr 0x084D7290
|
||||||
|
#define il2cpp_runtime_invoke_convert_args_ptr 0x084D72B0
|
||||||
|
#define il2cpp_runtime_object_init_ptr 0x084D72D0
|
||||||
|
#define il2cpp_runtime_object_init_exception_ptr 0x084D72E0
|
||||||
|
#define il2cpp_runtime_unhandled_exception_policy_set_ptr 0x084D72F0
|
||||||
|
#define il2cpp_set_commandline_arguments_ptr 0x084D7300
|
||||||
|
#define il2cpp_set_commandline_arguments_utf16_ptr 0x084D7310
|
||||||
|
#define il2cpp_set_config_ptr 0x084D7320
|
||||||
|
#define il2cpp_set_config_dir_ptr 0x084D7330
|
||||||
|
#define il2cpp_set_config_utf16_ptr 0x084D7340
|
||||||
|
#define il2cpp_set_data_dir_ptr 0x084D7350
|
||||||
|
#define il2cpp_set_disable_gc_parallel_mark_ptr 0x084D7360
|
||||||
|
#define il2cpp_set_find_plugin_callback_ptr 0x084D7370
|
||||||
|
#define il2cpp_set_gc_suspend_wait_tick_ptr 0x084D7380
|
||||||
|
#define il2cpp_set_memory_callbacks_ptr 0x084D7390
|
||||||
|
#define il2cpp_set_output_redirected_file_path_ptr 0x084D73A0
|
||||||
|
#define il2cpp_set_parallel_android_affinity_ptr 0x084D73B0
|
||||||
|
#define il2cpp_set_parallel_android_cupcount_ptr 0x084D73C0
|
||||||
|
#define il2cpp_set_temp_dir_ptr 0x084D73D0
|
||||||
|
#define il2cpp_shutdown_ptr 0x084D73E0
|
||||||
|
#define il2cpp_stats_dump_to_file_ptr 0x084D73F0
|
||||||
|
#define il2cpp_stats_get_value_ptr 0x084D7670
|
||||||
|
#define il2cpp_string_chars_ptr 0x084D76F0
|
||||||
|
#define il2cpp_string_intern_ptr 0x084D7700
|
||||||
|
#define il2cpp_string_is_interned_ptr 0x084D7710
|
||||||
|
#define il2cpp_string_length_ptr 0x084D7720
|
||||||
|
#define il2cpp_string_new_ptr 0x084D7730
|
||||||
|
#define il2cpp_string_new_len_ptr 0x084D7740
|
||||||
|
#define il2cpp_string_new_utf16_ptr 0x084D7750
|
||||||
|
#define il2cpp_string_new_wrapper_ptr 0x084D7730
|
||||||
|
#define il2cpp_thread_attach_ptr 0x084D7760
|
||||||
|
#define il2cpp_thread_current_ptr 0x084D7770
|
||||||
|
#define il2cpp_thread_detach_ptr 0x084D7780
|
||||||
|
#define il2cpp_thread_get_all_attached_threads_ptr 0x084D7790
|
||||||
|
#define il2cpp_thread_get_frame_at_ptr 0x084D77A0
|
||||||
|
#define il2cpp_thread_get_name_ptr 0x084D77B0
|
||||||
|
#define il2cpp_thread_get_stack_depth_ptr 0x084D77C0
|
||||||
|
#define il2cpp_thread_get_top_frame_ptr 0x084D77D0
|
||||||
|
#define il2cpp_thread_walk_frame_stack_ptr 0x084D77E0
|
||||||
|
#define il2cpp_type_get_class_or_element_class_ptr 0x084D77F0
|
||||||
|
#define il2cpp_type_get_name_ptr 0x084D7800
|
||||||
|
#define il2cpp_type_get_object_ptr 0x084D78C0
|
||||||
|
#define il2cpp_type_get_type_ptr 0x084D78D0
|
||||||
|
#define il2cpp_unhandled_exception_ptr 0x084D78E0
|
||||||
|
#define il2cpp_unity_liveness_calculation_begin_ptr 0x084D78F0
|
||||||
|
#define il2cpp_unity_liveness_calculation_end_ptr 0x084D7900
|
||||||
|
#define il2cpp_unity_liveness_calculation_from_root_ptr 0x084D7910
|
||||||
|
#define il2cpp_unity_liveness_calculation_from_statics_ptr 0x084D7920
|
||||||
|
#define il2cpp_value_box_ptr 0x0048CF00
|
480
cheat-library/src/appdata/il2cpp-api-functions.h
Normal file
480
cheat-library/src/appdata/il2cpp-api-functions.h
Normal file
@ -0,0 +1,480 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Target Unity version: 2017.4.15 - 2017.4.40
|
||||||
|
|
||||||
|
#include "il2cpp-appdata.h"
|
||||||
|
|
||||||
|
#ifndef DO_API_NO_RETURN
|
||||||
|
|
||||||
|
#define DO_API_NO_RETURN(r, n, p) DO_API(r,n,p)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_init, (const char* domain_name));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_init_utf16, (const Il2CppChar * domain_name));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_shutdown, ());
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_config_dir, (const char *config_path));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_data_dir, (const char *data_path));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_temp_dir, (const char *temp_path));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_commandline_arguments, (int argc, const char* const argv[], const char* basedir));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_commandline_arguments_utf16, (int argc, const Il2CppChar * const argv[], const char* basedir));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_config_utf16, (const Il2CppChar * executablePath));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_config, (const char* executablePath));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_memory_callbacks, (Il2CppMemoryCallbacks * callbacks));
|
||||||
|
|
||||||
|
DO_API(const Il2CppImage*, il2cpp_get_corlib, ());
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_add_internal_call, (const char* name, Il2CppMethodPointer method));
|
||||||
|
|
||||||
|
DO_API(Il2CppMethodPointer, il2cpp_resolve_icall, (const char* name));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO_API(void*, il2cpp_alloc, (size_t size));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_free, (void* ptr));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// array
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_array_class_get, (Il2CppClass * element_class, uint32_t rank));
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_array_length, (Il2CppArray * array));
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_array_get_byte_length, (Il2CppArray * array));
|
||||||
|
|
||||||
|
DO_API(Il2CppArray*, il2cpp_array_new, (Il2CppClass * elementTypeInfo, il2cpp_array_size_t length));
|
||||||
|
|
||||||
|
DO_API(Il2CppArray*, il2cpp_array_new_specific, (Il2CppClass * arrayTypeInfo, il2cpp_array_size_t length));
|
||||||
|
|
||||||
|
DO_API(Il2CppArray*, il2cpp_array_new_full, (Il2CppClass * array_class, il2cpp_array_size_t * lengths, il2cpp_array_size_t * lower_bounds));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_bounded_array_class_get, (Il2CppClass * element_class, uint32_t rank, bool bounded));
|
||||||
|
|
||||||
|
DO_API(int, il2cpp_array_element_size, (const Il2CppClass * array_class));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// assembly
|
||||||
|
|
||||||
|
DO_API(const Il2CppImage*, il2cpp_assembly_get_image, (const Il2CppAssembly * assembly));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// class
|
||||||
|
|
||||||
|
DO_API(const Il2CppType*, il2cpp_class_enum_basetype, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_generic, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_inflated, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_assignable_from, (Il2CppClass * klass, Il2CppClass * oklass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_subclass_of, (Il2CppClass * klass, Il2CppClass * klassc, bool check_interfaces));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_has_parent, (Il2CppClass * klass, Il2CppClass * klassc));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_from_il2cpp_type, (const Il2CppType * type));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_from_name, (const Il2CppImage * image, const char* namespaze, const char *name));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_from_system_type, (Il2CppReflectionType * type));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_get_element_class, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(const EventInfo*, il2cpp_class_get_events, (Il2CppClass * klass, void* *iter));
|
||||||
|
|
||||||
|
DO_API(FieldInfo*, il2cpp_class_get_fields, (Il2CppClass * klass, void* *iter));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_get_nested_types, (Il2CppClass * klass, void* *iter));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_get_interfaces, (Il2CppClass * klass, void* *iter));
|
||||||
|
|
||||||
|
DO_API(const PropertyInfo*, il2cpp_class_get_properties, (Il2CppClass * klass, void* *iter));
|
||||||
|
|
||||||
|
DO_API(const PropertyInfo*, il2cpp_class_get_property_from_name, (Il2CppClass * klass, const char *name));
|
||||||
|
|
||||||
|
DO_API(FieldInfo*, il2cpp_class_get_field_from_name, (Il2CppClass * klass, const char *name));
|
||||||
|
|
||||||
|
DO_API(const MethodInfo*, il2cpp_class_get_methods, (Il2CppClass * klass, void* *iter));
|
||||||
|
|
||||||
|
DO_API(const MethodInfo*, il2cpp_class_get_method_from_name, (Il2CppClass * klass, const char* name, int argsCount));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_class_get_name, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_class_get_namespace, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_get_parent, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_get_declaring_type, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(int32_t, il2cpp_class_instance_size, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(size_t, il2cpp_class_num_fields, (const Il2CppClass * enumKlass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_valuetype, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(int32_t, il2cpp_class_value_size, (Il2CppClass * klass, uint32_t * align));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_blittable, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(int, il2cpp_class_get_flags, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_abstract, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_interface, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(int, il2cpp_class_array_element_size, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_class_from_type, (const Il2CppType * type));
|
||||||
|
|
||||||
|
DO_API(const Il2CppType*, il2cpp_class_get_type, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_has_attribute, (Il2CppClass * klass, Il2CppClass * attr_class));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_has_references, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_class_is_enum, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(const Il2CppImage*, il2cpp_class_get_image, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_class_get_assemblyname, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// testing only
|
||||||
|
|
||||||
|
DO_API(size_t, il2cpp_class_get_bitmap_size, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_class_get_bitmap, (Il2CppClass * klass, size_t * bitmap));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// stats
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_stats_dump_to_file, (const char *path));
|
||||||
|
|
||||||
|
DO_API(uint64_t, il2cpp_stats_get_value, (Il2CppStat stat));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// domain
|
||||||
|
|
||||||
|
DO_API(Il2CppDomain*, il2cpp_domain_get, ());
|
||||||
|
|
||||||
|
DO_API(const Il2CppAssembly*, il2cpp_domain_assembly_open, (Il2CppDomain * domain, const char* name));
|
||||||
|
|
||||||
|
DO_API(const Il2CppAssembly**, il2cpp_domain_get_assemblies, (const Il2CppDomain * domain, size_t * size));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// exception
|
||||||
|
|
||||||
|
DO_API_NO_RETURN(void, il2cpp_raise_exception, (Il2CppException*));
|
||||||
|
|
||||||
|
DO_API(Il2CppException*, il2cpp_exception_from_name_msg, (const Il2CppImage * image, const char *name_space, const char *name, const char *msg));
|
||||||
|
|
||||||
|
DO_API(Il2CppException*, il2cpp_get_exception_argument_null, (const char *arg));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_format_exception, (const Il2CppException * ex, char* message, int message_size));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_format_stack_trace, (const Il2CppException * ex, char* output, int output_size));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_unhandled_exception, (Il2CppException*));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// field
|
||||||
|
|
||||||
|
DO_API(int, il2cpp_field_get_flags, (FieldInfo * field));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_field_get_name, (FieldInfo * field));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_field_get_parent, (FieldInfo * field));
|
||||||
|
|
||||||
|
DO_API(size_t, il2cpp_field_get_offset, (FieldInfo * field));
|
||||||
|
|
||||||
|
DO_API(const Il2CppType*, il2cpp_field_get_type, (FieldInfo * field));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_field_get_value, (Il2CppObject * obj, FieldInfo * field, void *value));
|
||||||
|
|
||||||
|
DO_API(Il2CppObject*, il2cpp_field_get_value_object, (FieldInfo * field, Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_field_has_attribute, (FieldInfo * field, Il2CppClass * attr_class));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_field_set_value, (Il2CppObject * obj, FieldInfo * field, void *value));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_field_static_get_value, (FieldInfo * field, void *value));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_field_static_set_value, (FieldInfo * field, void *value));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_field_set_value_object, (Il2CppObject * instance, FieldInfo * field, Il2CppObject * value));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// gc
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_gc_collect, (int maxGenerations));
|
||||||
|
|
||||||
|
DO_API(int32_t, il2cpp_gc_collect_a_little, ());
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_gc_disable, ());
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_gc_enable, ());
|
||||||
|
|
||||||
|
DO_API(int64_t, il2cpp_gc_get_used_size, ());
|
||||||
|
|
||||||
|
DO_API(int64_t, il2cpp_gc_get_heap_size, ());
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// gchandle
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_gchandle_new, (Il2CppObject * obj, bool pinned));
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_gchandle_new_weakref, (Il2CppObject * obj, bool track_resurrection));
|
||||||
|
|
||||||
|
DO_API(Il2CppObject*, il2cpp_gchandle_get_target , (uint32_t gchandle));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_gchandle_free, (uint32_t gchandle));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// liveness
|
||||||
|
|
||||||
|
DO_API(void*, il2cpp_unity_liveness_calculation_begin, (Il2CppClass * filter, int max_object_count, il2cpp_register_object_callback callback, void* userdata, il2cpp_WorldChangedCallback onWorldStarted, il2cpp_WorldChangedCallback onWorldStopped));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_unity_liveness_calculation_end, (void* state));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_unity_liveness_calculation_from_root, (Il2CppObject * root, void* state));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_unity_liveness_calculation_from_statics, (void* state));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// method
|
||||||
|
|
||||||
|
DO_API(const Il2CppType*, il2cpp_method_get_return_type, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_method_get_declaring_type, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_method_get_name, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(Il2CppReflectionMethod*, il2cpp_method_get_object, (const MethodInfo * method, Il2CppClass * refclass));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_method_is_generic, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_method_is_inflated, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_method_is_instance, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_method_get_param_count, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(const Il2CppType*, il2cpp_method_get_param, (const MethodInfo * method, uint32_t index));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_method_get_class, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_method_has_attribute, (const MethodInfo * method, Il2CppClass * attr_class));
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_method_get_flags, (const MethodInfo * method, uint32_t * iflags));
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_method_get_token, (const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_method_get_param_name, (const MethodInfo * method, uint32_t index));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// profiler
|
||||||
|
|
||||||
|
#if IL2CPP_ENABLE_PROFILER
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// property
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_property_get_flags, (PropertyInfo * prop));
|
||||||
|
|
||||||
|
DO_API(const MethodInfo*, il2cpp_property_get_get_method, (PropertyInfo * prop));
|
||||||
|
|
||||||
|
DO_API(const MethodInfo*, il2cpp_property_get_set_method, (PropertyInfo * prop));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_property_get_name, (PropertyInfo * prop));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_property_get_parent, (PropertyInfo * prop));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// object
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_object_get_class, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(uint32_t, il2cpp_object_get_size, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(const MethodInfo*, il2cpp_object_get_virtual_method, (Il2CppObject * obj, const MethodInfo * method));
|
||||||
|
|
||||||
|
DO_API(Il2CppObject*, il2cpp_object_new, (const Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(void*, il2cpp_object_unbox, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO_API(Il2CppObject*, il2cpp_value_box, (Il2CppClass * klass, void* data));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// monitor
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_monitor_enter, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_monitor_try_enter, (Il2CppObject * obj, uint32_t timeout));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_monitor_exit, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_monitor_pulse, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_monitor_pulse_all, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_monitor_wait, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_monitor_try_wait, (Il2CppObject * obj, uint32_t timeout));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// runtime
|
||||||
|
|
||||||
|
DO_API(Il2CppObject*, il2cpp_runtime_invoke, (const MethodInfo * method, void *obj, void **params, Il2CppException **exc));
|
||||||
|
|
||||||
|
DO_API(Il2CppObject*, il2cpp_runtime_invoke_convert_args, (const MethodInfo * method, void *obj, Il2CppObject **params, int paramCount, Il2CppException **exc));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_runtime_class_init, (Il2CppClass * klass));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_runtime_object_init, (Il2CppObject * obj));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_runtime_object_init_exception, (Il2CppObject * obj, Il2CppException** exc));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_runtime_unhandled_exception_policy_set, (Il2CppRuntimeUnhandledExceptionPolicy value));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// string
|
||||||
|
|
||||||
|
DO_API(int32_t, il2cpp_string_length, (Il2CppString * str));
|
||||||
|
|
||||||
|
DO_API(Il2CppChar*, il2cpp_string_chars, (Il2CppString * str));
|
||||||
|
|
||||||
|
DO_API(Il2CppString*, il2cpp_string_new, (const char* str));
|
||||||
|
|
||||||
|
DO_API(Il2CppString*, il2cpp_string_new_len, (const char* str, uint32_t length));
|
||||||
|
|
||||||
|
DO_API(Il2CppString*, il2cpp_string_new_utf16, (const Il2CppChar * text, int32_t len));
|
||||||
|
|
||||||
|
DO_API(Il2CppString*, il2cpp_string_new_wrapper, (const char* str));
|
||||||
|
|
||||||
|
DO_API(Il2CppString*, il2cpp_string_intern, (Il2CppString * str));
|
||||||
|
|
||||||
|
DO_API(Il2CppString*, il2cpp_string_is_interned, (Il2CppString * str));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// thread
|
||||||
|
|
||||||
|
DO_API(char*, il2cpp_thread_get_name, (Il2CppThread * thread, uint32_t * len));
|
||||||
|
|
||||||
|
DO_API(Il2CppThread*, il2cpp_thread_current, ());
|
||||||
|
|
||||||
|
DO_API(Il2CppThread*, il2cpp_thread_attach, (Il2CppDomain * domain));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_thread_detach, (Il2CppThread * thread));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO_API(Il2CppThread**, il2cpp_thread_get_all_attached_threads, (size_t * size));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_is_vm_thread, (Il2CppThread * thread));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// stacktrace
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_current_thread_walk_frame_stack, (Il2CppFrameWalkFunc func, void* user_data));
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_thread_walk_frame_stack, (Il2CppThread * thread, Il2CppFrameWalkFunc func, void* user_data));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_current_thread_get_top_frame, (Il2CppStackFrameInfo & frame));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_thread_get_top_frame, (Il2CppThread * thread, Il2CppStackFrameInfo & frame));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_current_thread_get_frame_at, (int32_t offset, Il2CppStackFrameInfo & frame));
|
||||||
|
|
||||||
|
DO_API(bool, il2cpp_thread_get_frame_at, (Il2CppThread * thread, int32_t offset, Il2CppStackFrameInfo & frame));
|
||||||
|
|
||||||
|
DO_API(int32_t, il2cpp_current_thread_get_stack_depth, ());
|
||||||
|
|
||||||
|
DO_API(int32_t, il2cpp_thread_get_stack_depth, (Il2CppThread * thread));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// type
|
||||||
|
|
||||||
|
DO_API(Il2CppObject*, il2cpp_type_get_object, (const Il2CppType * type));
|
||||||
|
|
||||||
|
DO_API(int, il2cpp_type_get_type, (const Il2CppType * type));
|
||||||
|
|
||||||
|
DO_API(Il2CppClass*, il2cpp_type_get_class_or_element_class, (const Il2CppType * type));
|
||||||
|
|
||||||
|
DO_API(char*, il2cpp_type_get_name, (const Il2CppType * type));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// image
|
||||||
|
|
||||||
|
DO_API(const Il2CppAssembly*, il2cpp_image_get_assembly, (const Il2CppImage * image));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_image_get_name, (const Il2CppImage * image));
|
||||||
|
|
||||||
|
DO_API(const char*, il2cpp_image_get_filename, (const Il2CppImage * image));
|
||||||
|
|
||||||
|
DO_API(const MethodInfo*, il2cpp_image_get_entry_point, (const Il2CppImage * image));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Memory information
|
||||||
|
|
||||||
|
DO_API(Il2CppManagedMemorySnapshot*, il2cpp_capture_memory_snapshot, ());
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_free_captured_memory_snapshot, (Il2CppManagedMemorySnapshot * snapshot));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_set_find_plugin_callback, (Il2CppSetFindPlugInCallback method));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// Logging
|
||||||
|
|
||||||
|
DO_API(void, il2cpp_register_log_callback, (Il2CppLogCallback method));
|
||||||
|
|
||||||
|
|
45
cheat-library/src/appdata/il2cpp-functions.h
Normal file
45
cheat-library/src/appdata/il2cpp-functions.h
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Target Unity version: 2017.4.15 - 2017.4.40
|
||||||
|
|
||||||
|
// ******************************************************************************
|
||||||
|
// * IL2CPP application-specific method definition addresses and signatures
|
||||||
|
// ******************************************************************************
|
||||||
|
using namespace app;
|
||||||
|
|
||||||
|
DO_APP_FUNC(0x05CDB4C0, void, Object__ctor, (Object* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D4FB0, bool, Object_Equals, (Object* __this, Object* obj, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D4F70, bool, Object_Equals_1, (void* __this, Object* objA, Object* objB, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x05CDB4C0, void, Object_Finalize, (Object* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D4FC0, int32_t, Object_GetHashCode, (Object* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D4FD0, Type*, Object_GetType, (Object* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D4FF0, Object*, Object_MemberwiseClone, (Object* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D5000, String*, Object_ToString, (Object* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x079EA1F0, bool, Object_ReferenceEquals, (void* __this, Object* objA, Object* objB, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D4FE0, int32_t, Object_InternalGetHashCode, (void* __this, Object* o, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x067D5030, void*, Object_obj_address, (Object* __this, MethodInfo* method));
|
||||||
|
|
||||||
|
DO_APP_FUNC(0x052CC900, Byte__Array*, LuaManager_LoadCustomLuaFile, (LuaManager* __this, String** filePath, bool* recycleBytes, MethodInfo* method));
|
||||||
|
|
||||||
|
// ELIHHCKMPNE_ALEDHGAIDHN
|
||||||
|
DO_APP_FUNC(0x0175BD10, void, GameLogin_CheckGameIntegrity, (GameLogin* __this, String* someString, uint32_t someInt, MethodInfo* method));
|
||||||
|
|
||||||
|
DO_APP_FUNC(0x06C66FF0, String*, DateTime_ToLongDateString, (DateTime__Boxed* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x06C67070, String*, DateTime_ToLongTimeString, (DateTime__Boxed* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x06C671B0, double, DateTime_ToOADate, (DateTime__Boxed* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x06C671C0, String*, DateTime_ToShortDateString, (DateTime__Boxed* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x06C67200, String*, DateTime_ToShortTimeString, (DateTime__Boxed* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x06C67500, String*, DateTime_ToString, (DateTime__Boxed* __this, MethodInfo* method));
|
||||||
|
|
||||||
|
DO_APP_FUNC(0x037B8580, void, GameLogin_SendInfo_2, (GameLogin* __this, GKOJAICIOPA* info, MethodInfo* method));
|
||||||
|
DO_APP_FUNC_METHODINFO(0x0B25C800, GameLogin_SendInfo_2__MethodInfo);
|
||||||
|
|
||||||
|
DO_APP_FUNC(0x03747530, void, GKOJAICIOPA_JINHMKCMECH, (GKOJAICIOPA* __this, String* JOJAAEDKLKK, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x03743E30, String*, GKOJAICIOPA_GJLJLNPHKBA, (GKOJAICIOPA* __this, MethodInfo* method));
|
||||||
|
|
||||||
|
DO_APP_FUNC(0x0705AB30, Array*, Array_CreateInstance, (void* __this, app::Type* elementType, int32_t length, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x0705E3C0, int32_t, Array_get_Length, (Array* __this, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x0705CC70, void, Array_SetValue_1, (Array* __this, Object* value, int64_t index, MethodInfo* method));
|
||||||
|
DO_APP_FUNC_METHODINFO(0x0B1AA908, Array_SetValue_1__MethodInfo);
|
||||||
|
|
||||||
|
DO_APP_FUNC(0x074AAAB0, Byte__Array*, Application_RecordUserData, (void* __this, int32_t nType, MethodInfo* method));
|
||||||
|
DO_APP_FUNC(0x070598A0, Object*, Array_Clone, (Array* __this, MethodInfo* method));
|
4
cheat-library/src/appdata/il2cpp-metadata-version.h
Normal file
4
cheat-library/src/appdata/il2cpp-metadata-version.h
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Target Unity version: 2017.4.15 - 2017.4.40
|
||||||
|
|
||||||
|
#define __IL2CPP_METADATA_VERSION 240
|
8
cheat-library/src/appdata/il2cpp-types-ptr.h
Normal file
8
cheat-library/src/appdata/il2cpp-types-ptr.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Target Unity version: 2017.4.15 - 2017.4.40
|
||||||
|
|
||||||
|
// ******************************************************************************
|
||||||
|
// * IL2CPP application-specific type definition addresses
|
||||||
|
// ******************************************************************************
|
||||||
|
|
||||||
|
DO_TYPEDEF(0x0B2FD1A8, Byte);
|
3416
cheat-library/src/appdata/il2cpp-types.h
Normal file
3416
cheat-library/src/appdata/il2cpp-types.h
Normal file
File diff suppressed because it is too large
Load Diff
4
cheat-library/src/appdata/il2cpp-unityplayer-functions.h
Normal file
4
cheat-library/src/appdata/il2cpp-unityplayer-functions.h
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
using namespace app;
|
||||||
|
|
||||||
|
DO_APP_FUNC(0xD50040, app::Byte__Array*, Unity_RecordUserData, (int32_t nType));
|
||||||
|
DO_APP_FUNC(0xCF5570, Il2CppClass**, GetIl2Classes, ());
|
26
cheat-library/src/framework/dllmain.cpp
Normal file
26
cheat-library/src/framework/dllmain.cpp
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// DLL entry point
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#include "il2cpp-init.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
// DLL entry point
|
||||||
|
BOOL WINAPI DllMain( HMODULE hModule,
|
||||||
|
DWORD ul_reason_for_call,
|
||||||
|
LPVOID lpReserved
|
||||||
|
)
|
||||||
|
{
|
||||||
|
switch (ul_reason_for_call)
|
||||||
|
{
|
||||||
|
case DLL_PROCESS_ATTACH:
|
||||||
|
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE) Run, nullptr, 0, NULL);
|
||||||
|
break;
|
||||||
|
case DLL_THREAD_ATTACH:
|
||||||
|
case DLL_THREAD_DETACH:
|
||||||
|
case DLL_PROCESS_DETACH:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
38
cheat-library/src/framework/helpers.cpp
Normal file
38
cheat-library/src/framework/helpers.cpp
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Helper functions
|
||||||
|
|
||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#include <windows.h>
|
||||||
|
#include <string>
|
||||||
|
#include <codecvt>
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
|
// Helper function to get the module base address
|
||||||
|
uintptr_t il2cppi_get_base_address() {
|
||||||
|
return (uintptr_t) GetModuleHandleW(L"UserAssembly.dll");
|
||||||
|
}
|
||||||
|
|
||||||
|
uintptr_t il2cppi_get_unity_address() {
|
||||||
|
return (uintptr_t)GetModuleHandleW(L"UnityPlayer.dll");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to open a new console window and redirect stdout there
|
||||||
|
void il2cppi_new_console() {
|
||||||
|
AllocConsole();
|
||||||
|
freopen_s((FILE**) stdout, "CONOUT$", "w", stdout);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1920
|
||||||
|
// Helper function to convert Il2CppString to std::string
|
||||||
|
std::string il2cppi_to_string(Il2CppString* str) {
|
||||||
|
std::u16string u16(reinterpret_cast<const char16_t*>(str->chars), str->length);
|
||||||
|
return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>{}.to_bytes(u16);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to convert System.String to std::string
|
||||||
|
std::string il2cppi_to_string(app::String* str) {
|
||||||
|
return il2cppi_to_string(reinterpret_cast<Il2CppString*>(str));
|
||||||
|
}
|
||||||
|
#endif
|
44
cheat-library/src/framework/helpers.h
Normal file
44
cheat-library/src/framework/helpers.h
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Helper functions
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <sstream>
|
||||||
|
#include <iomanip>
|
||||||
|
|
||||||
|
#include "il2cpp-metadata-version.h"
|
||||||
|
|
||||||
|
// Helper function to get the module base address
|
||||||
|
uintptr_t il2cppi_get_base_address();
|
||||||
|
|
||||||
|
// Helpre function to get the UnityPlayer.dll base address
|
||||||
|
uintptr_t il2cppi_get_unity_address();
|
||||||
|
|
||||||
|
// Helper function to open a new console window and redirect stdout there
|
||||||
|
void il2cppi_new_console();
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1920
|
||||||
|
// Helper function to convert Il2CppString to std::string
|
||||||
|
std::string il2cppi_to_string(Il2CppString* str);
|
||||||
|
|
||||||
|
// Helper function to convert System.String to std::string
|
||||||
|
std::string il2cppi_to_string(app::String* str);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Helper function to check if a metadata usage pointer is initialized
|
||||||
|
template<typename T> bool il2cppi_is_initialized(T* metadataItem) {
|
||||||
|
#if __IL2CPP_METADATA_VERISON < 270
|
||||||
|
return *metadataItem != 0;
|
||||||
|
#else
|
||||||
|
// Metadata >=27 (Unity 2020.2)
|
||||||
|
return !((uintptr_t) *metadataItem & 1);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
// Helper function to convert a pointer to hex
|
||||||
|
template<typename T> std::string to_hex_string(T i) {
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << "0x" << std::setfill('0') << std::setw(sizeof(T) * 2) << std::hex << i;
|
||||||
|
return stream.str();
|
||||||
|
}
|
34
cheat-library/src/framework/il2cpp-appdata.h
Normal file
34
cheat-library/src/framework/il2cpp-appdata.h
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// IL2CPP application data
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
// Application-specific types
|
||||||
|
#include "il2cpp-types.h"
|
||||||
|
|
||||||
|
// IL2CPP API function pointers
|
||||||
|
#include "il2cpp-api-functions-ptr.h"
|
||||||
|
|
||||||
|
// IL2CPP APIs
|
||||||
|
#define DO_API(r, n, p) extern r (*n) p
|
||||||
|
#include "il2cpp-api-functions.h"
|
||||||
|
#undef DO_API
|
||||||
|
|
||||||
|
// Application-specific functions
|
||||||
|
#define DO_APP_FUNC(a, r, n, p) extern r (*n) p
|
||||||
|
#define DO_APP_FUNC_METHODINFO(a, n) extern struct MethodInfo ** n
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-functions.h"
|
||||||
|
#include "il2cpp-unityplayer-functions.h"
|
||||||
|
}
|
||||||
|
#undef DO_APP_FUNC
|
||||||
|
#undef DO_APP_FUNC_METHODINFO
|
||||||
|
|
||||||
|
// TypeInfo pointers
|
||||||
|
#define DO_TYPEDEF(a, n) extern n ## __Class** n ## __TypeInfo
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-types-ptr.h"
|
||||||
|
}
|
||||||
|
#undef DO_TYPEDEF
|
63
cheat-library/src/framework/il2cpp-init.cpp
Normal file
63
cheat-library/src/framework/il2cpp-init.cpp
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// IL2CPP application initializer
|
||||||
|
|
||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#include "il2cpp-init.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
|
||||||
|
// IL2CPP APIs
|
||||||
|
#define DO_API(r, n, p) r (*n) p
|
||||||
|
#include "il2cpp-api-functions.h"
|
||||||
|
#undef DO_API
|
||||||
|
|
||||||
|
// Application-specific functions
|
||||||
|
#define DO_APP_FUNC(a, r, n, p) r (*n) p
|
||||||
|
#define DO_APP_FUNC_METHODINFO(a, n) struct MethodInfo ** n
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-functions.h"
|
||||||
|
#include "il2cpp-unityplayer-functions.h"
|
||||||
|
}
|
||||||
|
#undef DO_APP_FUNC
|
||||||
|
#undef DO_APP_FUNC_METHODINFO
|
||||||
|
|
||||||
|
// TypeInfo pointers
|
||||||
|
#define DO_TYPEDEF(a, n) n ## __Class** n ## __TypeInfo
|
||||||
|
namespace app {
|
||||||
|
#include "il2cpp-types-ptr.h"
|
||||||
|
}
|
||||||
|
#undef DO_TYPEDEF
|
||||||
|
|
||||||
|
// IL2CPP application initializer
|
||||||
|
void init_il2cpp()
|
||||||
|
{
|
||||||
|
// Get base address of IL2CPP module
|
||||||
|
uintptr_t baseAddress = il2cppi_get_base_address();
|
||||||
|
|
||||||
|
using namespace app;
|
||||||
|
|
||||||
|
// Define IL2CPP API function addresses
|
||||||
|
#define DO_API(r, n, p) n = (r (*) p)(baseAddress + n ## _ptr)
|
||||||
|
#include "il2cpp-api-functions.h"
|
||||||
|
#undef DO_API
|
||||||
|
|
||||||
|
// Define function addresses
|
||||||
|
#define DO_APP_FUNC(a, r, n, p) n = (r (*) p)(baseAddress + a)
|
||||||
|
#define DO_APP_FUNC_METHODINFO(a, n) n = (struct MethodInfo **)(baseAddress + a)
|
||||||
|
#include "il2cpp-functions.h"
|
||||||
|
#undef DO_APP_FUNC
|
||||||
|
#undef DO_APP_FUNC_METHODINFO
|
||||||
|
|
||||||
|
// Define TypeInfo variables
|
||||||
|
#define DO_TYPEDEF(a, n) n ## __TypeInfo = (n ## __Class**) (baseAddress + a);
|
||||||
|
#include "il2cpp-types-ptr.h"
|
||||||
|
#undef DO_TYPEDEF
|
||||||
|
|
||||||
|
uintptr_t unityPlayerAddress = il2cppi_get_unity_address();
|
||||||
|
// Define UnityPlayer functions
|
||||||
|
#define DO_APP_FUNC(a, r, n, p) n = (r (*) p)(unityPlayerAddress + a)
|
||||||
|
#define DO_APP_FUNC_METHODINFO(a, n) n = (struct MethodInfo **)(unityPlayerAddress + a)
|
||||||
|
#include "il2cpp-unityplayer-functions.h"
|
||||||
|
#undef DO_APP_FUNC
|
||||||
|
#undef DO_APP_FUNC_METHODINFO
|
||||||
|
}
|
7
cheat-library/src/framework/il2cpp-init.h
Normal file
7
cheat-library/src/framework/il2cpp-init.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// IL2CPP application initializer
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// IL2CPP application initializer
|
||||||
|
void init_il2cpp();
|
5
cheat-library/src/framework/pch-il2cpp.cpp
Normal file
5
cheat-library/src/framework/pch-il2cpp.cpp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
// pch.cpp: source file corresponding to the pre-compiled header
|
||||||
|
|
||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.
|
13
cheat-library/src/framework/pch-il2cpp.h
Normal file
13
cheat-library/src/framework/pch-il2cpp.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// pch.h: This is a precompiled header file.
|
||||||
|
// Files listed below are compiled only once, improving build performance for future builds.
|
||||||
|
// This also affects IntelliSense performance, including code completion and many code browsing features.
|
||||||
|
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
|
||||||
|
// Do not add files here that you will be updating frequently as this negates the performance advantage.
|
||||||
|
|
||||||
|
#ifndef PCH_IL2CPP_H
|
||||||
|
#define PCH_IL2CPP_H
|
||||||
|
|
||||||
|
// add headers that you want to pre-compile here
|
||||||
|
#include "il2cpp-appdata.h"
|
||||||
|
|
||||||
|
#endif //PCH_IL2CPP_H
|
50
cheat-library/src/user/debug-hooks.cpp
Normal file
50
cheat-library/src/user/debug-hooks.cpp
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#include "debug-hooks.h"
|
||||||
|
|
||||||
|
#include "util/HookManager.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
app::Byte__Array* LoadCustomLuaFile_Hook(app::LuaManager* __this, app::String** filePath, bool* recycleBytes, MethodInfo* method) {
|
||||||
|
std::cout << "Load library: " << il2cppi_to_string(*filePath) << ".lua" << std::endl;
|
||||||
|
return callOrigin(LoadCustomLuaFile_Hook, __this, filePath, recycleBytes, method);
|
||||||
|
}
|
||||||
|
|
||||||
|
void __stdcall SendInfo_Hook(app::GameLogin* __this, app::GKOJAICIOPA* info, MethodInfo* method) {
|
||||||
|
std::cout << "Game sending game info to server." << std::endl;
|
||||||
|
std::cout << "Content: " << std::endl;
|
||||||
|
|
||||||
|
#define printString(i) if (info->fields.string_ ## i > (void *)1 && info->fields.string_ ## i ##->fields.length > 0)\
|
||||||
|
std::cout << "\tfield#" << i << ": " << il2cppi_to_string(info->fields.string_ ## i) << std::endl;
|
||||||
|
|
||||||
|
printString(1);
|
||||||
|
printString(2);
|
||||||
|
printString(3);
|
||||||
|
printString(4);
|
||||||
|
printString(5);
|
||||||
|
printString(6);
|
||||||
|
printString(7);
|
||||||
|
printString(8);
|
||||||
|
printString(9);
|
||||||
|
printString(10);
|
||||||
|
printString(11);
|
||||||
|
printString(12);
|
||||||
|
printString(13);
|
||||||
|
printString(14);
|
||||||
|
printString(15);
|
||||||
|
printString(16);
|
||||||
|
|
||||||
|
#undef printString
|
||||||
|
|
||||||
|
callOrigin(SendInfo_Hook, __this, info, method);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InitDebugHooks() {
|
||||||
|
HookManager::set(app::LuaManager_LoadCustomLuaFile, LoadCustomLuaFile_Hook);
|
||||||
|
std::cout << "Hooked LoadCustomLuaFile. Origin at 0x" << (void*)HookManager::getOrigin(LoadCustomLuaFile_Hook) << std::endl;
|
||||||
|
|
||||||
|
HookManager::set(app::GameLogin_SendInfo_2, SendInfo_Hook);
|
||||||
|
std::cout << "Hooked GameLogin::SendGameInfo. Origin at 0x" << (void*)HookManager::getOrigin(SendInfo_Hook) << std::endl;
|
||||||
|
}
|
3
cheat-library/src/user/debug-hooks.h
Normal file
3
cheat-library/src/user/debug-hooks.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
void InitDebugHooks();
|
40
cheat-library/src/user/main.cpp
Normal file
40
cheat-library/src/user/main.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#include "pch-il2cpp.h"
|
||||||
|
#include "main.h"
|
||||||
|
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
|
#include <filesystem>
|
||||||
|
#include <string>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "il2cpp-init.h"
|
||||||
|
#include "helpers.h"
|
||||||
|
#include "util/Config.h"
|
||||||
|
#include "debug-hooks.h"
|
||||||
|
#include "protection-bypass.h"
|
||||||
|
|
||||||
|
const char* INIFileName = "config.ini";
|
||||||
|
|
||||||
|
void Run()
|
||||||
|
{
|
||||||
|
Sleep(2000); // Waiting for il2cpp initialize
|
||||||
|
|
||||||
|
init_il2cpp();
|
||||||
|
|
||||||
|
il2cpp_thread_attach(il2cpp_domain_get());
|
||||||
|
|
||||||
|
std::string configPath = (std::filesystem::current_path() / INIFileName).string();
|
||||||
|
Config::Init(configPath);
|
||||||
|
if (Config::consoleLogging)
|
||||||
|
il2cppi_new_console();
|
||||||
|
|
||||||
|
std::cout << "Config path is " << (std::filesystem::current_path() / INIFileName).string() << std::endl;
|
||||||
|
std::cout << "UserAssembly.dll at 0x" << il2cppi_get_base_address() << std::endl;
|
||||||
|
std::cout << "UnityPlayer.dll at 0x" << il2cppi_get_unity_address() << std::endl;
|
||||||
|
|
||||||
|
InitProtectionBypass();
|
||||||
|
|
||||||
|
InitDebugHooks();
|
||||||
|
}
|
7
cheat-library/src/user/main.h
Normal file
7
cheat-library/src/user/main.h
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
// Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty
|
||||||
|
// Custom injected code entry point
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
// Custom injected code entry point
|
||||||
|
void Run();
|
60
cheat-library/src/user/protection-bypass.cpp
Normal file
60
cheat-library/src/user/protection-bypass.cpp
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#include "protection-bypass.h"
|
||||||
|
|
||||||
|
#include "util/HookManager.h"
|
||||||
|
#include "util/Config.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include <util/util.h>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
static std::map<int32_t, std::string> correctSignatures;
|
||||||
|
|
||||||
|
app::Byte__Array* RecordUserData_Hook(int32_t nType) {
|
||||||
|
|
||||||
|
if (correctSignatures.count(nType))
|
||||||
|
{
|
||||||
|
auto byteClass = app::GetIl2Classes()[0x25];
|
||||||
|
|
||||||
|
auto content = correctSignatures[nType];
|
||||||
|
auto newArray = (app::Byte__Array*)il2cpp_array_new(byteClass, content.size());
|
||||||
|
memmove_s(newArray->vector, content.size(), content.data(), content.size());
|
||||||
|
|
||||||
|
return newArray;
|
||||||
|
}
|
||||||
|
|
||||||
|
app::Byte__Array* result = callOrigin(RecordUserData_Hook, nType);
|
||||||
|
auto length = app::Array_get_Length(reinterpret_cast<app::Array*>(result), nullptr);
|
||||||
|
|
||||||
|
if (length == 0)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
|
||||||
|
auto stringValue = std::string((char*)result->vector, length);
|
||||||
|
correctSignatures[nType] = stringValue;
|
||||||
|
|
||||||
|
std::cout << "Sniffed correct signature for type " << nType << " value " << stringValue << std::endl;
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void InitProtectionBypass() {
|
||||||
|
HookManager::set(app::Unity_RecordUserData, RecordUserData_Hook);
|
||||||
|
std::cout << "RecordUserData function address is 0x" << (void*)app::Unity_RecordUserData << std::endl;
|
||||||
|
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
std::cout << "Emulating call of RecordUserData with type " << i << std::endl;
|
||||||
|
app::Application_RecordUserData(nullptr, i, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Config::disableMhyProt) {
|
||||||
|
std::cout << "Trying to close mhyprot handle." << std::endl;
|
||||||
|
if (CloseHandleByName(L"\\Device\\mhyprot2"))
|
||||||
|
std::cout << "Mhyprot2 handle successfuly closed. Happy hacking ^)" << std::endl;
|
||||||
|
else
|
||||||
|
std::cout << "Failed closing mhyprot2 handle. Maybe dev updated driver." << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
3
cheat-library/src/user/protection-bypass.h
Normal file
3
cheat-library/src/user/protection-bypass.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
void InitProtectionBypass();
|
29
cheat-library/src/user/util/Config.cpp
Normal file
29
cheat-library/src/user/util/Config.cpp
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#include "pch-il2cpp.h"
|
||||||
|
|
||||||
|
#include "Config.h"
|
||||||
|
|
||||||
|
#include "simple-ini.hpp"
|
||||||
|
|
||||||
|
bool Config::disableMhyProt = false;
|
||||||
|
bool Config::consoleLogging = false;
|
||||||
|
bool Config::fileLogging = false;
|
||||||
|
|
||||||
|
static CSimpleIni ini;
|
||||||
|
static bool changed = false;
|
||||||
|
|
||||||
|
bool LoadBool(const char* section, const char* key, bool defaultValue = false) {
|
||||||
|
auto result = ini.GetBoolValue(section, key, defaultValue);
|
||||||
|
ini.SetBoolValue(section, key, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Config::Init(const std::string& configFile)
|
||||||
|
{
|
||||||
|
ini.LoadFile(configFile.c_str());
|
||||||
|
|
||||||
|
disableMhyProt = LoadBool("DLLUtil", "DisableMhyprot", true);
|
||||||
|
consoleLogging = LoadBool("DLLUtil", "ConsoleLogging", true);
|
||||||
|
fileLogging = LoadBool("DLLUtil", "FileLogging", true);
|
||||||
|
|
||||||
|
ini.SaveFile(configFile.c_str());
|
||||||
|
}
|
11
cheat-library/src/user/util/Config.h
Normal file
11
cheat-library/src/user/util/Config.h
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
class Config {
|
||||||
|
public:
|
||||||
|
static bool disableMhyProt;
|
||||||
|
static bool fileLogging;
|
||||||
|
static bool consoleLogging;
|
||||||
|
|
||||||
|
static void Init(const std::string& configFile);
|
||||||
|
};
|
40
cheat-library/src/user/util/HookManager.cpp
Normal file
40
cheat-library/src/user/util/HookManager.cpp
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#include "pch-il2cpp.h"
|
||||||
|
#include "HookManager.h"
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
std::map<void*, void*> HookManager::holderMap;
|
||||||
|
|
||||||
|
//template<typename Fn>
|
||||||
|
//static void HookManager::set(Fn func, Fn handler) noexcept
|
||||||
|
//{
|
||||||
|
// auto existHolder = get(handler);
|
||||||
|
// if (existHolder != nullptr)
|
||||||
|
// existHolder->disable();
|
||||||
|
//
|
||||||
|
// auto holder = HookFactory::install(func, handler);
|
||||||
|
// holderMap[handler] = holder;
|
||||||
|
//}
|
||||||
|
|
||||||
|
//template<typename Fn>
|
||||||
|
//static HookHolder<Fn>* HookManager::get(Fn handler) noexcept
|
||||||
|
//{
|
||||||
|
// if (holderMap.count(handler) == 0)
|
||||||
|
// return nullptr;
|
||||||
|
// return (HookHolder<Fn>)* holderMap[handler];
|
||||||
|
//}
|
||||||
|
|
||||||
|
//template<typename Fn>
|
||||||
|
//static Fn* HookManager::getOrigin(Fn handler) noexcept
|
||||||
|
//{
|
||||||
|
// auto holder = get(handler);
|
||||||
|
// if (holder == nullptr)
|
||||||
|
// return nullptr;
|
||||||
|
// return &holder->origin();
|
||||||
|
//}
|
||||||
|
//
|
||||||
|
//template<typename Fn>
|
||||||
|
//static void HookManager::remove(Fn func) noexcept
|
||||||
|
//{
|
||||||
|
// holderMap.erase(func);
|
||||||
|
//}
|
46
cheat-library/src/user/util/HookManager.h
Normal file
46
cheat-library/src/user/util/HookManager.h
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "HookLib.h"
|
||||||
|
#include <map>
|
||||||
|
|
||||||
|
#define callOrigin(function, ...) \
|
||||||
|
HookManager::getOrigin(function)(__VA_ARGS__);
|
||||||
|
|
||||||
|
class HookManager
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
template <typename Fn>
|
||||||
|
static void set(Fn func, Fn handler) {
|
||||||
|
auto existHolder = get(handler);
|
||||||
|
if (existHolder != nullptr)
|
||||||
|
existHolder->disable();
|
||||||
|
|
||||||
|
auto holder = new HookHolder(func, handler);
|
||||||
|
holder->enable();
|
||||||
|
|
||||||
|
holderMap[reinterpret_cast<void*>(handler)] = reinterpret_cast<void*>(holder);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Fn>
|
||||||
|
[[nodiscard]] static HookHolder<Fn>* get(Fn handler) noexcept {
|
||||||
|
if (holderMap.count(reinterpret_cast<void*>(handler)) == 0)
|
||||||
|
return nullptr;
|
||||||
|
return reinterpret_cast<HookHolder<Fn>*>(holderMap[reinterpret_cast<void*>(handler)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Fn>
|
||||||
|
[[nodiscard]] static Fn getOrigin(Fn handler) noexcept {
|
||||||
|
auto holder = get(handler);
|
||||||
|
return holder->original();
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Fn>
|
||||||
|
[[nodiscard]] static void remove(Fn handler) noexcept {
|
||||||
|
holderMap.erase(reinterpret_cast<void*>(handler));
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
static std::map<void*, void*> holderMap;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
228
cheat-library/src/user/util/util.cpp
Normal file
228
cheat-library/src/user/util/util.cpp
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
#include <pch-il2cpp.h>
|
||||||
|
#ifndef UNICODE
|
||||||
|
#define UNICODE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <wchar.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#pragma comment(lib,"ntdll.lib")
|
||||||
|
|
||||||
|
#define NT_SUCCESS(x) ((x) >= 0)
|
||||||
|
#define STATUS_INFO_LENGTH_MISMATCH 0xc0000004
|
||||||
|
|
||||||
|
#define SystemHandleInformation 16
|
||||||
|
#define ObjectBasicInformation 0
|
||||||
|
#define ObjectNameInformation 1
|
||||||
|
#define ObjectTypeInformation 2
|
||||||
|
|
||||||
|
static int num = 0;
|
||||||
|
|
||||||
|
|
||||||
|
typedef NTSTATUS(NTAPI* _NtQuerySystemInformation)(
|
||||||
|
ULONG SystemInformationClass,
|
||||||
|
PVOID SystemInformation,
|
||||||
|
ULONG SystemInformationLength,
|
||||||
|
PULONG ReturnLength
|
||||||
|
);
|
||||||
|
typedef NTSTATUS(NTAPI* _NtDuplicateObject)(
|
||||||
|
HANDLE SourceProcessHandle,
|
||||||
|
HANDLE SourceHandle,
|
||||||
|
HANDLE TargetProcessHandle,
|
||||||
|
PHANDLE TargetHandle,
|
||||||
|
ACCESS_MASK DesiredAccess,
|
||||||
|
ULONG Attributes,
|
||||||
|
ULONG Options
|
||||||
|
);
|
||||||
|
typedef NTSTATUS(NTAPI* _NtQueryObject)(
|
||||||
|
HANDLE ObjectHandle,
|
||||||
|
ULONG ObjectInformationClass,
|
||||||
|
PVOID ObjectInformation,
|
||||||
|
ULONG ObjectInformationLength,
|
||||||
|
PULONG ReturnLength
|
||||||
|
);
|
||||||
|
|
||||||
|
typedef struct _UNICODE_STRING
|
||||||
|
{
|
||||||
|
USHORT Length;
|
||||||
|
USHORT MaximumLength;
|
||||||
|
PWSTR Buffer;
|
||||||
|
} UNICODE_STRING, * PUNICODE_STRING;
|
||||||
|
|
||||||
|
typedef struct _SYSTEM_HANDLE
|
||||||
|
{
|
||||||
|
ULONG ProcessId;
|
||||||
|
BYTE ObjectTypeNumber;
|
||||||
|
BYTE Flags;
|
||||||
|
USHORT Handle;
|
||||||
|
PVOID Object;
|
||||||
|
ACCESS_MASK GrantedAccess;
|
||||||
|
} SYSTEM_HANDLE, * PSYSTEM_HANDLE;
|
||||||
|
|
||||||
|
typedef struct _SYSTEM_HANDLE_INFORMATION
|
||||||
|
{
|
||||||
|
ULONG HandleCount;
|
||||||
|
SYSTEM_HANDLE Handles[1];
|
||||||
|
} SYSTEM_HANDLE_INFORMATION, * PSYSTEM_HANDLE_INFORMATION;
|
||||||
|
|
||||||
|
typedef enum _POOL_TYPE
|
||||||
|
{
|
||||||
|
NonPagedPool,
|
||||||
|
PagedPool,
|
||||||
|
NonPagedPoolMustSucceed,
|
||||||
|
DontUseThisType,
|
||||||
|
NonPagedPoolCacheAligned,
|
||||||
|
PagedPoolCacheAligned,
|
||||||
|
NonPagedPoolCacheAlignedMustS
|
||||||
|
} POOL_TYPE, * PPOOL_TYPE;
|
||||||
|
|
||||||
|
typedef struct _OBJECT_TYPE_INFORMATION
|
||||||
|
{
|
||||||
|
UNICODE_STRING Name;
|
||||||
|
ULONG TotalNumberOfObjects;
|
||||||
|
ULONG TotalNumberOfHandles;
|
||||||
|
ULONG TotalPagedPoolUsage;
|
||||||
|
ULONG TotalNonPagedPoolUsage;
|
||||||
|
ULONG TotalNamePoolUsage;
|
||||||
|
ULONG TotalHandleTableUsage;
|
||||||
|
ULONG HighWaterNumberOfObjects;
|
||||||
|
ULONG HighWaterNumberOfHandles;
|
||||||
|
ULONG HighWaterPagedPoolUsage;
|
||||||
|
ULONG HighWaterNonPagedPoolUsage;
|
||||||
|
ULONG HighWaterNamePoolUsage;
|
||||||
|
ULONG HighWaterHandleTableUsage;
|
||||||
|
ULONG InvalidAttributes;
|
||||||
|
GENERIC_MAPPING GenericMapping;
|
||||||
|
ULONG ValidAccess;
|
||||||
|
BOOLEAN SecurityRequired;
|
||||||
|
BOOLEAN MaintainHandleCount;
|
||||||
|
USHORT MaintainTypeList;
|
||||||
|
POOL_TYPE PoolType;
|
||||||
|
ULONG PagedPoolUsage;
|
||||||
|
ULONG NonPagedPoolUsage;
|
||||||
|
} OBJECT_TYPE_INFORMATION, * POBJECT_TYPE_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _SYSTEM_PROCESS_INFO
|
||||||
|
{
|
||||||
|
ULONG NextEntryOffset;
|
||||||
|
ULONG NumberOfThreads;
|
||||||
|
LARGE_INTEGER Reserved[3];
|
||||||
|
LARGE_INTEGER CreateTime;
|
||||||
|
LARGE_INTEGER UserTime;
|
||||||
|
LARGE_INTEGER KernelTime;
|
||||||
|
UNICODE_STRING ImageName;
|
||||||
|
ULONG BasePriority;
|
||||||
|
HANDLE ProcessId;
|
||||||
|
HANDLE InheritedFromProcessId;
|
||||||
|
}SYSTEM_PROCESS_INFO, * PSYSTEM_PROCESS_INFO;
|
||||||
|
|
||||||
|
PVOID GetLibraryProcAddress(LPCSTR LibraryName, LPCSTR ProcName)
|
||||||
|
{
|
||||||
|
return GetProcAddress(GetModuleHandleA(LibraryName), ProcName);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool CloseHandleByName(const wchar_t* name)
|
||||||
|
{
|
||||||
|
_NtQuerySystemInformation NtQuerySystemInformation =
|
||||||
|
(_NtQuerySystemInformation)GetLibraryProcAddress("ntdll.dll", "NtQuerySystemInformation");
|
||||||
|
_NtDuplicateObject NtDuplicateObject =
|
||||||
|
(_NtDuplicateObject)GetLibraryProcAddress("ntdll.dll", "NtDuplicateObject");
|
||||||
|
_NtQueryObject NtQueryObject =
|
||||||
|
(_NtQueryObject)GetLibraryProcAddress("ntdll.dll", "NtQueryObject");
|
||||||
|
NTSTATUS status;
|
||||||
|
|
||||||
|
ULONG handleInfoSize = 0x10000;
|
||||||
|
PSYSTEM_HANDLE_INFORMATION handleInfo = (PSYSTEM_HANDLE_INFORMATION)malloc(handleInfoSize);
|
||||||
|
|
||||||
|
ULONG pid;
|
||||||
|
HANDLE processHandle = GetCurrentProcess();
|
||||||
|
ULONG i;
|
||||||
|
|
||||||
|
/* NtQuerySystemInformation won't give us the correct buffer size,
|
||||||
|
so we guess by doubling the buffer size. */
|
||||||
|
while ((status = NtQuerySystemInformation(
|
||||||
|
SystemHandleInformation,
|
||||||
|
handleInfo,
|
||||||
|
handleInfoSize,
|
||||||
|
NULL
|
||||||
|
)) == STATUS_INFO_LENGTH_MISMATCH)
|
||||||
|
handleInfo = (PSYSTEM_HANDLE_INFORMATION)realloc(handleInfo, handleInfoSize *= 2);
|
||||||
|
|
||||||
|
/* NtQuerySystemInformation stopped giving us STATUS_INFO_LENGTH_MISMATCH. */
|
||||||
|
if (!NT_SUCCESS(status))
|
||||||
|
{
|
||||||
|
std::cout << "NtQuerySystemInformation failed!" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool closed = false;
|
||||||
|
for (i = 0; i < handleInfo->HandleCount; i++)
|
||||||
|
{
|
||||||
|
if (closed)
|
||||||
|
break;
|
||||||
|
|
||||||
|
SYSTEM_HANDLE handle = handleInfo->Handles[i];
|
||||||
|
HANDLE dupHandle = NULL;
|
||||||
|
POBJECT_TYPE_INFORMATION objectTypeInfo;
|
||||||
|
PVOID objectNameInfo;
|
||||||
|
UNICODE_STRING objectName;
|
||||||
|
ULONG returnLength;
|
||||||
|
|
||||||
|
/* Duplicate the handle so we can query it. */
|
||||||
|
if (!NT_SUCCESS(NtDuplicateObject(processHandle, (HANDLE)handle.Handle, GetCurrentProcess(), &dupHandle, 0, 0, 0)))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* Query the object type. */
|
||||||
|
objectTypeInfo = (POBJECT_TYPE_INFORMATION)malloc(0x1000);
|
||||||
|
if (!NT_SUCCESS(NtQueryObject(dupHandle, ObjectTypeInformation, objectTypeInfo, 0x1000, NULL)))
|
||||||
|
{
|
||||||
|
CloseHandle(dupHandle);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Query the object name (unless it has an access of
|
||||||
|
0x0012019f, on which NtQueryObject could hang. */
|
||||||
|
if (handle.GrantedAccess == 0x0012019f)
|
||||||
|
{
|
||||||
|
free(objectTypeInfo);
|
||||||
|
CloseHandle(dupHandle);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
objectNameInfo = malloc(0x1000);
|
||||||
|
if (!NT_SUCCESS(NtQueryObject(dupHandle, ObjectNameInformation, objectNameInfo, 0x1000, &returnLength)))
|
||||||
|
{
|
||||||
|
/* Reallocate the buffer and try again. */
|
||||||
|
objectNameInfo = realloc(objectNameInfo, returnLength);
|
||||||
|
if (!NT_SUCCESS(NtQueryObject(dupHandle, ObjectNameInformation, objectNameInfo, returnLength, NULL)))
|
||||||
|
{
|
||||||
|
free(objectTypeInfo);
|
||||||
|
free(objectNameInfo);
|
||||||
|
CloseHandle(dupHandle);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cast our buffer into an UNICODE_STRING. */
|
||||||
|
objectName = *(PUNICODE_STRING)objectNameInfo;
|
||||||
|
|
||||||
|
/* Print the information! */
|
||||||
|
if (objectName.Length && lstrcmpiW(objectName.Buffer, name) == 0)
|
||||||
|
{
|
||||||
|
CloseHandle((HANDLE)handle.Handle);
|
||||||
|
closed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
free(objectTypeInfo);
|
||||||
|
free(objectNameInfo);
|
||||||
|
CloseHandle(dupHandle);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
free(handleInfo);
|
||||||
|
CloseHandle(processHandle);
|
||||||
|
return closed;
|
||||||
|
}
|
3
cheat-library/src/user/util/util.h
Normal file
3
cheat-library/src/user/util/util.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
bool CloseHandleByName(const wchar_t* name);
|
212
cheat-library/vendor/include/HookLib.h
vendored
Normal file
212
cheat-library/vendor/include/HookLib.h
vendored
Normal file
@ -0,0 +1,212 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#include <cstddef>
|
||||||
|
#define hooklib_export extern "C"
|
||||||
|
#else
|
||||||
|
#include <stddef.h>
|
||||||
|
#define hooklib_export
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
void* fn;
|
||||||
|
const void* handler;
|
||||||
|
void* original; // hook() makes it valid callable pointer after successful hook and sets as nullptr otherwise
|
||||||
|
} Hook;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
void* original; // unhook() makes it nullptr after successful unhook and keeps unchanged otherwise
|
||||||
|
} Unhook;
|
||||||
|
|
||||||
|
hooklib_export void* hook(void* fn, const void* handler);
|
||||||
|
hooklib_export size_t multihook(Hook* hooks, size_t count);
|
||||||
|
|
||||||
|
hooklib_export size_t multiunhook(Unhook* originals, size_t count);
|
||||||
|
hooklib_export size_t unhook(void* original);
|
||||||
|
|
||||||
|
#ifndef _KERNEL_MODE
|
||||||
|
hooklib_export void* lookupModule(const wchar_t* modName); // LdrGetDllHandle
|
||||||
|
hooklib_export void* lookupFunction(const void* hModule, const char* funcName); // LdrGetProcedureAddress
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
template <typename Fn>
|
||||||
|
class HookHolder
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
struct tr
|
||||||
|
{
|
||||||
|
template <class Type, class Other = Type>
|
||||||
|
static constexpr Type exchange(Type& val, Other&& newVal)
|
||||||
|
{
|
||||||
|
const Type oldVal = static_cast<Type&&>(val);
|
||||||
|
val = static_cast<Other&&>(newVal);
|
||||||
|
return oldVal;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
protected:
|
||||||
|
Fn m_orig;
|
||||||
|
Fn m_fn;
|
||||||
|
Fn m_handler;
|
||||||
|
|
||||||
|
public:
|
||||||
|
HookHolder() = default;
|
||||||
|
|
||||||
|
HookHolder(Fn fn, Fn handler) noexcept : m_orig(nullptr), m_fn(fn), m_handler(handler)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
HookHolder(const HookHolder&) = delete;
|
||||||
|
|
||||||
|
HookHolder(HookHolder&& holder) noexcept
|
||||||
|
: m_orig(tr::exchange(holder.m_orig, nullptr))
|
||||||
|
, m_fn(tr::exchange(holder.m_fn, nullptr))
|
||||||
|
, m_handler(tr::exchange(holder.m_handler, nullptr))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
HookHolder& operator = (const HookHolder&) = delete;
|
||||||
|
|
||||||
|
HookHolder& operator = (HookHolder&& holder) noexcept
|
||||||
|
{
|
||||||
|
if (&holder == this)
|
||||||
|
{
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
disable();
|
||||||
|
|
||||||
|
m_orig = tr::exchange(holder.m_orig, nullptr);
|
||||||
|
m_fn = tr::exchange(holder.m_fn, nullptr);
|
||||||
|
m_handler = tr::exchange(holder.m_handler, nullptr);
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
~HookHolder() noexcept
|
||||||
|
{
|
||||||
|
if (active())
|
||||||
|
{
|
||||||
|
disable();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool valid() const noexcept
|
||||||
|
{
|
||||||
|
return m_fn && m_handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool active() const noexcept
|
||||||
|
{
|
||||||
|
return m_orig != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool enable() noexcept
|
||||||
|
{
|
||||||
|
if (!valid())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (active())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_orig = static_cast<Fn>(hook(m_fn, m_handler));
|
||||||
|
|
||||||
|
return m_orig != nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool disable() noexcept
|
||||||
|
{
|
||||||
|
if (!valid())
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!active())
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const bool unhookStatus = (unhook(m_orig) == 1);
|
||||||
|
if (unhookStatus)
|
||||||
|
{
|
||||||
|
m_orig = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return unhookStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
Fn detach() noexcept
|
||||||
|
{
|
||||||
|
return tr::exchange(m_orig, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
Fn original() const noexcept
|
||||||
|
{
|
||||||
|
return m_orig;
|
||||||
|
}
|
||||||
|
|
||||||
|
Fn fn() const noexcept
|
||||||
|
{
|
||||||
|
return m_fn;
|
||||||
|
}
|
||||||
|
|
||||||
|
Fn handler() const noexcept
|
||||||
|
{
|
||||||
|
return m_handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
__declspec(property(get = original)) Fn call;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
struct HookFactory
|
||||||
|
{
|
||||||
|
template <typename Fn>
|
||||||
|
[[nodiscard]] static HookHolder<Fn> install(Fn fn, Fn handler) noexcept
|
||||||
|
{
|
||||||
|
HookHolder hook(fn, handler);
|
||||||
|
hook.enable();
|
||||||
|
return hook;
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Fn>
|
||||||
|
[[nodiscard]] static HookHolder<Fn> install(void* fn, Fn handler) noexcept
|
||||||
|
{
|
||||||
|
return install<Fn>(static_cast<Fn>(fn), handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef _KERNEL_MODE
|
||||||
|
template <typename Fn>
|
||||||
|
[[nodiscard]] static HookHolder<Fn> install(void* mod, const char* const funcName, Fn handler) noexcept
|
||||||
|
{
|
||||||
|
if (!mod)
|
||||||
|
{
|
||||||
|
return HookHolder<Fn>(nullptr, handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
void* const fn = lookupFunction(mod, funcName);
|
||||||
|
if (!fn)
|
||||||
|
{
|
||||||
|
return HookHolder<Fn>(nullptr, handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
return install<Fn>(static_cast<Fn>(fn), handler);
|
||||||
|
}
|
||||||
|
|
||||||
|
template <typename Fn>
|
||||||
|
[[nodiscard]] static HookHolder<Fn> install(const wchar_t* const modName, const char* const funcName, Fn handler) noexcept
|
||||||
|
{
|
||||||
|
const void* const mod = lookupModule(modName);
|
||||||
|
return install<Fn>(mod, funcName, handler);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
#endif
|
3487
cheat-library/vendor/include/simple-ini.hpp
vendored
Normal file
3487
cheat-library/vendor/include/simple-ini.hpp
vendored
Normal file
File diff suppressed because it is too large
Load Diff
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x64-Debug.lib
vendored
Normal file
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x64-Debug.lib
vendored
Normal file
Binary file not shown.
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x64-Release.lib
vendored
Normal file
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x64-Release.lib
vendored
Normal file
Binary file not shown.
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x86-Debug.lib
vendored
Normal file
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x86-Debug.lib
vendored
Normal file
Binary file not shown.
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x86-Release.lib
vendored
Normal file
BIN
cheat-library/vendor/libraries/HookLib/HookLib-x86-Release.lib
vendored
Normal file
Binary file not shown.
141
genshincheat.sln
Normal file
141
genshincheat.sln
Normal file
@ -0,0 +1,141 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.0.32014.148
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "injector", "injector\injector.vcxproj", "{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cheat-library", "cheat-library\cheat-library.vcxproj", "{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug Kernel|x64 = Debug Kernel|x64
|
||||||
|
Debug Kernel|x86 = Debug Kernel|x86
|
||||||
|
Debug MD DLL|x64 = Debug MD DLL|x64
|
||||||
|
Debug MD DLL|x86 = Debug MD DLL|x86
|
||||||
|
Debug MD|x64 = Debug MD|x64
|
||||||
|
Debug MD|x86 = Debug MD|x86
|
||||||
|
Debug MT DLL|x64 = Debug MT DLL|x64
|
||||||
|
Debug MT DLL|x86 = Debug MT DLL|x86
|
||||||
|
Debug MT|x64 = Debug MT|x64
|
||||||
|
Debug MT|x86 = Debug MT|x86
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release Kernel|x64 = Release Kernel|x64
|
||||||
|
Release Kernel|x86 = Release Kernel|x86
|
||||||
|
Release MD DLL|x64 = Release MD DLL|x64
|
||||||
|
Release MD DLL|x86 = Release MD DLL|x86
|
||||||
|
Release MD|x64 = Release MD|x64
|
||||||
|
Release MD|x86 = Release MD|x86
|
||||||
|
Release MT DLL|x64 = Release MT DLL|x64
|
||||||
|
Release MT DLL|x86 = Release MT DLL|x86
|
||||||
|
Release MT|x64 = Release MT|x64
|
||||||
|
Release MT|x86 = Release MT|x86
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug Kernel|x64.ActiveCfg = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug Kernel|x64.Build.0 = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug Kernel|x86.ActiveCfg = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug Kernel|x86.Build.0 = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD DLL|x64.ActiveCfg = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD DLL|x64.Build.0 = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD DLL|x86.ActiveCfg = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD DLL|x86.Build.0 = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD|x64.ActiveCfg = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD|x64.Build.0 = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD|x86.ActiveCfg = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MD|x86.Build.0 = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT DLL|x64.ActiveCfg = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT DLL|x64.Build.0 = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT DLL|x86.ActiveCfg = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT DLL|x86.Build.0 = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT|x64.ActiveCfg = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT|x64.Build.0 = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT|x86.ActiveCfg = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug MT|x86.Build.0 = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release Kernel|x64.ActiveCfg = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release Kernel|x64.Build.0 = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release Kernel|x86.ActiveCfg = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release Kernel|x86.Build.0 = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD DLL|x64.ActiveCfg = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD DLL|x64.Build.0 = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD DLL|x86.ActiveCfg = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD DLL|x86.Build.0 = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD|x64.ActiveCfg = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD|x64.Build.0 = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD|x86.ActiveCfg = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MD|x86.Build.0 = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT DLL|x64.ActiveCfg = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT DLL|x64.Build.0 = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT DLL|x86.ActiveCfg = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT DLL|x86.Build.0 = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT|x64.ActiveCfg = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT|x64.Build.0 = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT|x86.ActiveCfg = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release MT|x86.Build.0 = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release|x64.Build.0 = Release|x64
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{F578B30C-8DE6-4741-99E4-1D30D2ACDAC4}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug Kernel|x64.ActiveCfg = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug Kernel|x64.Build.0 = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug Kernel|x86.ActiveCfg = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug Kernel|x86.Build.0 = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD DLL|x64.ActiveCfg = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD DLL|x64.Build.0 = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD DLL|x86.ActiveCfg = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD DLL|x86.Build.0 = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD|x64.ActiveCfg = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD|x64.Build.0 = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD|x86.ActiveCfg = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MD|x86.Build.0 = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT DLL|x64.ActiveCfg = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT DLL|x64.Build.0 = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT DLL|x86.ActiveCfg = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT DLL|x86.Build.0 = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT|x64.ActiveCfg = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT|x64.Build.0 = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT|x86.ActiveCfg = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug MT|x86.Build.0 = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release Kernel|x64.ActiveCfg = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release Kernel|x64.Build.0 = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release Kernel|x86.ActiveCfg = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release Kernel|x86.Build.0 = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD DLL|x64.ActiveCfg = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD DLL|x64.Build.0 = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD DLL|x86.ActiveCfg = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD DLL|x86.Build.0 = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD|x64.ActiveCfg = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD|x64.Build.0 = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD|x86.ActiveCfg = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MD|x86.Build.0 = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT DLL|x64.ActiveCfg = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT DLL|x64.Build.0 = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT DLL|x86.ActiveCfg = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT DLL|x86.Build.0 = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT|x64.ActiveCfg = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT|x64.Build.0 = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT|x86.ActiveCfg = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release MT|x86.Build.0 = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release|x64.Build.0 = Release|x64
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{704C8746-1BD9-4BC8-9EBE-8187F1A1AD72}.Release|x86.Build.0 = Release|Win32
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {0F485A89-A340-4742-97E7-923E14A929A1}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
3487
injector/include/simple-ini.hpp
Normal file
3487
injector/include/simple-ini.hpp
Normal file
File diff suppressed because it is too large
Load Diff
210
injector/injector.vcxproj
Normal file
210
injector/injector.vcxproj
Normal file
@ -0,0 +1,210 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>Win32</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\injector.cpp" />
|
||||||
|
<ClCompile Include="src\main.cpp" />
|
||||||
|
<ClCompile Include="src\util.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="include\simple-ini.hpp" />
|
||||||
|
<ClInclude Include="src\injector.h" />
|
||||||
|
<ClInclude Include="src\util.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\cheat-library\cheat-library.vcxproj">
|
||||||
|
<Project>{704c8746-1bd9-4bc8-9ebe-8187f1a1ad72}</Project>
|
||||||
|
<LinkLibraryDependencies>false</LinkLibraryDependencies>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<VCProjectVersion>16.0</VCProjectVersion>
|
||||||
|
<Keyword>Win32Proj</Keyword>
|
||||||
|
<ProjectGuid>{f578b30c-8de6-4741-99e4-1d30d2acdac4}</ProjectGuid>
|
||||||
|
<RootNamespace>testbypassmhyprot</RootNamespace>
|
||||||
|
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||||
|
<ProjectName>injector</ProjectName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>MultiByte</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Label="ExtensionSettings">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="Shared">
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>$(ProjectDir)bin\$(PlatformShortName)\$(Configuration)\obj\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)include/</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>
|
||||||
|
</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)include/</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>
|
||||||
|
</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>
|
||||||
|
</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||||
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
|
<SupportJustMyCode>false</SupportJustMyCode>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)include/</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<ImageHasSafeExceptionHandlers>
|
||||||
|
</ImageHasSafeExceptionHandlers>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>
|
||||||
|
</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
<PreLinkEvent>
|
||||||
|
<Command>
|
||||||
|
</Command>
|
||||||
|
</PreLinkEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)include/</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Console</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
<UACExecutionLevel>RequireAdministrator</UACExecutionLevel>
|
||||||
|
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
|
||||||
|
</Link>
|
||||||
|
<PostBuildEvent>
|
||||||
|
<Command>
|
||||||
|
</Command>
|
||||||
|
</PostBuildEvent>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
39
injector/injector.vcxproj.filters
Normal file
39
injector/injector.vcxproj.filters
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="src\main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\injector.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="src\util.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="src\injector.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="src\util.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="include\simple-ini.hpp">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
412
injector/src/injector.cpp
Normal file
412
injector/src/injector.cpp
Normal file
@ -0,0 +1,412 @@
|
|||||||
|
#include "injector.h"
|
||||||
|
|
||||||
|
#if defined(DISABLE_OUTPUT)
|
||||||
|
#define ILog(data, ...)
|
||||||
|
#define IPrintError(text, ...)
|
||||||
|
#else
|
||||||
|
#define ILog(text, ...) printf(text, __VA_ARGS__)
|
||||||
|
#define ILogError(text, ...) ILog(text, __VA_ARGS__); std::cout << "Error: " << GetLastErrorAsString() << std::endl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
#define CURRENT_ARCH IMAGE_FILE_MACHINE_AMD64
|
||||||
|
#else
|
||||||
|
#define CURRENT_ARCH IMAGE_FILE_MACHINE_I386
|
||||||
|
#endif
|
||||||
|
|
||||||
|
bool InjectDLL(HANDLE hProc, const std::string& filepath) {
|
||||||
|
|
||||||
|
#ifndef _DEBUG // _DEBUG
|
||||||
|
// Using LoadLibrary inject to be able to debug DLL in attached process.
|
||||||
|
// NOTE. For debug also needs disable mhyprot protection. (See protection-bypass.h in cheat-library)
|
||||||
|
bool result = LoadLibraryInject(hProc, filepath);
|
||||||
|
#else
|
||||||
|
std::ifstream file(filepath, std::ios::in | std::ios::binary | std::ios::ate);
|
||||||
|
if (!file.is_open())
|
||||||
|
{
|
||||||
|
std::cout << "Error while reading DLL file!" << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::streampos size = file.tellg();
|
||||||
|
auto memblock = new char[size];
|
||||||
|
file.seekg(0, std::ios::beg);
|
||||||
|
file.read(memblock, size);
|
||||||
|
file.close();
|
||||||
|
|
||||||
|
BYTE* fileContent = (BYTE*)memblock;
|
||||||
|
|
||||||
|
// Manual map injection will help us to be like a assasin
|
||||||
|
bool result = ManualMapDll(hProc, fileContent, size);
|
||||||
|
|
||||||
|
delete[] memblock;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
static bool LoadLibraryInject(HANDLE hProc, const std::string& dllpath)
|
||||||
|
{
|
||||||
|
HMODULE hKernel = GetModuleHandle("kernel32.dll");
|
||||||
|
if (hKernel == NULL) {
|
||||||
|
ILogError("[DLL Injection] Failed to get kernel32.dll module address.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LPVOID pLoadLibrary = (LPVOID)GetProcAddress(hKernel, "LoadLibraryA");
|
||||||
|
if (pLoadLibrary == NULL) {
|
||||||
|
ILogError("[DLL Injection] Failed to get LoadLibraryA address.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LPVOID pDLLPath = VirtualAllocEx(hProc, NULL, strlen(dllpath.c_str()) + 1, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
|
||||||
|
if (pDLLPath == NULL) {
|
||||||
|
ILogError("[DLL Injection] Failed to allocate memory for DLLPath in target process.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write the string name of our DLL in the memory allocated
|
||||||
|
BOOL writeResult = WriteProcessMemory(hProc, pDLLPath, dllpath.c_str(), strlen(dllpath.c_str()), NULL);
|
||||||
|
if (writeResult == FALSE) {
|
||||||
|
ILogError("[DLL Injection] Failed to write remote process memory.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load our DLL by calling loadlibrary in the other process and passing our dll name
|
||||||
|
HANDLE hThread = CreateRemoteThread(hProc, NULL, NULL, (LPTHREAD_START_ROUTINE)pLoadLibrary, (LPVOID)pDLLPath, NULL, NULL);
|
||||||
|
if (hThread == NULL) {
|
||||||
|
ILogError("[DLL Injection] Failed to create remote thread.\n");
|
||||||
|
VirtualFreeEx(hProc, pDLLPath, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CloseHandle(hThread);
|
||||||
|
|
||||||
|
// TODO: Add waiting for thread end and release unneccessary data.
|
||||||
|
// VirtualFreeEx(hProc, pDLLPath, 0, MEM_RELEASE);
|
||||||
|
|
||||||
|
ILogError("[DLL Injection] Successfully LoadLibraryA injection.\n");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // _DEBUG
|
||||||
|
|
||||||
|
bool ManualMapDll(HANDLE hProc, BYTE* pSrcData, SIZE_T FileSize, bool ClearHeader, bool ClearNonNeededSections, bool AdjustProtections, bool SEHExceptionSupport, DWORD fdwReason) {
|
||||||
|
IMAGE_NT_HEADERS* pOldNtHeader = nullptr;
|
||||||
|
IMAGE_OPTIONAL_HEADER* pOldOptHeader = nullptr;
|
||||||
|
IMAGE_FILE_HEADER* pOldFileHeader = nullptr;
|
||||||
|
BYTE* pTargetBase = nullptr;
|
||||||
|
|
||||||
|
if (reinterpret_cast<IMAGE_DOS_HEADER*>(pSrcData)->e_magic != 0x5A4D) { //"MZ"
|
||||||
|
ILog("[DLL injection] Invalid file\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
pOldNtHeader = reinterpret_cast<IMAGE_NT_HEADERS*>(pSrcData + reinterpret_cast<IMAGE_DOS_HEADER*>(pSrcData)->e_lfanew);
|
||||||
|
pOldOptHeader = &pOldNtHeader->OptionalHeader;
|
||||||
|
pOldFileHeader = &pOldNtHeader->FileHeader;
|
||||||
|
|
||||||
|
if (pOldFileHeader->Machine != CURRENT_ARCH) {
|
||||||
|
ILog("[DLL injection] Invalid platform.\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ILog("[DLL injection] File ok\n");
|
||||||
|
|
||||||
|
pTargetBase = reinterpret_cast<BYTE*>(VirtualAllocEx(hProc, nullptr, pOldOptHeader->SizeOfImage, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE));
|
||||||
|
if (!pTargetBase) {
|
||||||
|
ILogError("[DLL injection] Target process memory allocation failed (ex)\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD oldp = 0;
|
||||||
|
VirtualProtectEx(hProc, pTargetBase, pOldOptHeader->SizeOfImage, PAGE_EXECUTE_READWRITE, &oldp);
|
||||||
|
|
||||||
|
MANUAL_MAPPING_DATA data{ 0 };
|
||||||
|
data.pLoadLibraryA = LoadLibraryA;
|
||||||
|
data.pGetProcAddress = GetProcAddress;
|
||||||
|
#ifdef _WIN64
|
||||||
|
data.pRtlAddFunctionTable = (f_RtlAddFunctionTable)RtlAddFunctionTable;
|
||||||
|
#else
|
||||||
|
SEHExceptionSupport = false;
|
||||||
|
#endif
|
||||||
|
data.pbase = pTargetBase;
|
||||||
|
data.fdwReasonParam = fdwReason;
|
||||||
|
data.SEHSupport = SEHExceptionSupport;
|
||||||
|
|
||||||
|
//File header
|
||||||
|
if (!WriteProcessMemory(hProc, pTargetBase, pSrcData, 0x1000, nullptr)) { //only first 0x1000 bytes for the header
|
||||||
|
ILogError("[DLL injection] Can't write file header.\n");
|
||||||
|
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
IMAGE_SECTION_HEADER* pSectionHeader = IMAGE_FIRST_SECTION(pOldNtHeader);
|
||||||
|
for (UINT i = 0; i != pOldFileHeader->NumberOfSections; ++i, ++pSectionHeader) {
|
||||||
|
if (pSectionHeader->SizeOfRawData) {
|
||||||
|
if (!WriteProcessMemory(hProc, pTargetBase + pSectionHeader->VirtualAddress, pSrcData + pSectionHeader->PointerToRawData, pSectionHeader->SizeOfRawData, nullptr)) {
|
||||||
|
ILogError("[DLL injection] Can't map sections.\n");
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//Mapping params
|
||||||
|
BYTE* MappingDataAlloc = reinterpret_cast<BYTE*>(VirtualAllocEx(hProc, nullptr, sizeof(MANUAL_MAPPING_DATA), MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE));
|
||||||
|
if (!MappingDataAlloc) {
|
||||||
|
ILogError("[DLL injection] Target process mapping allocation failed (ex).\n");
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteProcessMemory(hProc, MappingDataAlloc, &data, sizeof(MANUAL_MAPPING_DATA), nullptr)) {
|
||||||
|
ILogError("[DLL injection] Can't write mapping.\n");
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, MappingDataAlloc, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Shell code
|
||||||
|
void* pShellcode = VirtualAllocEx(hProc, nullptr, 0x1000, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
|
||||||
|
if (!pShellcode) {
|
||||||
|
ILogError("[DLL injection] Memory shellcode allocation failed (ex).\n");
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, MappingDataAlloc, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteProcessMemory(hProc, pShellcode, Shellcode, 0x1000, nullptr)) {
|
||||||
|
ILogError("[DLL injection] Can't write shellcode.\n");
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, MappingDataAlloc, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, pShellcode, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
ILog("[DLL injection] Mapped DLL at %p\n", pTargetBase);
|
||||||
|
ILog("[DLL injection] Mapping info at %p\n", MappingDataAlloc);
|
||||||
|
ILog("[DLL injection] Shell code at %p\n", pShellcode);
|
||||||
|
|
||||||
|
ILog("[DLL injection] Data allocated\n");
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
ILog("[DLL injection] My shellcode pointer %p\n", Shellcode);
|
||||||
|
ILog("[DLL injection] Target point %p\n", pShellcode);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
HANDLE hThread = CreateRemoteThread(hProc, nullptr, 0, reinterpret_cast<LPTHREAD_START_ROUTINE>(pShellcode), MappingDataAlloc, 0, nullptr);
|
||||||
|
if (!hThread) {
|
||||||
|
ILogError("[DLL injection] Thread creation failed.\n");
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, MappingDataAlloc, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, pShellcode, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
CloseHandle(hThread);
|
||||||
|
|
||||||
|
ILog("[DLL injection] Thread created at: %p, waiting for return...\n", pShellcode);
|
||||||
|
|
||||||
|
HINSTANCE hCheck = NULL;
|
||||||
|
while (!hCheck) {
|
||||||
|
DWORD exitcode = 0;
|
||||||
|
GetExitCodeProcess(hProc, &exitcode);
|
||||||
|
if (exitcode != STILL_ACTIVE) {
|
||||||
|
ILog("[DLL injection] Process crashed, exit code: 0x%x\n", exitcode);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
MANUAL_MAPPING_DATA data_checked{ 0 };
|
||||||
|
ReadProcessMemory(hProc, MappingDataAlloc, &data_checked, sizeof(data_checked), nullptr);
|
||||||
|
hCheck = data_checked.hMod;
|
||||||
|
|
||||||
|
if (hCheck == (HINSTANCE)0x404040) {
|
||||||
|
ILog("[DLL injection] Wrong mapping ptr.\n");
|
||||||
|
VirtualFreeEx(hProc, pTargetBase, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, MappingDataAlloc, 0, MEM_RELEASE);
|
||||||
|
VirtualFreeEx(hProc, pShellcode, 0, MEM_RELEASE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if (hCheck == (HINSTANCE)0x505050) {
|
||||||
|
ILog("[DLL injection] WARNING: Exception support failed!\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
Sleep(10);
|
||||||
|
}
|
||||||
|
|
||||||
|
BYTE* emptyBuffer = (BYTE*)malloc(1024 * 1024 * 20);
|
||||||
|
if (emptyBuffer == nullptr) {
|
||||||
|
ILog("[DLL injection] Unable to allocate memory\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
memset(emptyBuffer, 0, 1024 * 1024 * 20);
|
||||||
|
|
||||||
|
//CLEAR PE HEAD
|
||||||
|
if (ClearHeader) {
|
||||||
|
if (!WriteProcessMemory(hProc, pTargetBase, emptyBuffer, 0x1000, nullptr)) {
|
||||||
|
ILogError("[DLL injection] WARNING!: Can't clear HEADER\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//END CLEAR PE HEAD
|
||||||
|
|
||||||
|
|
||||||
|
if (ClearNonNeededSections) {
|
||||||
|
pSectionHeader = IMAGE_FIRST_SECTION(pOldNtHeader);
|
||||||
|
for (UINT i = 0; i != pOldFileHeader->NumberOfSections; ++i, ++pSectionHeader) {
|
||||||
|
if (pSectionHeader->Misc.VirtualSize) {
|
||||||
|
if ((SEHExceptionSupport ? 0 : strcmp((char*)pSectionHeader->Name, ".pdata") == 0) ||
|
||||||
|
strcmp((char*)pSectionHeader->Name, ".rsrc") == 0 ||
|
||||||
|
strcmp((char*)pSectionHeader->Name, ".reloc") == 0) {
|
||||||
|
ILog("[DLL injection] Processing %s removal\n", pSectionHeader->Name);
|
||||||
|
if (!WriteProcessMemory(hProc, pTargetBase + pSectionHeader->VirtualAddress, emptyBuffer, pSectionHeader->Misc.VirtualSize, nullptr)) {
|
||||||
|
ILogError("[DLL injection] Can't clear section %s.\n", pSectionHeader->Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (AdjustProtections) {
|
||||||
|
pSectionHeader = IMAGE_FIRST_SECTION(pOldNtHeader);
|
||||||
|
for (UINT i = 0; i != pOldFileHeader->NumberOfSections; ++i, ++pSectionHeader) {
|
||||||
|
if (pSectionHeader->Misc.VirtualSize) {
|
||||||
|
DWORD old = 0;
|
||||||
|
DWORD newP = PAGE_READONLY;
|
||||||
|
|
||||||
|
if ((pSectionHeader->Characteristics & IMAGE_SCN_MEM_WRITE) > 0) {
|
||||||
|
newP = PAGE_READWRITE;
|
||||||
|
}
|
||||||
|
else if ((pSectionHeader->Characteristics & IMAGE_SCN_MEM_EXECUTE) > 0) {
|
||||||
|
newP = PAGE_EXECUTE_READ;
|
||||||
|
}
|
||||||
|
if (VirtualProtectEx(hProc, pTargetBase + pSectionHeader->VirtualAddress, pSectionHeader->Misc.VirtualSize, newP, &old)) {
|
||||||
|
ILog("[DLL injection] Section %s set as %lX\n", (char*)pSectionHeader->Name, newP);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ILog("[DLL injection] FAIL: section %s not set as %lX\n", (char*)pSectionHeader->Name, newP);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DWORD old = 0;
|
||||||
|
VirtualProtectEx(hProc, pTargetBase, IMAGE_FIRST_SECTION(pOldNtHeader)->VirtualAddress, PAGE_READONLY, &old);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!WriteProcessMemory(hProc, pShellcode, emptyBuffer, 0x1000, nullptr)) {
|
||||||
|
ILog("[DLL injection] WARNING: Can't clear shellcode\n");
|
||||||
|
}
|
||||||
|
if (!VirtualFreeEx(hProc, pShellcode, 0, MEM_RELEASE)) {
|
||||||
|
ILog("[DLL injection] WARNING: can't release shell code memory\n");
|
||||||
|
}
|
||||||
|
if (!VirtualFreeEx(hProc, MappingDataAlloc, 0, MEM_RELEASE)) {
|
||||||
|
ILog("[DLL injection] WARNING: can't release mapping data memory\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define RELOC_FLAG32(RelInfo) ((RelInfo >> 0x0C) == IMAGE_REL_BASED_HIGHLOW)
|
||||||
|
#define RELOC_FLAG64(RelInfo) ((RelInfo >> 0x0C) == IMAGE_REL_BASED_DIR64)
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
#define RELOC_FLAG RELOC_FLAG64
|
||||||
|
#else
|
||||||
|
#define RELOC_FLAG RELOC_FLAG32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#pragma runtime_checks( "", off )
|
||||||
|
#pragma optimize( "", off )
|
||||||
|
void __stdcall Shellcode(MANUAL_MAPPING_DATA* pData) {
|
||||||
|
|
||||||
|
if (!pData) {
|
||||||
|
pData->hMod = (HINSTANCE)0x404040;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
BYTE* pBase = pData->pbase;
|
||||||
|
auto* pOpt = &reinterpret_cast<IMAGE_NT_HEADERS*>(pBase + reinterpret_cast<IMAGE_DOS_HEADER*>((uintptr_t)pBase)->e_lfanew)->OptionalHeader;
|
||||||
|
|
||||||
|
auto _LoadLibraryA = pData->pLoadLibraryA;
|
||||||
|
auto _GetProcAddress = pData->pGetProcAddress;
|
||||||
|
#ifdef _WIN64
|
||||||
|
auto _RtlAddFunctionTable = pData->pRtlAddFunctionTable;
|
||||||
|
#endif
|
||||||
|
auto _DllMain = reinterpret_cast<f_DLL_ENTRY_POINT>(pBase + pOpt->AddressOfEntryPoint);
|
||||||
|
|
||||||
|
|
||||||
|
BYTE* LocationDelta = pBase - pOpt->ImageBase;
|
||||||
|
if (LocationDelta) {
|
||||||
|
if (pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size) {
|
||||||
|
auto* pRelocData = reinterpret_cast<IMAGE_BASE_RELOCATION*>(pBase + pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].VirtualAddress);
|
||||||
|
const auto* pRelocEnd = reinterpret_cast<IMAGE_BASE_RELOCATION*>(reinterpret_cast<uintptr_t>(pRelocData) + pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_BASERELOC].Size);
|
||||||
|
while (pRelocData < pRelocEnd && pRelocData->SizeOfBlock) {
|
||||||
|
UINT AmountOfEntries = (pRelocData->SizeOfBlock - sizeof(IMAGE_BASE_RELOCATION)) / sizeof(WORD);
|
||||||
|
WORD* pRelativeInfo = reinterpret_cast<WORD*>(pRelocData + 1);
|
||||||
|
|
||||||
|
for (UINT i = 0; i != AmountOfEntries; ++i, ++pRelativeInfo) {
|
||||||
|
if (RELOC_FLAG(*pRelativeInfo)) {
|
||||||
|
UINT_PTR* pPatch = reinterpret_cast<UINT_PTR*>(pBase + pRelocData->VirtualAddress + ((*pRelativeInfo) & 0xFFF));
|
||||||
|
*pPatch += reinterpret_cast<UINT_PTR>(LocationDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pRelocData = reinterpret_cast<IMAGE_BASE_RELOCATION*>(reinterpret_cast<BYTE*>(pRelocData) + pRelocData->SizeOfBlock);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].Size) {
|
||||||
|
auto* pImportDescr = reinterpret_cast<IMAGE_IMPORT_DESCRIPTOR*>(pBase + pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress);
|
||||||
|
while (pImportDescr->Name) {
|
||||||
|
char* szMod = reinterpret_cast<char*>(pBase + pImportDescr->Name);
|
||||||
|
HINSTANCE hDll = _LoadLibraryA(szMod);
|
||||||
|
|
||||||
|
ULONG_PTR* pThunkRef = reinterpret_cast<ULONG_PTR*>(pBase + pImportDescr->OriginalFirstThunk);
|
||||||
|
ULONG_PTR* pFuncRef = reinterpret_cast<ULONG_PTR*>(pBase + pImportDescr->FirstThunk);
|
||||||
|
|
||||||
|
if (!pThunkRef)
|
||||||
|
pThunkRef = pFuncRef;
|
||||||
|
|
||||||
|
for (; *pThunkRef; ++pThunkRef, ++pFuncRef) {
|
||||||
|
if (IMAGE_SNAP_BY_ORDINAL(*pThunkRef)) {
|
||||||
|
*pFuncRef = (ULONG_PTR)_GetProcAddress(hDll, reinterpret_cast<char*>(*pThunkRef & 0xFFFF));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
auto* pImport = reinterpret_cast<IMAGE_IMPORT_BY_NAME*>(pBase + (*pThunkRef));
|
||||||
|
*pFuncRef = (ULONG_PTR)_GetProcAddress(hDll, pImport->Name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
++pImportDescr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].Size) {
|
||||||
|
auto* pTLS = reinterpret_cast<IMAGE_TLS_DIRECTORY*>(pBase + pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_TLS].VirtualAddress);
|
||||||
|
auto* pCallback = reinterpret_cast<PIMAGE_TLS_CALLBACK*>(pTLS->AddressOfCallBacks);
|
||||||
|
for (; pCallback && *pCallback; ++pCallback)
|
||||||
|
(*pCallback)(pBase, DLL_PROCESS_ATTACH, nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ExceptionSupportFailed = false;
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
|
||||||
|
if (pData->SEHSupport) {
|
||||||
|
auto excep = pOpt->DataDirectory[IMAGE_DIRECTORY_ENTRY_EXCEPTION];
|
||||||
|
if (excep.Size) {
|
||||||
|
if (!_RtlAddFunctionTable(
|
||||||
|
reinterpret_cast<IMAGE_RUNTIME_FUNCTION_ENTRY*>(pBase + excep.VirtualAddress),
|
||||||
|
excep.Size / sizeof(IMAGE_RUNTIME_FUNCTION_ENTRY), (DWORD64)pBase)) {
|
||||||
|
ExceptionSupportFailed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
_DllMain(pBase, pData->fdwReasonParam, nullptr);
|
||||||
|
|
||||||
|
if (ExceptionSupportFailed)
|
||||||
|
pData->hMod = reinterpret_cast<HINSTANCE>(0x505050);
|
||||||
|
else
|
||||||
|
pData->hMod = reinterpret_cast<HINSTANCE>(pBase);
|
||||||
|
}
|
48
injector/src/injector.h
Normal file
48
injector/src/injector.h
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <Windows.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <TlHelp32.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
using f_LoadLibraryA = HINSTANCE(WINAPI*)(const char* lpLibFilename);
|
||||||
|
using f_GetProcAddress = FARPROC(WINAPI*)(HMODULE hModule, LPCSTR lpProcName);
|
||||||
|
using f_DLL_ENTRY_POINT = BOOL(WINAPI*)(void* hDll, DWORD dwReason, void* pReserved);
|
||||||
|
|
||||||
|
#ifdef _WIN64
|
||||||
|
using f_RtlAddFunctionTable = BOOL(WINAPIV*)(PRUNTIME_FUNCTION FunctionTable, DWORD EntryCount, DWORD64 BaseAddress);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct ConfigInfo {
|
||||||
|
bool disableMhyprot;
|
||||||
|
bool consoleLogging;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct MANUAL_MAPPING_DATA
|
||||||
|
{
|
||||||
|
f_LoadLibraryA pLoadLibraryA;
|
||||||
|
f_GetProcAddress pGetProcAddress;
|
||||||
|
#ifdef _WIN64
|
||||||
|
f_RtlAddFunctionTable pRtlAddFunctionTable;
|
||||||
|
#endif
|
||||||
|
BYTE* pbase;
|
||||||
|
HINSTANCE hMod;
|
||||||
|
DWORD fdwReasonParam;
|
||||||
|
LPVOID reservedParam;
|
||||||
|
BOOL SEHSupport;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
bool InjectDLL(HANDLE hProc, const std::string& filepath);
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
static bool LoadLibraryInject(HANDLE hProc, const std::string& dllpath);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Note: Exception support only x64 with build params /EHa or /EHc
|
||||||
|
bool ManualMapDll(HANDLE hProc, BYTE* pSrcData, SIZE_T FileSize, bool ClearHeader = false, bool ClearNonNeededSections = false, bool AdjustProtections = false, bool SEHExceptionSupport = false, DWORD fdwReason = DLL_PROCESS_ATTACH);
|
||||||
|
void __stdcall Shellcode(MANUAL_MAPPING_DATA* pData);
|
91
injector/src/main.cpp
Normal file
91
injector/src/main.cpp
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
#include <Windows.h>
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
#include <filesystem>
|
||||||
|
|
||||||
|
#include "injector.h"
|
||||||
|
#include "simple-ini.hpp"
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
const std::string GlobalGenshinProcName = "GenshinImpact.exe";
|
||||||
|
const std::string ChinaGenshinProcName = "YuanShen.exe";
|
||||||
|
|
||||||
|
const char* INIFileName = "config.ini";
|
||||||
|
|
||||||
|
static CSimpleIni ini;
|
||||||
|
|
||||||
|
HANDLE OpenGenshinProcess();
|
||||||
|
|
||||||
|
int main(int argc, char* argv[])
|
||||||
|
{
|
||||||
|
auto path = std::filesystem::path(argv[0]).parent_path();
|
||||||
|
std::filesystem::current_path(path);
|
||||||
|
|
||||||
|
WaitForCloseProcess(GlobalGenshinProcName);
|
||||||
|
WaitForCloseProcess(ChinaGenshinProcName);
|
||||||
|
|
||||||
|
Sleep(1000); // Wait for unloading all dlls.
|
||||||
|
|
||||||
|
ini.SetUnicode();
|
||||||
|
ini.LoadFile(INIFileName);
|
||||||
|
|
||||||
|
HANDLE hProcess = OpenGenshinProcess();
|
||||||
|
if (hProcess == NULL)
|
||||||
|
{
|
||||||
|
std::cout << "Failed to open GenshinImpact process." << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
ini.SaveFile(INIFileName);
|
||||||
|
|
||||||
|
std::filesystem::current_path(path);
|
||||||
|
|
||||||
|
std::string filename = (argc == 2 ? argv[1] : "CLibrary.dll");
|
||||||
|
std::filesystem::path currentDllPath = std::filesystem::current_path() / filename;
|
||||||
|
std::filesystem::path tempDllPath = std::filesystem::temp_directory_path() / filename;
|
||||||
|
|
||||||
|
std::filesystem::copy(currentDllPath, tempDllPath, std::filesystem::copy_options::update_existing);
|
||||||
|
InjectDLL(hProcess, tempDllPath.string());
|
||||||
|
|
||||||
|
CloseHandle(hProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
HANDLE OpenGenshinProcess() {
|
||||||
|
STARTUPINFOA startInfo{};
|
||||||
|
PROCESS_INFORMATION processInformation{};
|
||||||
|
|
||||||
|
auto savedPath = ini.GetValue("Inject", "GenshinPath");
|
||||||
|
bool exePathNotExist = savedPath == nullptr;
|
||||||
|
|
||||||
|
std::string* filePath = exePathNotExist ? nullptr : new std::string(savedPath);
|
||||||
|
if (exePathNotExist) {
|
||||||
|
std::cout << "Genshin path not found. Please point to it manually. ^)" << std::endl;
|
||||||
|
filePath = GetFilePathByUser();
|
||||||
|
if (filePath == nullptr) {
|
||||||
|
std::cout << "Failed to get genshin path from user. Exiting..." << std::endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL result = CreateProcessA(filePath->c_str(),
|
||||||
|
nullptr, 0, 0, false, CREATE_SUSPENDED, nullptr, nullptr, &startInfo, &processInformation);
|
||||||
|
if (result == FALSE) {
|
||||||
|
std::cout << "Failed to create game process." << std::endl;
|
||||||
|
std::cout << "Error: " << GetLastErrorAsString() << std::endl;
|
||||||
|
std::cout << "If you have problem with GenshinImpact.exe path. You can change it manually in " << INIFileName << "." << std::endl;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (exePathNotExist) {
|
||||||
|
ini.SetValue("Inject", "genshinPath", (*filePath).c_str());
|
||||||
|
std::cout << "New GenshinImpact.exe path saved to " << INIFileName << "." << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete filePath;
|
||||||
|
|
||||||
|
std::cout << "Created game process." << std::endl;
|
||||||
|
|
||||||
|
ResumeThread(processInformation.hThread);
|
||||||
|
|
||||||
|
return processInformation.hProcess;
|
||||||
|
}
|
107
injector/src/util.cpp
Normal file
107
injector/src/util.cpp
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
#include "util.h"
|
||||||
|
|
||||||
|
#include <TlHelp32.h>
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
#include <sstream>
|
||||||
|
|
||||||
|
//Returns the last Win32 error, in string format. Returns an empty string if there is no error.
|
||||||
|
std::string GetLastErrorAsString()
|
||||||
|
{
|
||||||
|
//Get the error message ID, if any.
|
||||||
|
DWORD errorMessageID = ::GetLastError();
|
||||||
|
if (errorMessageID == 0) {
|
||||||
|
return std::string(); //No error message has been recorded
|
||||||
|
}
|
||||||
|
|
||||||
|
LPSTR messageBuffer = nullptr;
|
||||||
|
|
||||||
|
//Ask Win32 to give us the string version of that message ID.
|
||||||
|
//The parameters we pass in, tell Win32 to create the buffer that holds the message for us (because we don't yet know how long the message string will be).
|
||||||
|
size_t size = FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||||
|
NULL, errorMessageID, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPSTR)&messageBuffer, 0, NULL);
|
||||||
|
|
||||||
|
//Copy the error message into a std::string.
|
||||||
|
std::string message(messageBuffer, size);
|
||||||
|
|
||||||
|
//Free the Win32's string's buffer.
|
||||||
|
LocalFree(messageBuffer);
|
||||||
|
|
||||||
|
return message;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string* GetFilePathByUser() {
|
||||||
|
|
||||||
|
// common dialog box structure, setting all fields to 0 is important
|
||||||
|
OPENFILENAME ofn = { 0 };
|
||||||
|
TCHAR szFile[260] = { 0 };
|
||||||
|
|
||||||
|
// Initialize remaining fields of OPENFILENAME structure
|
||||||
|
ofn.lStructSize = sizeof(ofn);
|
||||||
|
ofn.hwndOwner = NULL;
|
||||||
|
ofn.lpstrFile = szFile;
|
||||||
|
ofn.nMaxFile = sizeof(szFile);
|
||||||
|
ofn.lpstrFilter = "Executable\0*.exe\0";
|
||||||
|
ofn.nFilterIndex = 1;
|
||||||
|
ofn.lpstrFileTitle = NULL;
|
||||||
|
ofn.nMaxFileTitle = 0;
|
||||||
|
ofn.lpstrInitialDir = NULL;
|
||||||
|
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
|
||||||
|
|
||||||
|
if (GetOpenFileName(&ofn) == TRUE)
|
||||||
|
{
|
||||||
|
return new std::string(szFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
int FindProcessId(const std::string& processName) {
|
||||||
|
int pid = -1;
|
||||||
|
|
||||||
|
HANDLE snapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
|
||||||
|
PROCESSENTRY32 process;
|
||||||
|
ZeroMemory(&process, sizeof(process));
|
||||||
|
process.dwSize = sizeof(process);
|
||||||
|
|
||||||
|
if (Process32First(snapshot, &process))
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
if (std::string(process.szExeFile) == processName)
|
||||||
|
{
|
||||||
|
pid = process.th32ProcessID;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} while (Process32Next(snapshot, &process));
|
||||||
|
}
|
||||||
|
|
||||||
|
CloseHandle(snapshot);
|
||||||
|
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
void WaitForCloseProcess(const std::string& processName) {
|
||||||
|
int pid = FindProcessId(processName);
|
||||||
|
if (pid == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
|
std::cout << "Found '" << processName << "' process. Waiting for closing..." << std::endl;
|
||||||
|
|
||||||
|
#ifdef _DEBUG
|
||||||
|
std::stringstream stream;
|
||||||
|
stream << "taskkill /F /T /IM " << processName;
|
||||||
|
int retval = system(stream.str().c_str());
|
||||||
|
|
||||||
|
std::cout << "Trying to kill process." << std::endl;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
HANDLE hProc = OpenProcess(PROCESS_QUERY_LIMITED_INFORMATION, FALSE, pid);
|
||||||
|
DWORD exitCode = 0;
|
||||||
|
while (hProc && (GetExitCodeProcess(hProc, &exitCode), exitCode == STILL_ACTIVE)) {
|
||||||
|
Sleep(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hProc != NULL)
|
||||||
|
CloseHandle(hProc);
|
||||||
|
}
|
9
injector/src/util.h
Normal file
9
injector/src/util.h
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include <string>
|
||||||
|
#include <Windows.h>
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
std::string GetLastErrorAsString();
|
||||||
|
std::string* GetFilePathByUser();
|
||||||
|
|
||||||
|
int FindProcessId(const std::string& processName);
|
||||||
|
void WaitForCloseProcess(const std::string& processName);
|
Loading…
Reference in New Issue
Block a user