1
0
Fork 0

DBG: removed DeviceNameResolver (bug was fixed by ahmadmansoor already)

PROJECT: updated release script
This commit is contained in:
Mr. eXoDia 2014-04-17 20:18:01 +02:00
parent 78a5935f9d
commit 8c24955031
12 changed files with 30 additions and 34 deletions

View File

@ -23,14 +23,12 @@ mkdir %RELEASEDIR%\bin_base\bin\x64
copy bin\x32\BeaEngine.dll %RELEASEDIR%\bin_base\bin\x32\BeaEngine.dll
copy bin\x32\dbghelp.dll %RELEASEDIR%\bin_base\bin\x32\dbghelp.dll
copy bin\x32\DeviceNameResolver.dll %RELEASEDIR%\bin_base\bin\x32\DeviceNameResolver.dll
copy bin\x32\Scylla.dll %RELEASEDIR%\bin_base\bin\x32\Scylla.dll
copy bin\x32\sqlite.dll %RELEASEDIR%\bin_base\bin\x32\sqlite.dll
copy bin\x32\TitanEngine.dll %RELEASEDIR%\bin_base\bin\x32\TitanEngine.dll
copy bin\x32\XEDParse.dll %RELEASEDIR%\bin_base\bin\x32\XEDParse.dll
copy bin\x64\BeaEngine.dll %RELEASEDIR%\bin_base\bin\x64\BeaEngine.dll
copy bin\x64\dbghelp.dll %RELEASEDIR%\bin_base\bin\x64\dbghelp.dll
copy bin\x64\DeviceNameResolver.dll %RELEASEDIR%\bin_base\bin\x64\DeviceNameResolver.dll
copy bin\x64\Scylla.dll %RELEASEDIR%\bin_base\bin\x64\Scylla.dll
copy bin\x64\sqlite.dll %RELEASEDIR%\bin_base\bin\x64\sqlite.dll
copy bin\x64\TitanEngine.dll %RELEASEDIR%\bin_base\bin\x64\TitanEngine.dll

View File

@ -1,16 +0,0 @@
#ifndef _DEVICENAMERESOLVER_H
#define _DEVICENAMERESOLVER_H
#ifdef __cplusplus
extern "C"
{
#endif
__declspec(dllexport) bool DevicePathToPathW(const wchar_t* szDevicePath, wchar_t* szPath, size_t nSize);
__declspec(dllexport) bool DevicePathToPathA(const char* szDevicePath, char* szPath, size_t nSize);
#ifdef __cplusplus
}
#endif
#endif // _DEVICENAMERESOLVER_H

View File

