diff --git a/.gitignore b/.gitignore index 86a7974..b463f9e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,14 @@ *.opensdf *.sdf *.suo +*.obj +*.ilk +*.db +*.user +*.opendb +*.pdb src/Release/* +src/Debug/* +sample/*.exe +sample/*.dll +sample/*.lib \ No newline at end of file diff --git a/bin/wow64ext.dll b/bin/wow64ext.dll index 7d10068..de91070 100644 Binary files a/bin/wow64ext.dll and b/bin/wow64ext.dll differ diff --git a/bin/wow64ext.lib b/bin/wow64ext.lib index da27f88..04acbf3 100644 Binary files a/bin/wow64ext.lib and b/bin/wow64ext.lib differ diff --git a/doc/wow64ext.txt b/doc/wow64ext.txt index bb7c84f..0a63ccd 100644 --- a/doc/wow64ext.txt +++ b/doc/wow64ext.txt @@ -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..: rewolf@rewolf.pl diff --git a/src/wow64ext.cpp b/src/wow64ext.cpp index f7f8401..fbba809 100644 --- a/src/wow64ext.cpp +++ b/src/wow64ext.cpp @@ -21,6 +21,7 @@ */ #include +#include #include "internal.h" #include "wow64ext.h" #include "CMemPtr.h" @@ -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 @@ -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; } diff --git a/src/wow64ext.rc b/src/wow64ext.rc index 7237544..03c37d2 100644 Binary files a/src/wow64ext.rc and b/src/wow64ext.rc differ diff --git a/src/wow64ext.vcxproj b/src/wow64ext.vcxproj index 5e976ea..91d0cac 100644 --- a/src/wow64ext.vcxproj +++ b/src/wow64ext.vcxproj @@ -28,7 +28,7 @@ false true Unicode - v140_xp + v140 @@ -45,6 +45,7 @@ false + $(WindowsSDK_MetadataPath);