Skip to content

Commit

Permalink
Release Build
Browse files Browse the repository at this point in the history
- Addressed various code analysis warnings.
- Built and signed binaries for version 1.0.2.0.
  • Loading branch information
NoMoreFood committed May 28, 2018
1 parent ad0448c commit 5a3ac57
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 21 deletions.
30 changes: 15 additions & 15 deletions Build/WinPriv-hash.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@

Algorithm Hash Path
--------- ---- ----
SHA256 50B093A48BF40FA720874CEA54BFFCC0D0027F93A510891AECFDD004F7620DB9 x64\WinPriv.exe
SHA256 7FE09602BFEE40F61C99E4B22414247485F6053596302DF9B49486BF07A76F13 x64\WinPrivCmd.exe
SHA256 57440A7E21F665AD71687FB9664551B35CF31ABC5BFD880B423A68B9A29885C9 x86\WinPriv.exe
SHA256 B30311EACE41EDDBB4B1A84B4E299AD9CBC27FD72F36AB678FFF1A0CABDE3EE1 x86\WinPrivCmd.exe
SHA256 F0472293747FB74F4027A0CA87D99731E3172D2EBC4CC7AE7EBB22A4CB70901A WinPriv.zip
SHA256 1F3D88165DE705F833C080F7BAD3EC8013854EE5BA1DD5CA86152104F0014F82 x64\WinPriv.exe
SHA256 E22303994A24F0B7C74426E3223CB114E6F885FCCCE451188E65F71132AC60AA x64\WinPrivCmd.exe
SHA256 F07FD74C808DF528149B978F6C2EDEF16F2D993F9DFD70AD8EEF6C9B97398291 x86\WinPriv.exe
SHA256 2F382647FF587B7C70BE9C73FDA25AF7CA5DE149C55877D2FBE1CB8BD1A4C6B8 x86\WinPrivCmd.exe
SHA256 34AE925B652BFA03A36BFD728C0EC9C429C60A5C0E5C21F4351798C3DB0EC865 WinPriv.zip



Algorithm Hash Path
--------- ---- ----
SHA1 2B23DEB9B4D0C855FC01CCE456F3B4FF732BDC50 x64\WinPriv.exe
SHA1 5FD1ADD743237A144922282F5F59DAB46328F03B x64\WinPrivCmd.exe
SHA1 A984F2084E349A54547136E5344BC61A451D71D5 x86\WinPriv.exe
SHA1 204EC8496C2B858BBA4ADEE8E1CB53AD90DAF10B x86\WinPrivCmd.exe
SHA1 C4A5FC3E2A4FCC8C4F24B2D6A5CD35D41CB30529 WinPriv.zip
SHA1 A8EB525CEDF7AE340E178DA07ABADA9A735197A3 x64\WinPriv.exe
SHA1 B85A571643186788662F6C6FE04F4A458F5C42B7 x64\WinPrivCmd.exe
SHA1 6691DCA6E3691AC777A4224DF7E11BB60114AFC1 x86\WinPriv.exe
SHA1 8A4DBB4700D7B712EB319C350E06A423FAB320FE x86\WinPrivCmd.exe
SHA1 BA0B0BD31DBCEA8D00016305B95C233EB11358E2 WinPriv.zip



Algorithm Hash Path
--------- ---- ----
MD5 8E19586953AA868BBD4BEF1FC55787D5 x64\WinPriv.exe
MD5 7395C5457E5B05E7B7D3486B8C2239AA x64\WinPrivCmd.exe
MD5 F4B4CBE55203F3356B3CB36C2069F134 x86\WinPriv.exe
MD5 E5B7FCF8F53BD9854A208DB5F3710E3F x86\WinPrivCmd.exe
MD5 5F361C3804C5D5686811DBF293A4898E WinPriv.zip
MD5 438A11FEF70928ECC17BFCF8E2155CE2 x64\WinPriv.exe
MD5 04B3CD0192FA339AA3D8E8FDE1F3C3D6 x64\WinPrivCmd.exe
MD5 91E669F6CD5236D7565447F755E78A48 x86\WinPriv.exe
MD5 1758F6A17B569F76B4E6F4AE3F1D113F x86\WinPrivCmd.exe
MD5 225D18F69E1252A4E9F07B2B557E0785 WinPriv.zip


