mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-04-02 05:27:40 -05:00
patterns/ac_unity: Rename folder to be clonable on Windows
This commit is contained in:
47
patterns/AC Unity/acu_data_compressed.hexpat
Normal file
47
patterns/AC Unity/acu_data_compressed.hexpat
Normal file
@@ -0,0 +1,47 @@
|
||||
#pragma description Assassin's Creed: Unity's Compressed .data file
|
||||
#pragma author haru233
|
||||
|
||||
// many thanks to AxCut
|
||||
// ImHex Hex Pattern File for Assassin's Creed: Unity's Compressed .data files
|
||||
|
||||
|
||||
import std.core;
|
||||
import std.mem;
|
||||
|
||||
enum CompressionType : u8 {
|
||||
LZO1X_ = 0x00, // Both 0x00 and 0x01 mean LZO1X
|
||||
LZO1X = 0x01,
|
||||
LZO2A = 0x02,
|
||||
xmemdecompress = 0x03,
|
||||
LZO1C = 0x05
|
||||
};
|
||||
|
||||
struct CHUNK {
|
||||
u16 Uncompressed_Size;
|
||||
u16 Compressed_Size;
|
||||
};
|
||||
|
||||
struct CHUNK_Data {
|
||||
u32 Hash;
|
||||
|
||||
u64 i = std::core::array_index();
|
||||
u8 data[parent.chunk[i].Compressed_Size];
|
||||
};
|
||||
|
||||
struct PACK {
|
||||
u64 ID;
|
||||
padding[2];
|
||||
CompressionType Compression_Type;
|
||||
padding[3];
|
||||
u8 Version;
|
||||
u16 CHUNK_Count;
|
||||
|
||||
CHUNK chunk[CHUNK_Count];
|
||||
CHUNK_Data data[CHUNK_Count];
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
PACK pack[while(!std::mem::eof())] @0x00;
|
||||
93
patterns/AC Unity/acu_data_decompressed.hexpat
Normal file
93
patterns/AC Unity/acu_data_decompressed.hexpat
Normal file
@@ -0,0 +1,93 @@
|
||||
#pragma description Assassin's Creed: Unity's Decompressed .data file
|
||||
#pragma author haru233
|
||||
|
||||
// Thanks to yretenai on GitHub for helping with the Block Allocator part
|
||||
|
||||
import std.core;
|
||||
import std.mem;
|
||||
|
||||
struct Block_Allocator_Type0 {
|
||||
padding[4];
|
||||
u32 Class_ID;
|
||||
u32 Size;
|
||||
};
|
||||
|
||||
struct Block_Allocator_Type1 {
|
||||
padding[4];
|
||||
u32 Type_ID;
|
||||
u32 Size;
|
||||
};
|
||||
|
||||
struct Block_Allocator {
|
||||
u16 Version;
|
||||
|
||||
if (Version == 0) {
|
||||
u32 Block_Allocator_Number;
|
||||
Block_Allocator_Type0 block_allocator_type0[Block_Allocator_Number];
|
||||
}
|
||||
|
||||
else if (Version == 1) {
|
||||
u32 Block_Allocator_Number;
|
||||
Block_Allocator_Type1 block_allocator_type1_[Block_Allocator_Number];
|
||||
}
|
||||
|
||||
else if (Version == 2) {
|
||||
bool Has_Secondary_Block_Allocator;
|
||||
u32 Main_Block_Allocator_Number;
|
||||
|
||||
Block_Allocator_Type1 block_allocator_type1__[Main_Block_Allocator_Number];
|
||||
|
||||
if (Has_Secondary_Block_Allocator) {
|
||||
u32 Secondary_Block_Allocator_Number;
|
||||
Block_Allocator_Type1 block_allocator_type1___[Secondary_Block_Allocator_Number+1];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct File {
|
||||
u32 Object_Hash;
|
||||
u32 File_Size;
|
||||
u32 Filename_Length;
|
||||
|
||||
if (File_Size > 0) {
|
||||
if (Filename_Length == 0) {
|
||||
bool HasBlockAllocator;
|
||||
|
||||
if (HasBlockAllocator) {
|
||||
Block_Allocator block_allocator;
|
||||
u8 File_Data[File_Size];
|
||||
}
|
||||
|
||||
else
|
||||
u8 File_Data[File_Size];
|
||||
}
|
||||
|
||||
else {
|
||||
char Filename[Filename_Length];
|
||||
|
||||
bool HasBlockAllocator;
|
||||
|
||||
if (HasBlockAllocator) {
|
||||
Block_Allocator block_allocator;
|
||||
u8 File_Data[File_Size];
|
||||
}
|
||||
|
||||
else
|
||||
u8 File_Data[File_Size];
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
continue;
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
File file[while(!std::mem::eof())] @0x00;
|
||||
64
patterns/AC Unity/acu_forge.hexpat
Normal file
64
patterns/AC Unity/acu_forge.hexpat
Normal file
@@ -0,0 +1,64 @@
|
||||
#pragma description Assassin's Creed: Unity's .forge archive file
|
||||
#pragma author haru233
|
||||
|
||||
// many thanks to AxCut
|
||||
// ImHex Hex Pattern File for Assassin's Creed: Unity's .forge files
|
||||
|
||||
import std.core;
|
||||
|
||||
struct Forge_Header {
|
||||
char MAGIC[8];
|
||||
padding[1];
|
||||
u32 Version;
|
||||
u32 File_Data_Header_Offset;
|
||||
};
|
||||
|
||||
struct File_Data_Header {
|
||||
u32 File_Count;
|
||||
padding[32];
|
||||
u64 File_Data_Header2_Offset;
|
||||
};
|
||||
|
||||
struct File_Data_Header2 {
|
||||
u32 File_Count2;
|
||||
padding[4];
|
||||
u64 File_Table_Offset;
|
||||
padding[12];
|
||||
u32 File_Count3;
|
||||
u64 File_Name_Table_Offset;
|
||||
padding[8];
|
||||
};
|
||||
|
||||
|
||||
struct File_Table {
|
||||
u64 Raw_Data_Offset;
|
||||
u64 File_ID;
|
||||
u32 Raw_Data_Size;
|
||||
};
|
||||
|
||||
struct File_Name_Table {
|
||||
u32 Raw_Data_Size;
|
||||
padding[40];
|
||||
char Filename[128];
|
||||
padding[20];
|
||||
};
|
||||
|
||||
|
||||
Forge_Header forge_header @0x00;
|
||||
|
||||
File_Data_Header file_data_header @(forge_header.File_Data_Header_Offset);
|
||||
|
||||
File_Data_Header2 file_data_header2 @(file_data_header.File_Data_Header2_Offset);
|
||||
|
||||
File_Table file_table[file_data_header.File_Count] @(file_data_header2.File_Table_Offset);
|
||||
|
||||
File_Name_Table file_name_table[file_data_header.File_Count] @(file_data_header2.File_Name_Table_Offset);
|
||||
|
||||
|
||||
struct Raw_Data_Table {
|
||||
u64 i = std::core::array_index();
|
||||
u8 Raw_Data[file_table[i].Raw_Data_Size] @ file_table[i].Raw_Data_Offset;
|
||||
};
|
||||
|
||||
|
||||
Raw_Data_Table raw_data_table[file_data_header.File_Count] @0x00;
|
||||
Reference in New Issue
Block a user