@ -1,5 +1,4 @@
#include "_global.h"
#include "DeviceNameResolver\DeviceNameResolver.h"
#include <new>
HINSTANCE hInst;
@ -117,6 +116,30 @@ bool DirExists(const char* dir)
return (attrib==FILE_ATTRIBUTE_DIRECTORY);
}
bool DevicePathToPath(const char* devicepath, char* path, size_t path_size)
{
if(!devicepath or !path)
return false;
char curDrive[3]=" :";
char curDevice[MAX_PATH]="";
for(char drive='C'; drive<='Z'; drive++)
{
*curDrive=drive;
if(!QueryDosDeviceA(curDrive, curDevice, MAX_PATH))
continue;
strcat(curDevice, "\\"); //fixed thanks to ahmadmansoor!
size_t curDevice_len=strlen(curDevice);
if(!_strnicmp(devicepath, curDevice, curDevice_len)) //we match the device
{
if(strlen(devicepath)-curDevice_len>=path_size)
return false;
sprintf(path, "%s%s", curDrive, devicepath+curDevice_len);
return true;
}
}
return false;
}
bool GetFileNameFromHandle(HANDLE hFile, char* szFileName)
{
if(!GetFileSize(hFile, 0))
@ -133,7 +156,7 @@ bool GetFileNameFromHandle(HANDLE hFile, char* szFileName)
char szMappedName[MAX_PATH]="";
if(GetMappedFileNameA(GetCurrentProcess(), pFileMap, szMappedName, MAX_PATH))
{
if(!DevicePathToPathA(szMappedName, szFileName, MAX_PATH))
if(!DevicePathToPath(szMappedName, szFileName, MAX_PATH))
return false;
UnmapViewOfFile(pFileMap);
CloseHandle(hFileMap);

View File

@ -106,6 +106,7 @@ void formathex(char* string);
void formatdec(char* string);
bool FileExists(const char* file);
bool DirExists(const char* dir);
bool DevicePathToPath(const char* devicepath, char* path, size_t path_size);
bool GetFileNameFromHandle(HANDLE hFile, char* szFileName);
bool settingboolget(const char* section, const char* name);

View File

@ -16,7 +16,6 @@
#include "disasm_fast.h"
#include "BeaEngine\BeaEngine.h"
#include "DeviceNameResolver\DeviceNameResolver.h"
static PROCESS_INFORMATION g_pi= {0,0,0,0};
static char szFileName[MAX_PATH]="";
@ -474,7 +473,7 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
if(!GetMappedFileNameA(fdProcessInfo->hProcess, base, DebugFileName, deflen))
strcpy(DebugFileName, "??? (GetMappedFileName failed)");
else
DevicePathToPathA(DebugFileName, DebugFileName, deflen);
DevicePathToPath(DebugFileName, DebugFileName, deflen);
dprintf("Process Started: "fhex" %s\n", base, DebugFileName);
//init program database
@ -656,7 +655,7 @@ static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll)
if(!GetMappedFileNameA(fdProcessInfo->hProcess, base, DLLDebugFileName, deflen))
strcpy(DLLDebugFileName, "??? (GetMappedFileName failed)");
else
DevicePathToPathA(DLLDebugFileName, DLLDebugFileName, deflen);
DevicePathToPath(DLLDebugFileName, DLLDebugFileName, deflen);
dprintf("DLL Loaded: "fhex" %s\n", base, DLLDebugFileName);
SymLoadModuleEx(fdProcessInfo->hProcess, LoadDll->hFile, DLLDebugFileName, 0, (DWORD64)base, 0, 0, 0);

View File

@ -28,7 +28,6 @@
<Add library=".\sqlite\libsqlite32.a" />
<Add library=".\BeaEngine\libBeaEngine.a" />
<Add library=".\XEDParse\XEDParse_x86.a" />
<Add library=".\DeviceNameResolver\DeviceNameResolver_x86.a" />
</Linker>
</Target>
<Target title="x64">
@ -52,7 +51,6 @@
<Add library=".\sqlite\libsqlite64.a" />
<Add library=".\BeaEngine\libBeaEngine_64.a" />
<Add library=".\XEDParse\XEDParse_x64.a" />
<Add library=".\DeviceNameResolver\DeviceNameResolver_x64.a" />
</Linker>
</Target>
</Build>

View File

@ -56,7 +56,6 @@
<ClInclude Include="dbghelp\dbghelp.h" />
<ClInclude Include="dbg\dbg.h" />
<ClInclude Include="debugger.h" />
<ClInclude Include="DeviceNameResolver\DeviceNameResolver.h" />
<ClInclude Include="disasm_fast.h" />
<ClInclude Include="disasm_helper.h" />
<ClInclude Include="instruction.h" />
@ -130,7 +129,7 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>DeviceNameResolver\DeviceNameResolver_x86.lib;XEDParse\XEDParse_x86.lib;$(SolutionDir)bin\x32\x32_bridge.lib;dbghelp\dbghelp_x86.lib;TitanEngine\TitanEngine_x86.lib;sqlite\sqlite32.lib;BeaEngine\BeaEngine.lib;psapi.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;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>XEDParse\XEDParse_x86.lib;$(SolutionDir)bin\x32\x32_bridge.lib;dbghelp\dbghelp_x86.lib;TitanEngine\TitanEngine_x86.lib;sqlite\sqlite32.lib;BeaEngine\BeaEngine.lib;psapi.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;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
@ -145,7 +144,7 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>DeviceNameResolver\DeviceNameResolver_x64.lib;XEDParse\XEDParse_x64.lib;$(SolutionDir)bin\x64\x64_bridge.lib;dbghelp\dbghelp_x64.lib;TitanEngine\TitanEngine_x64.lib;sqlite\sqlite64.lib;BeaEngine\BeaEngine_64.lib;psapi.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;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>XEDParse\XEDParse_x64.lib;$(SolutionDir)bin\x64\x64_bridge.lib;dbghelp\dbghelp_x64.lib;TitanEngine\TitanEngine_x64.lib;sqlite\sqlite64.lib;BeaEngine\BeaEngine_64.lib;psapi.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;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

View File

@ -31,9 +31,6 @@
<Filter Include="Header Files\XEDParse">
<UniqueIdentifier>{6b85ff77-8866-4618-9d46-006d8c349f8f}</UniqueIdentifier>
</Filter>
<Filter Include="Header Files\DeviceNameResolver">
<UniqueIdentifier>{f4eb1487-15d6-4836-9d20-339d0f18c31f}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="_exports.cpp">
@ -242,8 +239,5 @@
<ClInclude Include="sqlite\sqlite3.h">
<Filter>Header Files\sqlite</Filter>
</ClInclude>
<ClInclude Include="DeviceNameResolver\DeviceNameResolver.h">
<Filter>Header Files\DeviceNameResolver</Filter>
</ClInclude>
</ItemGroup>
</Project>