Binary file modified Build/WinPriv.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion Build/build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ set LIBURL=https://github.com/NoMoreFood/WinPriv
RD /S /Q "%~dp0.vs" >NUL 2>&1
RD /S /Q "%~dp0x86\Temp" >NUL 2>&1
RD /S /Q "%~dp0x64\Temp" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.*zip" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.*pdb" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.*obj" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.zip" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.log" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.lib" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.dll" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.bsc" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.exp" /C "CMD /C DEL /Q @path" >NUL 2>&1
FORFILES /S /P "%~dp0." /M "*.last*" /C "CMD /C DEL /Q @path" >NUL 2>&1

:: determine 32-bit program files directory
IF DEFINED ProgramFiles SET PX86=%ProgramFiles%
Expand Down
Binary file modified Build/x64/WinPriv.exe
Binary file not shown.
Binary file modified Build/x64/WinPrivCmd.exe
Binary file not shown.
Binary file modified Build/x86/WinPriv.exe
Binary file not shown.
Binary file modified Build/x86/WinPrivCmd.exe
Binary file not shown.
6 changes: 5 additions & 1 deletion WinPriv/WinPrivLogon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ int LaunchNewLogon(int iArgc, wchar_t *aArgv[])

// get the current working directory to pass to the child process
WCHAR sCurrentDir[MAX_PATH + 1];
_wgetcwd(sCurrentDir, _countof(sCurrentDir));
if (_wgetcwd(sCurrentDir, _countof(sCurrentDir)) == NULL)
{
PrintMessage(L"ERROR: Problem obtaining current directory.\n");
return __LINE__;
}

// relaunch process under altered security policy
LPWSTR sBlock = GetEnvironmentStrings();
Expand Down
9 changes: 5 additions & 4 deletions WinPrivLibrary/WinPrivLibraryDetours.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ EXTERN_C NTSTATUS WINAPI DetourNtQueryValueKey(_In_ HANDLE KeyHandle,
// split the first argument into a root name and subkey name
LPWSTR sRootKeyName = sParams[iParam];
LPWSTR sSubKeyName = wcschr(sParams[iParam], L'\\');
*sSubKeyName++ = '\0';
if (sSubKeyName != NULL) *sSubKeyName++ = '\0';

// match the aesthetic name to the builtin roots
HKEY hRootKey = NULL;
Expand Down Expand Up @@ -179,7 +179,8 @@ EXTERN_C NTSTATUS WINAPI DetourNtQueryValueKey(_In_ HANDLE KeyHandle,
// allocate space for name and lookup
NTSTATUS iStatus = -1;
PKEY_NAME_INFORMATION pNameInfo = (PKEY_NAME_INFORMATION)malloc(iKeyNameSize);
if (NtQueryKey(KeyHandle, KeyNameInformation, pNameInfo, iKeyNameSize, &iKeyNameSize) == STATUS_SUCCESS)
if (pNameInfo != NULL && NtQueryKey(KeyHandle, KeyNameInformation, pNameInfo,
iKeyNameSize, &iKeyNameSize) == STATUS_SUCCESS)
{
// convert to unicode string structure for quick comparisons
UNICODE_STRING sKeyName = { (USHORT)pNameInfo->NameLength,
Expand Down Expand Up @@ -253,7 +254,7 @@ EXTERN_C NTSTATUS WINAPI DetourNtQueryValueKey(_In_ HANDLE KeyHandle,
}

// cleanup
free(pNameInfo);
if (pNameInfo != NULL) free(pNameInfo);

// return the real value if no match was found
if (iStatus == -1)
Expand All @@ -277,7 +278,7 @@ EXTERN_C NTSTATUS WINAPI DetourNtEnumerateValueKey(_In_ HANDLE KeyHandle, _In_ U
NTSTATUS iStatus = TrueNtEnumerateValueKey(KeyHandle, Index,
KeyValueInformationClass, KeyValueInformation, Length, ResultLength);

if (iStatus == STATUS_SUCCESS &&
if (iStatus == STATUS_SUCCESS && KeyValueInformation != NULL &&
(KeyValueInformationClass == KeyValueFullInformation ||
KeyValueInformationClass == KeyValueFullInformationAlign64))
{
Expand Down

0 comments on commit 5a3ac57

Please sign in to comment.