Skip to content

Commit

Permalink
Privexec: 4.3.1 fix detect git-for-windows git.exe wapper subsystem f…
Browse files Browse the repository at this point in the history
…ailed.

git-for-windows PointerToSymbolTable value is incorrect
  • Loading branch information
fcharlie committed Jan 6, 2021
1 parent 1e67d40 commit 6f1b058
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ endif()
#
set(PRIVEXEC_VERSION_MAJOR 4)
set(PRIVEXEC_VERSION_MINOR 3)
set(PRIVEXEC_VERSION_PATCH 0)
set(PRIVEXEC_VERSION_PATCH 1)
set(PACKAGE_VERSION "${PRIVEXEC_VERSION_MAJOR}.${PRIVEXEC_VERSION_MINOR}.${PRIVEXEC_VERSION_PATCH}")

string(TOLOWER "${CMAKE_C_COMPILER_ARCHITECTURE_ID}" COMPILER_ARCH_ID)
Expand Down
2 changes: 1 addition & 1 deletion vendor/bela.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/fcharlie/bela/tree/303e8bc883db52d8e9adbab1bee66ef6bedd7fd8
https://github.com/fcharlie/bela/tree/9e7783d3d4545cce1ca2ff2e7b51abce93a452f8
1 change: 0 additions & 1 deletion vendor/bela/src/belawin/pe/file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ bool File::ParseFile(bela::error_code &ec) {
if (!ReadAt(&dh, sizeof(DosHeader), 0, ec)) {
return false;
}
constexpr auto x = 0x3c;

int64_t base = 0;
if (bela::fromle(dh.e_magic) == IMAGE_DOS_SIGNATURE) {
Expand Down
8 changes: 5 additions & 3 deletions vendor/bela/src/belawin/pe/string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ bool File::readStringTable(bela::error_code &ec) {
return true;
}
auto offset = fh.PointerToSymbolTable + COFFSymbolSize * fh.NumberOfSymbols;
if (static_cast<int64_t>(offset + 4) >= size) {
return true;
}
uint32_t l = 0;

if (!ReadAt(&l, sizeof(l), offset, ec)) {
return false;
}
l = bela::fromle(l);
if (l <= 4) {
return false;
if (l <= 4 || static_cast<int64_t>(l + offset) > size) {
return true;
}
l -= 4;
if (stringTable.data = reinterpret_cast<uint8_t *>(HeapAlloc(GetProcessHeap(), 0, l)); stringTable.data == nullptr) {
Expand Down

0 comments on commit 6f1b058

Please sign in to comment.