Party Disk Serial Number Spoof
This commit is contained in:
parent
aa98d91d5d
commit
89e01e32f9
|
@ -69,6 +69,17 @@ typedef LCID (*P_GetSystemDefaultLCID)();
|
|||
|
||||
typedef LANGID (*P_GetSystemDefaultLangID)();
|
||||
|
||||
typedef BOOL (*P_GetVolumeInformationByHandleW)(
|
||||
HANDLE hFile,
|
||||
LPWSTR lpVolumeNameBuffer,
|
||||
DWORD nVolumeNameSize,
|
||||
LPDWORD lpVolumeSerialNumber,
|
||||
LPDWORD lpMaximumComponentLength,
|
||||
LPDWORD lpFileSystemFlags,
|
||||
LPWSTR lpFileSystemNameBuffer,
|
||||
DWORD nFileSystemNameSize
|
||||
);
|
||||
|
||||
//typedef int (*P_GetLocaleInfoEx)(LPCWSTR lpLocaleName, LCTYPE LCType, LPWSTR lpLCData, int cchData);
|
||||
|
||||
//typedef int (*P_GetLocaleInfoA)(LCID Locale, LCTYPE LCType, LPSTR lpLCData, int cchData);
|
||||
|
@ -104,6 +115,7 @@ P_GetSystemDefaultUILanguage __sys_GetSystemDefaultUILanguage = NULL;
|
|||
P_GetSystemDefaultLocaleName __sys_GetSystemDefaultLocaleName = NULL;
|
||||
P_GetSystemDefaultLCID __sys_GetSystemDefaultLCID = NULL;
|
||||
P_GetSystemDefaultLangID __sys_GetSystemDefaultLangID = NULL;
|
||||
P_GetVolumeInformationByHandleW __sys_GetVolumeInformationByHandleW = NULL;
|
||||
|
||||
LCID Kernel_CustomLCID = 0;
|
||||
|
||||
|
@ -148,7 +160,16 @@ static LCID Kernel_GetSystemDefaultLCID();
|
|||
|
||||
static LANGID Kernel_GetSystemDefaultLangID();
|
||||
|
||||
|
||||
static BOOL Kernel_GetVolumeInformationByHandleW(
|
||||
HANDLE hFile,
|
||||
LPWSTR lpVolumeNameBuffer,
|
||||
DWORD nVolumeNameSize,
|
||||
LPDWORD lpVolumeSerialNumber,
|
||||
LPDWORD lpMaximumComponentLength,
|
||||
LPDWORD lpFileSystemFlags,
|
||||
LPWSTR lpFileSystemNameBuffer,
|
||||
DWORD nFileSystemNameSize
|
||||
);
|
||||
//---------------------------------------------------------------------------
|
||||
// Kernel_Init
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -243,7 +264,13 @@ _FX BOOLEAN Kernel_Init()
|
|||
SBIEDLL_HOOK(Kernel_, GetSystemDefaultLCID);
|
||||
SBIEDLL_HOOK(Kernel_, GetSystemDefaultLangID);
|
||||
}
|
||||
|
||||
if (SbieApi_QueryConfBool(NULL, L"HideDiskSerialNumber", FALSE))
|
||||
{
|
||||
void* GetVolumeInformationByHandleW = GetProcAddress(Dll_KernelBase ? Dll_KernelBase : Dll_Kernel32, "GetVolumeInformationByHandleW");
|
||||
if (GetVolumeInformationByHandleW) {
|
||||
SBIEDLL_HOOK(Kernel_, GetVolumeInformationByHandleW);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -485,3 +512,26 @@ _FX LANGID Kernel_GetSystemDefaultLangID()
|
|||
{
|
||||
return (LANGID)Kernel_CustomLCID;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
//Kernel_GetVolumeInformationByHandleW
|
||||
//----------------------------------------------------------------------------
|
||||
_FX BOOL Kernel_GetVolumeInformationByHandleW(
|
||||
HANDLE hFile,
|
||||
LPWSTR lpVolumeNameBuffer,
|
||||
DWORD nVolumeNameSize,
|
||||
LPDWORD lpVolumeSerialNumber,
|
||||
LPDWORD lpMaximumComponentLength,
|
||||
LPDWORD lpFileSystemFlags,
|
||||
LPWSTR lpFileSystemNameBuffer,
|
||||
DWORD nFileSystemNameSize
|
||||
) {
|
||||
DWORD ourSerialNumber = 0;
|
||||
BOOL rtn = __sys_GetVolumeInformationByHandleW(hFile, lpVolumeNameBuffer, nVolumeNameSize, &ourSerialNumber, lpMaximumComponentLength, lpFileSystemFlags, lpFileSystemNameBuffer, nFileSystemNameSize);
|
||||
if (lpVolumeSerialNumber == NULL)
|
||||
return rtn;
|
||||
else {
|
||||
lpVolumeSerialNumber = NULL;
|
||||
return rtn;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue