Upstream changes from WiseUnpacker

This commit is contained in:
Matt Nadareski
2025-08-13 12:22:11 -04:00
parent 4ef79ccdca
commit c2a5d6770c
16 changed files with 289 additions and 116 deletions

View File

@@ -0,0 +1,36 @@
namespace SabreTools.Models.WiseInstaller.Actions
{
/// <summary>
/// Add Directory to PATH
///
/// This action adds a directory to the PATH environment variable, as set in Autoexec.bat.
/// The directory is appended to every occurrence of the SET PATH statement that does not
/// already contain it. A SET PATH statement is added if none exists. The system restarts at
/// the end of installation so that the new PATH takes effect.
/// </summary>
/// <remarks>
/// This action is called through Call DLL Function and is mapped to "f0".
/// </remarks>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class AddDirectoryToPath : FunctionData
{
/// <summary>
/// Flags from the argument data
/// </summary>
/// <remarks>
/// Encoded as a string, binary representation in script file.
/// Expected flags:
/// - Location to add [start of PATH or end of PATH] (unknown)
/// + No indication that this flag is respected, if it exists
/// - Add to all PATH variables (unknown)
/// + Only seems to apply to AUTOEXEC.BAT-based paths?
/// </remarks>
public byte DataFlags { get; set; }
/// <summary>
/// Directory name to add to path
/// </summary>
/// <remarks>May contain a variable name</remarks>
public string? Directory { get; set; }
}
}

View File

@@ -12,21 +12,51 @@ namespace SabreTools.Models.WiseInstaller.Actions
/// </summary>
/// <remarks>
/// This action is called through Call DLL Function and is mapped to "f1".
///
/// Probably this layout:
/// - Flags (numeric) (e.g. "12", "8")
/// - Unknown string (empty in samples)
/// - Executable path (e.g. "%WIN%\hcwSubID.exe", "765.exe")
/// - Executable path again (e.g. "%WIN%\hcwSubID.exe", "765.exe")
/// - Unknown string (empty in samples)
/// - Numeric value (e.g. "0")
/// </remarks>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class AddToAutoexecBat : FunctionData
{
/// <summary>
/// Arguments passed in from the Call DLL Function
/// Flags from the argument data
/// </summary>
public string[]? Args { get; set; }
/// <remarks>
/// Encoded as a string, binary representation in script file.
/// Expected flags:
/// - Case Sensitive (0x01)
/// - Insert Action (unknown)
/// - Match Criteria (unknown)
/// - Ignore White Space (unknown)
/// - Make Backup File (unknown)
/// </remarks>
public byte DataFlags { get; set; }
/// <summary>
/// Full path to the text file to edit
/// </summary>
/// <remarks>
/// Ignored because structure is shared with both <see cref="AddToConfigSys"/>
/// and <see cref="InsertLineIntoTextFile"/>
/// </remarks>
public string? FileToEdit { get; set; }
/// <summary>
/// Text to insert into the file
/// </summary>
public string? TextToInsert { get; set; }
/// <summary>
/// Search for Text
/// </summary>
public string? SearchForText { get; set; }
/// <summary>
/// Comment Text
/// </summary>
public string? CommentText { get; set; }
/// <summary>
/// Line number to insert text at, 0 for append to end
/// </summary>
public int LineNumber { get; set; }
}
}

View File

@@ -10,21 +10,51 @@ namespace SabreTools.Models.WiseInstaller.Actions
/// </summary>
/// <remarks>
/// This action is called through Call DLL Function and is mapped to "f2".
///
/// Probably this layout:
/// - Flags (numeric) (e.g. "12", "8")
/// - Unknown string (empty in samples)
/// - Executable path (e.g. "%WIN%\hcwSubID.exe", "765.exe")
/// - Executable path again (e.g. "%WIN%\hcwSubID.exe", "765.exe")
/// - Unknown string (empty in samples)
/// - Numeric value (e.g. "0")
/// </remarks>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class AddToConfigSys : FunctionData
{
/// <summary>
/// Arguments passed in from the Call DLL Function
/// Flags from the argument data
/// </summary>
public string[]? Args { get; set; }
/// <remarks>
/// Encoded as a string, binary representation in script file.
/// Expected flags:
/// - Case Sensitive (0x01)
/// - Insert Action (unknown)
/// - Match Criteria (unknown)
/// - Ignore White Space (unknown)
/// - Make Backup File (unknown)
/// </remarks>
public byte DataFlags { get; set; }
/// <summary>
/// Full path to the text file to edit
/// </summary>
/// <remarks>
/// Ignored because structure is shared with both <see cref="AddToAutoexecBat"/>
/// and <see cref="InsertLineIntoTextFile"/>
/// </remarks>
public string? FileToEdit { get; set; }
/// <summary>
/// Text to insert into the file
/// </summary>
public string? TextToInsert { get; set; }
/// <summary>
/// Search for Text
/// </summary>
public string? SearchForText { get; set; }
/// <summary>
/// Comment Text
/// </summary>
public string? CommentText { get; set; }
/// <summary>
/// Line number to insert text at, 0 for append to end
/// </summary>
public int LineNumber { get; set; }
}
}

