Add extras builder code and other fixes

This commit is contained in:
DSR! committed 2024-06-17 01:35:52 -03:00
1 parent d800868287
commit ef32c32908
6 files changed
+132 -28

No files matched your search

+118
View File
@@ -0,0 +1,118 @@
name: Builder main installer
on:
workflow_dispatch:
env:
SRC_PATH: ${{ github.workspace }}/src
INSTALLER_SCRIPT_PATH: ${{ github.workspace }}/src/bin/installer/bin
EXTRAS_PATH: ${{ github.workspace }}/src/extras
jobs:
build-job:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: ${{ env.SRC_PATH }}
- name: Install Python packages
run: pip install py7zr pefile colorama
##----------------
## Build Ghidra
##----------------
- name: Update Ghidra installer .iss config paths
working-directory: ${{ env.EXTRAS_PATH }}/ghidra/installer
shell: bash
run: |
WORKSPACE_BUILD_PATH=$(echo "${{ github.workspace }}" | tr '\\' '/')
WORKSPACE_SRC_PATH=$(echo "${{ env.SRC_PATH }}" | tr '\\' '/')
sed -i "s|C:\\\\code\\\\toolkit|$WORKSPACE_SRC_PATH|g" setup.iss
sed -i "s|C:\\\\code|$WORKSPACE_BUILD_PATH|g" setup.iss
- name: Update version number in Ghidra installer .iss
working-directory: ${{ env.EXTRAS_PATH }}/ghidra/installer
shell: bash
run: |
VERSION_CODE=$(date +'%Y.%m')
sed -i 's/RELEASE/'"$VERSION_CODE"'/g' setup.iss
- name: Build Ghidra installer
working-directory: ${{ env.EXTRAS_PATH }}/ghidra/installer
run: ISCC.exe setup.iss
##----------------
## Build Oldies
##----------------
- name: Unpack tools Oldies
working-directory: ${{ env.INSTALLER_SCRIPT_PATH }}
run: python unpack-project.py -f ${{ env.EXTRAS_PATH }}/oldies/toolkit
- name: Update Oldies installer .iss config paths
working-directory: ${{ env.EXTRAS_PATH }}/oldies/installer
shell: bash
run: |
WORKSPACE_BUILD_PATH=$(echo "${{ github.workspace }}" | tr '\\' '/')
WORKSPACE_SRC_PATH=$(echo "${{ env.SRC_PATH }}" | tr '\\' '/')
sed -i "s|C:\\\\code\\\\toolkit|$WORKSPACE_SRC_PATH|g" setup.iss
sed -i "s|C:\\\\code|$WORKSPACE_BUILD_PATH|g" setup.iss
- name: Update version number in Oldies installer .iss
working-directory: ${{ env.EXTRAS_PATH }}/oldies/installer
shell: bash
run: |
VERSION_CODE=$(date +'%Y.%m')
sed -i 's/RELEASE/'"$VERSION_CODE"'/g' setup.iss
- name: Build Oldies installer
working-directory: ${{ env.EXTRAS_PATH }}/oldies/installer
run: ISCC.exe setup.iss
##----------------
## Build Unpacking
##----------------
- name: Unpack tools Unpacking
working-directory: ${{ env.INSTALLER_SCRIPT_PATH }}
run: python unpack-project.py -f ${{ env.EXTRAS_PATH }}/unpacking/toolkit
- name: Update Unpacking installer .iss config paths
working-directory: ${{ env.EXTRAS_PATH }}/unpacking/installer
shell: bash
run: |
WORKSPACE_BUILD_PATH=$(echo "${{ github.workspace }}" | tr '\\' '/')
WORKSPACE_SRC_PATH=$(echo "${{ env.SRC_PATH }}" | tr '\\' '/')
sed -i "s|C:\\\\code\\\\toolkit|$WORKSPACE_SRC_PATH|g" setup.iss
sed -i "s|C:\\\\code|$WORKSPACE_BUILD_PATH|g" setup.iss
- name: Update version number in Unpacking installer .iss
working-directory: ${{ env.EXTRAS_PATH }}/unpacking/installer
shell: bash
run: |
VERSION_CODE=$(date +'%Y.%m')
sed -i 's/RELEASE/'"$VERSION_CODE"'/g' setup.iss
- name: Build Unpacking installer
working-directory: ${{ env.EXTRAS_PATH }}/unpacking/installer
run: ISCC.exe setup.iss
- name: Generate checksums report
working-directory: ${{ env.INSTALLER_SCRIPT_PATH }}
run: |
Set-ExecutionPolicy Bypass -Scope Process -Force
.\generate-checksums.ps1 -Directory "${{ env.EXTRAS_PATH }}" -OutputFile "${{ github.workspace }}/extras_tools_checksums.txt"
.\generate-checksums.ps1 -Directory "${{ github.workspace }}" -FilePattern "*.exe" -NoRecurse -OutputFile "${{ github.workspace }}/extras_installer_checksums.txt"
- name: Upload Setup as Artifact
uses: actions/upload-artifact@v4
with:
name: setup-installer-artifact
path: |
${{ github.workspace }}/*.exe
${{ github.workspace }}/extras_tools_checksums.txt
${{ github.workspace }}/extras_installer_checksums.txt
+2 -2
View File
@@ -47,7 +47,7 @@ jobs:
- name: Build full installer
working-directory: ${{ env.FULL_INSTALLER_PATH }}
run: ISCC.exe setup.iss /DMySrcDir="${{ env.SRC_PATH }}" /DMyOutputDir="${{ github.workspace }}"
run: ISCC.exe setup.iss
- name: Update lite installer .iss config paths
working-directory: ${{ env.LITE_INSTALLER_PATH }}
@@ -67,7 +67,7 @@ jobs:
- name: Build lite installer
working-directory: ${{ env.LITE_INSTALLER_PATH }}
run: ISCC.exe setup.iss /DMySrcDir="${{ env.SRC_PATH }}" /DMyOutputDir="${{ github.workspace }}"
run: ISCC.exe setup.iss
- name: Generate checksums report
working-directory: ${{ env.INSTALLER_SCRIPT_PATH }}
+9 -23
View File
@@ -6,15 +6,13 @@ param (
[switch]$NoRecurse
)
# Initialize an array to store the hash results
$hashResults = @()
# Initialize a list to store the hash results for better performance
$hashResults = New-Object System.Collections.Generic.List[string]
# Function to compute SHA-256 hash of a file
function Get-FileHashSHA256 {
param (
[string]$filePath
)
param ([string]$filePath)
$stream = [System.IO.File]::OpenRead($filePath)
$sha256 = [System.Security.Cryptography.SHA256]::Create()
$hash = $sha256.ComputeHash($stream)
@@ -23,31 +21,19 @@ function Get-FileHashSHA256 {
return [BitConverter]::ToString($hash) -replace "-", ""
}
# Verify that the Directory parameter is provided
if (-not $Directory) {
Write-Error "The 'Directory' parameter is mandatory."
exit 1
}
# Get the full path of the directory
$fullDirectoryPath = (Get-Item -Path $Directory).FullName
# Determine if recursion is enabled
if ($NoRecurse) {
$searchOption = [System.IO.SearchOption]::TopDirectoryOnly
} else {
$searchOption = [System.IO.SearchOption]::AllDirectories
}
# Determine recursion based on $NoRecurse
$searchOption = $NoRecurse ? [System.IO.SearchOption]::TopDirectoryOnly : [System.IO.SearchOption]::AllDirectories
# Iterate over each file in the directory matching the pattern
Get-ChildItem -Path $Directory -Filter $FilePattern -File -Recurse:$searchOption | ForEach-Object {
Get-ChildItem -Path $Directory -Filter $FilePattern -File -Recurse: -not $NoRecurse | ForEach-Object {
$fileHash = Get-FileHashSHA256 -filePath $_.FullName
$relativePath = $_.FullName.Substring($fullDirectoryPath.Length + 1).TrimStart('\')
$hashResults += "$fileHash .\$relativePath"
$hashResults.Add("$fileHash .\$relativePath")
}
# Output the hash results to the file
# Output the hash results to the file and console
$hashResults | Out-File -FilePath $OutputFile
# Output the hash results to the console
$hashResults | ForEach-Object { Write-Output $_ }
+1 -1
View File
@@ -3,7 +3,7 @@
#define MyAppName "Indetectables Toolkit Extras: Ghidra"
#define MyAppNameOriginal "Indetectables Toolkit"
#define MyAppVersion "2023.11"
#define MyAppVersion "RELEASE"
#define MyAppPublisher "Indetectables"
#define MyAppURL "https://www.indetectables.net/"
#define MyAppToolsFolder "{app}\toolkit"
+1 -1
View File
@@ -3,7 +3,7 @@
#define MyAppName "Indetectables Toolkit Extras: Oldies"
#define MyAppNameOriginal "Indetectables Toolkit"
#define MyAppVersion "2023.11"
#define MyAppVersion "RELEASE"
#define MyAppPublisher "Indetectables"
#define MyAppURL "https://www.indetectables.net/"
#define MyAppToolsFolder "{app}\toolkit"
+1 -1
View File
@@ -3,7 +3,7 @@
#define MyAppName "Indetectables Toolkit Extras: Unpacking"
#define MyAppNameOriginal "Indetectables Toolkit"
#define MyAppVersion "2023.11"
#define MyAppVersion "RELEASE"
#define MyAppPublisher "Indetectables"
#define MyAppURL "https://www.indetectables.net/"
#define MyAppToolsFolder "{app}\toolkit"