Skip to content

Commit

Permalink
Improved support for Windows 10 build 15007 (resolved RFG conflict)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReWolf committed Jan 17, 2017
1 parent 97e1073 commit fd28b57
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
*.opensdf
*.sdf
*.suo
*.obj
*.ilk
*.db
*.user
*.opendb
*.pdb
src/Release/*
src/Debug/*
sample/*.exe
sample/*.dll
sample/*.lib
Binary file modified bin/wow64ext.dll
Binary file not shown.
Binary file modified bin/wow64ext.lib
Binary file not shown.
4 changes: 2 additions & 2 deletions doc/wow64ext.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Name....: WOW64Ext Library
Author..: ReWolf
Rel.Date: 12.I.2012
Update..: 11.XII.2015
Version.: 1.0.0.8
Update..: 18.I.2017
Version.: 1.0.0.9


e.mail..: [email protected]
Expand Down
15 changes: 13 additions & 2 deletions src/wow64ext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
*/

#include <Windows.h>
#include <cstddef>
#include "internal.h"
#include "wow64ext.h"
#include "CMemPtr.h"
Expand Down Expand Up @@ -89,9 +90,15 @@ extern "C" __declspec(dllexport) DWORD64 __cdecl X64Call(DWORD64 func, int argC,
// conversion to QWORD for easier use in inline assembly
reg64 _argC = { (DWORD64)argC };
DWORD back_esp = 0;
WORD back_fs = 0;

__asm
{
;// reset FS segment, to properly handle RFG
mov back_fs, fs
mov eax, 0x2B
mov fs, ax

;// keep original esp in back_esp variable
mov back_esp, esp

Expand Down Expand Up @@ -157,9 +164,13 @@ _ls_e: ;//

X64_End();

mov ax, ds
mov ss, ax
mov ax, ds
mov ss, ax
mov esp, back_esp

;// restore FS segment
mov ax, back_fs
mov fs, ax
}
return _rax.v;
}
Expand Down
Binary file modified src/wow64ext.rc
Binary file not shown.
3 changes: 2 additions & 1 deletion src/wow64ext.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140_xp</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
Expand All @@ -45,6 +45,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<LibraryWPath>$(WindowsSDK_MetadataPath);</LibraryWPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
Expand Down

0 comments on commit fd28b57

Please sign in to comment.