View File

@@ -3,29 +3,25 @@ namespace SabreTools.Models.WiseInstaller.Actions
/// <summary>
/// Display Billboard
///
/// This action displays a bitmap or .GRF file during installation if you have set the
/// background to display a gradient on the Screen page. Create .GRF files (scalable
/// bitmaps) with the Custom Billboard Editor.
///
/// You can use up to 16 Display Billboard actions in the script.
/// </summary>
/// <remarks>
/// This is likely compressed Billboard data, though it is
/// very difficult to determine what the format of the extracted
/// data is. The official documentation mentions that it's
/// a vector format, but it does not appear to be natively
/// openable with standard graphics viewing programs.
/// </remarks>
/// <see href="https://codeberg.org/CYBERDEV/REWise/src/branch/master/src/wisescript.h"/>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class Unknown0x06 : MachineStateData
public class DisplayBillboard : MachineStateData
{
/// <summary>
/// Flags(?)
/// Flags
/// </summary>
/// <remarks>
/// Values from WISE0001.DLL
/// - & 0x4000 != 0 -> FUN_1000bb6a
/// - & 0x3805 != 0 ->
///
/// Expected values:
/// - 0x3805 - Erase num?; Erase all?
/// - 0x4000 - Hide progress bar
/// </remarks>
public ushort Operand_1 { get; set; } // 0x01 - 0x02
public ushort Flags { get; set; } // 0x01 - 0x02
/// <summary>
/// Flags(?)
@@ -34,7 +30,7 @@ namespace SabreTools.Models.WiseInstaller.Actions
/// Values from WISE0001.DLL
/// - >> 0x0F -> piVar3[10]
/// - & 0x4000 -> uVar8 = Operand_2 & 0x3FFF
/// - [0x04] & 0x80 != 0 ->
/// - Unknown (0x8000)
/// </remarks>
public ushort Operand_2 { get; set; } // 0x03 - 0x04
@@ -50,7 +46,8 @@ namespace SabreTools.Models.WiseInstaller.Actions
/// <summary>
/// Deflate information
/// </summary>
public ScriptDeflateInfoContainer? DeflateInfo { get; set; } // 0x07 -
/// <remarks> One per language</remarks>
public ScriptDeflateInfo[]? DeflateInfo { get; set; } // 0x07 -
/// <summary>
/// Terminator?

View File

@@ -22,6 +22,9 @@ namespace SabreTools.Models.WiseInstaller.Actions
/// <remarks>
/// To get the root value, do (FlagsAndRoot & 0x1F)
/// Flag values:
/// - 0x10 - Force backup of registry value (if 0x80 == 0)
/// + It overrides the values set by 0x24 and 0x25
/// and then disables the flag after
/// - 0x40 - Delete? (If root is not 0?)
/// - 0x80 - Unknown
/// </remarks>

View File

@@ -0,0 +1,43 @@
namespace SabreTools.Models.WiseInstaller.Actions
{
/// <summary>
/// Install DirectX Components
///
/// Little is known about this function other than it seems to install any
/// local DirectX components, if necessary. No official documentation
/// is publicly available that contains a reference to this.
/// </summary>
/// <remarks>
/// This action is called through Call DLL Function and is mapped to "f30".
/// </remarks>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class InstallDirectXComponents : FunctionData
{
/// <summary>
/// Flags from the argument data
/// </summary>
/// <remarks>
/// Encoded as a string, binary representation in script file.
/// Expected flags:
/// - 0x40 - Unsets itself and sets 0x200 if not already
/// - If final value & 0x3fffff7f == 0, return failure
/// </remarks>
public byte DataFlags { get; set; }
/// <summary>
/// Root path containing all DirectX components
/// </summary>
public string? RootPath { get; set; }
/// <summary>
/// Path to the DSETUP.DLL to be used
/// </summary>
public string? LibraryPath { get; set; }
/// <summary>
/// Unknown numeric value
/// </summary>
/// <remarks>Not fully identified; replaces the flags if not 0?</remarks>
public int SizeOrOffsetOrFlag { get; set; }
}
}

View File

@@ -92,8 +92,11 @@ namespace SabreTools.Models.WiseInstaller.Actions
public string[]? Description { get; set; }
/// <summary>
/// Seen used on hl15of16.exe and hl1316.exe, on others its \0
/// Source file
/// </summary>
public string? Operand_11 { get; set; }
/// <remarks>
/// Unused because structure is internally shared with <see cref="CopyLocalFile"/>
/// </remarks>
public string? Source { get; set; }
}
}

