5 Commits
2.5 ... 2.7

Author SHA1 Message Date
361c0a1cdb Add exetool for modifying PE/COFF image subsystem
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/build Pipeline was successful
2023-01-06 16:23:54 +01:00
d6531be5ee Update LLVM
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2022-12-17 12:10:08 +01:00
771d3783fa Update LLVM
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2022-11-08 23:32:18 +01:00
2e7c7ec1d7 Update LLVM to 15.0.2
All checks were successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/tag/build Pipeline was successful
2022-10-05 08:25:06 +02:00
99f0b83ac7 Add missing cmake patch
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2022-10-02 14:29:45 +02:00
3 changed files with 94 additions and 1 deletions

View File

@@ -23,7 +23,7 @@ CMAKEVCS="https://gitlab.kitware.com/cmake/cmake.git"
# LLVM Settings
LLVMDIR="${SRCDIR}/llvm"
LLVMTAG="llvmorg-15.0.1"
LLVMTAG="llvmorg-15.0.6"
LLVMVCS="https://github.com/llvm/llvm-project.git"
# Make Settings
@@ -502,6 +502,7 @@ xtchain_build()
ln -sf ${EXEC} ${BINDIR}/bin/${ARCH}-w64-mingw32-${EXEC}
done
done
cp ${WRKDIR}/scripts/exetool ${BINDIR}/bin/
cp ${WRKDIR}/scripts/xtclib ${BINDIR}/lib/xtchain/
cp ${WRKDIR}/scripts/xtchain ${BINDIR}/
}

View File

@@ -0,0 +1,13 @@
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 818109f0b7..749377d193 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -7,7 +7,7 @@ set(CMake_VERSION_IS_DIRTY 0)
# Start with the full version number used in tags. It has no dev info.
set(CMake_VERSION
- "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}")
+ "${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}-XTC")
if(DEFINED CMake_VERSION_RC)
set(CMake_VERSION "${CMake_VERSION}-rc${CMake_VERSION_RC}")
endif()

79
scripts/exetool Executable file
View File

@@ -0,0 +1,79 @@
#!/usr/bin/env python3
import sys
import struct
if len(sys.argv) < 3:
print("XTChain ExeTool for modifying PE/COFF image subsystem\nNot sufficient parametrs. '[PE/COFF Image File]' '[SubSystem]'")
sys.exit(1)
ImageFile = sys.argv[1]
Subsystem = sys.argv[2].upper()
# Set proper subsystem
if Subsystem == "UNKNOWN":
ImageSubsystem = 0x00
elif Subsystem == "NT_NATIVE":
ImageSubsystem = 0x01
elif Subsystem == "WINDOWS_GUI":
ImageSubsystem = 0x02
elif Subsystem == "WINDOWS_CLI":
ImageSubsystem = 0x03
elif Subsystem == "WINDOWS_CE_OLD":
ImageSubsystem = 0x04
elif Subsystem == "OS2_CUI":
ImageSubsystem = 0x05
elif Subsystem == "POSIX_CUI":
ImageSubsystem = 0x07
elif Subsystem == "NATIVE_WINDOWS":
ImageSubsystem = 0x08
elif Subsystem == "WINDOWS_CE_GUI":
ImageSubsystem = 0x09
elif Subsystem == "EFI_APPLICATION":
ImageSubsystem = 0x0A
elif Subsystem == "EFI_BOOT_SERVICE_DRIVER":
ImageSubsystem = 0x0B
elif Subsystem == "EFI_RUNTIME_DRIVER":
ImageSubsystem = 0x0C
elif Subsystem == "EFI_ROM":
ImageSubsystem = 0x0D
elif Subsystem == "XBOX":
ImageSubsystem = 0x0E
elif Subsystem == "WINDOWS_BOOT_APPLICATION":
ImageSubsystem = 0x10
elif Subsystem == "XT_NATIVE_KERNEL":
ImageSubsystem = 0x14
elif Subsystem == "XT_NATIVE_APPLICATION":
ImageSubsystem = 0x15
elif Subsystem == "XT_NATIVE_DRIVER":
ImageSubsystem = 0x16
elif Subsystem == "XT_DYNAMIC_LIBRARY":
ImageSubsystem = 0x17
elif Subsystem == "XT_APPLICATION_CLI":
ImageSubsystem = 0x18
elif Subsystem == "XT_APPLICATION_GDI":
ImageSubsystem = 0x19
else:
print("Invalid subsystem privided")
exit(2)
# Open PE/COFF image file
PeImage = open(sys.argv[1], "r+b")
# Get PE header
PeImage.seek(0x3C)
(PeHeader,)=struct.unpack("H", PeImage.read(2))
# Get PE signature
PeImage.seek(PeHeader)
(PeSignature,)=struct.unpack("I", PeImage.read(4))
if PeSignature != 0x4550:
print("Invalid or corrupted PE header")
# Set new image subsystem
PeImage.seek(PeHeader + 0x5C)
print("Setting subsystem to " + str(ImageSubsystem))
PeImage.write(struct.pack("H", ImageSubsystem))
# Close PE/COFF image file
PeImage.close()