Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
################################################################################
# 這個 .gitignore 檔案由 Microsoft(R) Visual Studio 自動建立。
################################################################################

# Visual Studio specific
/.vs/
*.suo
*.user
*.wsuo
*.vsidx
*.vcxproj.user

# Build results
[Dd]ebug/
[Rr]elease/
x64/
ARM64/

# Dependencies
/vcpkg_installed/
1 change: 1 addition & 0 deletions KDemu/KDemu.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
</PropertyGroup>
<PropertyGroup Label="Vcpkg" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<VcpkgUseStatic>true</VcpkgUseStatic>
<VcpkgConfiguration>Debug</VcpkgConfiguration>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down
12 changes: 12 additions & 0 deletions KDemu/LoadPE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,18 @@ bool PEloader::LoadPE(const std::string path) {
IMAGE_DIRECTORY_ENTRY_EXCEPTION,
&peFiles[0]->ExceptionTableSize);
peFiles[0]->ExceptionTable = peFiles[0]->Base + ((PUCHAR)ExceptionTable - (PUCHAR)peFiles[0]->memMap);


uint64_t RtlpInvertedFunctionTableList = 0xfffff80508c18088;
uint64_t imagebase = 0xfffff80508c18090;
uint64_t imagesizebase = 0xfffff80508c18098;
uint64_t ExceptionTableSizebase = 0xfffff80508c1809C;
Emu(uc)->try_write(RtlpInvertedFunctionTableList, &peFiles[0]->ExceptionTable, sizeof(peFiles[0]->ExceptionTable));
Emu(uc)->try_write(imagebase, &Emu_file_Base, sizeof(Emu_file_Base));
Emu(uc)->try_write(imagesizebase, &image_size, sizeof(uint32_t));
Emu(uc)->try_write(ExceptionTableSizebase, &peFiles[0]->ExceptionTableSize, sizeof(uint32_t));


FixImport(pe->Base, imports);
return true;
}
Expand Down