View File

@@ -0,0 +1,17 @@
namespace SabreTools.Models.WiseInstaller.Actions
{
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// This action enables a flag that is used by this and <see cref="Unknown0x25"/>.
/// It seems to only be referenced in contexts where there are registry
/// keys read and written, specifically about repair.
/// </remarks>
/// <see href="https://codeberg.org/CYBERDEV/REWise/src/branch/master/src/wisescript.h"/>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class Unknown0x24 : MachineStateData
{
// There is no data
}
}

View File

@@ -0,0 +1,17 @@
namespace SabreTools.Models.WiseInstaller.Actions
{
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// This action enables a flag that is used by this and <see cref="Unknown0x24"/>.
/// It seems to only be referenced in contexts where there are registry
/// keys read and written, specifically about repair.
/// </remarks>
/// <see href="https://codeberg.org/CYBERDEV/REWise/src/branch/master/src/wisescript.h"/>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class Unknown0x25 : MachineStateData
{
// There is no data
}
}

View File

@@ -1,23 +0,0 @@
namespace SabreTools.Models.WiseInstaller.Actions
{
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// This action is called through Call DLL Function and is mapped to "f0".
///
/// Could be either:
/// - Set Control Text
/// - Set Current Control
///
/// Layout is unknown
/// </remarks>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class UnknownF0 : FunctionData
{
/// <summary>
/// Arguments passed in from the Call DLL Function
/// </summary>
public string[]? Args { get; set; }
}
}

View File

@@ -1,25 +0,0 @@
namespace SabreTools.Models.WiseInstaller.Actions
{
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// This action is called through Call DLL Function and is mapped to "f30".
///
/// Maybe "Modify Component Size"?
///
/// Probably this layout:
/// - Flags (numeric)
/// - Directory name (e.g. "%INST%\..\DirectX")
/// - File name (e.g. "%INST%\..\DirectX\DSETUP.DLL")
/// - Offset? (e.g. "2623")
/// </remarks>
/// <see href="https://www.manualslib.com/manual/404969/Symantec-Wisescript-Editor-8-0-Reference-For-Wise-Package-Studio-V1-0.html"/>
public class UnknownF30 : FunctionData
{
/// <summary>
/// Arguments passed in from the Call DLL Function
/// </summary>
public string[]? Args { get; set; }
}
}

View File

@@ -12,30 +12,42 @@ namespace SabreTools.Models.WiseInstaller
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
];
/// <summary>
/// Count of non-language strings for an Action
/// </summary>
/// <remarks>Derived from WISE0001.DLL</remarks>
/// <remarks>
/// Derived from WISE0001.DLL
/// One variant of the DLL has action 0x06 have a
/// value of `0x01` instead of `0x00`.
/// One variant of the DLL has action 0x18 have a
/// value of `0x01` instead of `0x00`.
/// </remarks>
public static readonly byte[] CountOfStaticActionStrings =
[
0x02, 0x00, 0x01, 0x00, 0x00, 0x03, 0x00, 0x03,
0x00, 0x04, 0x03, 0x01, 0x02, 0x00, 0x00, 0x00,
0x00, 0x01, 0x03, 0x00, 0x02, 0x02, 0x01, 0x01,
0x00, 0x03, 0x02, 0x00, 0x01, 0x02, 0x01, 0x00,
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00,
];
/// <summary>
/// Size of the invariant data for an Action
/// </summary>
/// <remarks>Derived from WISE0001.DLL</remarks>
/// <remarks>
/// One variant of the DLL has action 0x18 have a
/// value of `0x06` instead of `0x01`.
/// </remarks>
public static readonly byte[] SizeOfStaticActionData =
[
0x2B, 0x00, 0x02, 0x02, 0x02, 0x01, 0x13, 0x02,
0x02, 0x02, 0x03, 0x02, 0x02, 0x01, 0x00, 0x01,
0x01, 0x01, 0x2B, 0x00, 0x0D, 0x02, 0x01, 0x06,
0x01, 0x02, 0x02, 0x01, 0x01, 0x01, 0x02, 0x00,
0x00, 0x00, 0x00, 0x02, 0x01, 0x01, 0x00, 0x00,
];
}
}

View File

