forked from guttir14/UnrealDumper-4.25
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,405 additions
and
913 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,68 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Headers"> | ||
<Filter Include="include"> | ||
<UniqueIdentifier>{7feed74c-41d0-4a17-93ca-9e368259955d}</UniqueIdentifier> | ||
</Filter> | ||
<Filter Include="include\fmt"> | ||
<UniqueIdentifier>{fa04ece9-af5e-44b6-9f99-319055d65faa}</UniqueIdentifier> | ||
</Filter> | ||
<Filter Include="headers"> | ||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> | ||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> | ||
</Filter> | ||
<Filter Include="Sources"> | ||
<Filter Include="sources"> | ||
<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="Sources\include"> | ||
<UniqueIdentifier>{7feed74c-41d0-4a17-93ca-9e368259955d}</UniqueIdentifier> | ||
</Filter> | ||
<Filter Include="Sources\include\fmt"> | ||
<UniqueIdentifier>{fa04ece9-af5e-44b6-9f99-319055d65faa}</UniqueIdentifier> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="main.cpp"> | ||
<Filter>Sources</Filter> | ||
<Filter>sources</Filter> | ||
</ClCompile> | ||
<ClCompile Include="utils.cpp"> | ||
<Filter>Sources</Filter> | ||
<Filter>sources</Filter> | ||
</ClCompile> | ||
<ClCompile Include="wrappers.cpp"> | ||
<Filter>Sources</Filter> | ||
<Filter>sources</Filter> | ||
</ClCompile> | ||
<ClCompile Include="generic.cpp"> | ||
<Filter>Sources</Filter> | ||
<Filter>sources</Filter> | ||
</ClCompile> | ||
<ClCompile Include="..\include\fmt\format.cc"> | ||
<Filter>Sources\include\fmt</Filter> | ||
<Filter>include\fmt</Filter> | ||
</ClCompile> | ||
<ClCompile Include="memory.cpp"> | ||
<Filter>Sources</Filter> | ||
<Filter>sources</Filter> | ||
</ClCompile> | ||
<ClCompile Include="engine.cpp"> | ||
<Filter>Sources</Filter> | ||
<Filter>sources</Filter> | ||
</ClCompile> | ||
<ClCompile Include="dumper.cpp"> | ||
<Filter>Sources</Filter> | ||
<Filter>sources</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClInclude Include="engine.h"> | ||
<Filter>Headers</Filter> | ||
<Filter>headers</Filter> | ||
</ClInclude> | ||
<ClInclude Include="utils.h"> | ||
<Filter>Headers</Filter> | ||
<Filter>headers</Filter> | ||
</ClInclude> | ||
<ClInclude Include="memory.h"> | ||
<Filter>Headers</Filter> | ||
<Filter>headers</Filter> | ||
</ClInclude> | ||
<ClInclude Include="wrappers.h"> | ||
<Filter>Headers</Filter> | ||
<Filter>headers</Filter> | ||
</ClInclude> | ||
<ClInclude Include="generic.h"> | ||
<Filter>Headers</Filter> | ||
<Filter>headers</Filter> | ||
</ClInclude> | ||
<ClInclude Include="defs.h"> | ||
<Filter>Headers</Filter> | ||
<Filter>headers</Filter> | ||
</ClInclude> | ||
<ClInclude Include="dumper.h"> | ||
<Filter>Headers</Filter> | ||
<Filter>headers</Filter> | ||
</ClInclude> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,31 @@ | ||
#include <Windows.h> | ||
#include <winternl.h> | ||
#include "memory.h" | ||
|
||
HANDLE hProcess; | ||
uint64 Base; | ||
|
||
bool Read(void *address, void *buffer, uint64 size) { | ||
return ReadProcessMemory(hProcess, address, buffer, size, nullptr); | ||
bool Read(void* address, void* buffer, uint64 size) { | ||
uint64 read; | ||
return ReadProcessMemory(hProcess, address, buffer, size, &read) && read == size; | ||
} | ||
|
||
bool ReaderInit(uint32 pid) { | ||
hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid); | ||
return hProcess != nullptr; | ||
} | ||
PROCESS_BASIC_INFORMATION pbi; | ||
hProcess = OpenProcess(GENERIC_READ, 0, pid); | ||
if (!hProcess) return false; | ||
if (0 > NtQueryInformationProcess(hProcess, ProcessBasicInformation, &pbi, sizeof(pbi), 0)) goto failed; | ||
Base = Read<uint64>((uint8*)pbi.PebBaseAddress + 0x10); | ||
if (!Base) goto failed; | ||
return true; | ||
failed: | ||
CloseHandle(hProcess); | ||
return false; | ||
} | ||
|
||
uint64 GetImageSize() { | ||
char buffer[0x400]; | ||
if (!Read((void*)Base, buffer, 0x400)) return 0; | ||
auto nt = (PIMAGE_NT_HEADERS)(buffer + ((PIMAGE_DOS_HEADER)buffer)->e_lfanew); | ||
return nt->OptionalHeader.SizeOfImage; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,5 @@ template <typename T> T Read(void *address) { | |
} | ||
|
||
bool ReaderInit(uint32 pid); | ||
|
||
uint64 GetImageSize(); |
Oops, something went wrong.