@@ -76,9 +76,9 @@ namespace SabreTools.Models.WiseInstaller
EditIniFile = 0x05,
/// <summary>
/// Deflated file just used by the installer? (No filename)
/// Display billboard
/// </summary>
UnknownDeflatedFile0x06 = 0x06,
DisplayBillboard = 0x06,
/// <summary>
/// Execute Program
@@ -216,30 +216,50 @@ namespace SabreTools.Models.WiseInstaller
OpenCloseInstallLog = 0x1E,
/// <summary>
/// Unknown
/// Invalid case
/// </summary>
Unknown0x1F = 0x1F,
Invalid0x1F = 0x1F,
/// <summary>
/// Unknown
/// Invalid case
/// </summary>
Unknown0x20 = 0x20,
Invalid0x20 = 0x20,
/// <summary>
/// Unknown
/// Invalid case
/// </summary>
Unknown0x21 = 0x21,
Invalid0x21 = 0x21,
/// <summary>
/// Unknown
/// Invalid case
/// </summary>
Unknown0x22 = 0x22,
Invalid0x22 = 0x22,
/// <summary>
/// ElseIf Statement
/// </summary>
ElseIfStatement = 0x23,
/// <summary>
/// Enable repair?
/// </summary>
/// <remarks>
/// The flag used by this and <see cref="Unknown0x25"/> seems
/// to only be referenced in contexts where there are registry
/// keys read and written, specifically about repair.
/// </remarks>
Unknown0x24 = 0x24,
/// <summary>
/// Disable repair?
/// </summary>
/// <remarks>
/// The flag used by this and <see cref="Unknown0x24"/> seems
/// to only be referenced in contexts where there are registry
/// keys read and written, specifically about repair.
/// </remarks>
Unknown0x25 = 0x25,
// Check in WISE0001.DLL suggests that there could be up
// to opcode 0x3F. If the opcode is greater than 0x3F,
// then the installation aborts with 0xfffffffe.

View File

@@ -9,16 +9,16 @@ namespace SabreTools.Models.WiseInstaller
/// <summary>
/// Start of the deflated data
/// </summary>
public uint DeflateStart { get; set; }
public uint DeflateStart { get; set; } // 0x00 - 0x03 (0x07 - 0x0A)
/// <summary>
/// End of the deflated data
/// </summary>
public uint DeflateEnd { get; set; }
public uint DeflateEnd { get; set; } // 0x04 - 0x07 (0x0B - 0x0E)
/// <summary>
/// Inflated data size
/// </summary>
public uint InflatedSize { get; set; }
public uint InflatedSize { get; set; } // 0x08 - 0x0B (0x0F - 0x12)
}
}

View File

@@ -1,11 +0,0 @@
namespace SabreTools.Models.WiseInstaller
{
/// <see href="https://codeberg.org/CYBERDEV/REWise/src/branch/master/src/wisescript.h"/>
public class ScriptDeflateInfoContainer
{
/// <summary>
/// One per language
/// </summary>
public ScriptDeflateInfo[]? Info { get; set; }
}
}

View File

@@ -9,13 +9,37 @@ namespace SabreTools.Models.WiseInstaller
/// <summary>
/// Flags, unknown mapping
/// </summary>
public byte Flags { get; set; } // 0x00
/// <remarks>
/// The high byte (0x01) being any value but 0x00 indicates
/// that a 32-bit library will be used.
/// </remarks>
public ushort Flags { get; set; } // 0x00 - 0x01
/// <summary>
/// Unknown
/// </summary>
/// <remarks>4 bytes</remarks>
public byte[]? UnknownBytes_1 { get; set; } // 0x01 - 0x04
/// <remarks>
/// Read in a loop with <see cref="UnknownU16_2"/>, possibly
/// an offset? It's read into an array.
///
/// Both values are then used to build variable names if they're
/// non-zero. The variable names use "SYS" as the template.
/// The values are then seemingly read over?
/// </remarks>
public ushort UnknownU16_1 { get; set; } // 0x02 - 0x03
/// <summary>
/// Unknown
/// </summary>
/// <remarks>
/// Read in a loop with <see cref="UnknownU16_1"/>, possibly
/// an offset? It's read into an array.
///
/// Both values are then used to build variable names if they're
/// non-zero. The variable names use "SYS" as the template.
/// The values are then seemingly read over?
/// </remarks>
public ushort UnknownU16_2 { get; set; } // 0x04 - 0x05
/// <summary>
/// Total deflated size of OP 0x00 files?
@@ -69,7 +93,7 @@ namespace SabreTools.Models.WiseInstaller
/// 0x40 - ????
/// byte[1]
/// 0x00 - ????
/// 0x10 - EditRegistry data type is 2 bytes
/// 0x10 - ????
public byte[]? Unknown_22 { get; set; } // 0x15 - 0x2B
/// <summary>