7 Commits
Author SHA1 Message Date
ds5678 1f40d48bb9 Migrate solution file from .sln to .slnx format
Replaced the traditional Visual Studio `.sln` file with the newer `.slnx` format. The `.slnx` file uses a concise XML-based structure, simplifying solution metadata and organization.

Preserved the project reference to `AssetRipper.Conversions.Crunch.csproj` and included solution items such as `.editorconfig`, `.gitignore`, `Directory.Build.props`, `LICENSE`, `README.md`, and `source.cpp`. This migration reduces verbosity and improves maintainability.
2025-11-25 18:01:13 -08:00
ds5678 999c6f3ee3 Updates from new generator 2025-11-25 18:00:12 -08:00
ds5678 539cd6136a Recent changes from generation 2025-09-27 14:24:00 -07:00
ds5678 d7ba303106 Bump version to 1.0.3
Updated the `<VersionPrefix>` property in `Directory.Build.props`
from `1.0.2` to `1.0.3` to reflect a new release or update.
2025-09-21 21:30:02 -07:00
ds5678 29d7dc52db Improve handling of mip levels 2025-09-21 21:28:39 -07:00
ds5678 4c1f81cfa8 Bump version to 1.0.2
Updated the `<VersionPrefix>` in `Directory.Build.props`
from `1.0.1` to `1.0.2` to reflect a new release or update
of the project. This version increment may include new
features, bug fixes, or other improvements.
2025-09-21 20:42:36 -07:00
ds5678 2f5856c66f Improve handling of multiple faces 2025-09-21 20:42:13 -07:00
235 changed files with 1969 additions and 1625 deletions

No files matched your search

-35
View File
@@ -1,35 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.0.11012.119 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AssetRipper.Conversions.Crunch", "AssetRipper.Conversions.Crunch\AssetRipper.Conversions.Crunch.csproj", "{9FBCF75A-A265-68DF-F9A8-1544182F6E8B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9700A52B-5306-4CB6-BE16-1034FF0C63B7}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
LICENSE = LICENSE
README.md = README.md
source.cpp = source.cpp
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9FBCF75A-A265-68DF-F9A8-1544182F6E8B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9FBCF75A-A265-68DF-F9A8-1544182F6E8B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9FBCF75A-A265-68DF-F9A8-1544182F6E8B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9FBCF75A-A265-68DF-F9A8-1544182F6E8B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4159CD3B-0DDE-43BB-8032-421D3FE25C73}
EndGlobalSection
EndGlobal
+11
View File
@@ -0,0 +1,11 @@
<Solution>
<Folder Name="/Solution Items/">
<File Path=".editorconfig" />
<File Path=".gitignore" />
<File Path="Directory.Build.props" />
<File Path="LICENSE" />
<File Path="README.md" />
<File Path="source.cpp" />
</Folder>
<Project Path="AssetRipper.Conversions.Crunch/AssetRipper.Conversions.Crunch.csproj" />
</Solution>
+65 -17
View File
@@ -1,17 +1,18 @@
using AssetRipper.Conversions.Crunch.Structures;
using AssetRipper.Conversions.Crunch.Enumerations;
using AssetRipper.Conversions.Crunch.Structures;
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
namespace AssetRipper.Conversions.Crunch;
public static partial class Crunch
{
public static bool TryDecompress(ReadOnlySpan<byte> input, [NotNullWhen(true)] out byte[]? output)
{
return TryDecompress(input, 0, out output);
}
public const int MaxFaces = (int)crn_limits.cCRNMaxFaces;
public static unsafe bool TryDecompress(ReadOnlySpan<byte> input, int levelIndex, [NotNullWhen(true)] out byte[]? output)
public const int MaxLevels = (int)crn_limits.cCRNMaxLevels;
public static unsafe bool TryDecompress(ReadOnlySpan<byte> input, [NotNullWhen(true)] out byte[]? output)
{
if (input.Length == 0)
{
@@ -23,6 +24,7 @@ public static partial class Crunch
fixed (byte* pInput = input)
{
crnd_crn_texture_info textureInfo = default;
textureInfo.m_struct_size = sizeof(crnd_crn_texture_info);
if (!crnd_get_texture_info(pInput, inputLength, &textureInfo))
{
return False(out output);
@@ -34,19 +36,51 @@ public static partial class Crunch
return False(out output);
}
int width = int.Max(1, textureInfo.field_1 >> levelIndex);
int height = int.Max(1, textureInfo.field_2 >> levelIndex);
int blocksX = int.Max(1, (width + 3) >> 2);
int blocksY = int.Max(1, (height + 3) >> 2);
int rowPitch = blocksX * crnd_get_bytes_per_dxt_block(textureInfo.field_8);
int totalFaceSize = rowPitch * blocksY;
byte[] result = new byte[totalFaceSize];
int fullWidth = textureInfo.m_width;
int fullHeight = textureInfo.m_height;
int levelCount = textureInfo.m_levels;
int faceCount = textureInfo.m_faces;
int bytesPerDxtBlock = textureInfo.m_bytes_per_block;
Debug.Assert(bytesPerDxtBlock == crnd_get_bytes_per_dxt_block(textureInfo.m_format));
if (levelCount < 1 || levelCount > MaxLevels || faceCount < 1 || faceCount > MaxFaces)
{
crnd_unpack_end(context);
return False(out output);
}
int completeImageSize = CalculateCompleteImageSize(fullWidth, fullHeight, bytesPerDxtBlock, levelCount);
byte[] result = new byte[completeImageSize * faceCount];
byte** pResultArray = stackalloc byte*[MaxFaces];
fixed (byte* pResult = result)
{
if (!crnd_unpack_level(context, &pResult, totalFaceSize, rowPitch, levelIndex))
int offset = 0;
for (int levelIndex = 0; levelIndex < levelCount; levelIndex++)
{
crnd_unpack_end(context);
return False(out output);
int width = int.Max(1, fullWidth >> levelIndex);
int height = int.Max(1, fullHeight >> levelIndex);
int blocksX = (width + 3) >> 2;
int blocksY = (height + 3) >> 2;
int rowPitch = blocksX * bytesPerDxtBlock;
int faceSize = rowPitch * blocksY;
new Span<nint>(pResultArray, MaxFaces).Clear();
for (int i = 0; i < faceCount; i++)
{
pResultArray[i] = pResult + offset + i * completeImageSize;
}
if (!crnd_unpack_level(context, pResultArray, faceSize, rowPitch, levelIndex))
{
crnd_unpack_end(context);
return False(out output);
}
offset += faceSize;
}
}
crnd_unpack_end(context);
@@ -55,10 +89,24 @@ public static partial class Crunch
return true;
static unsafe bool False([NotNullWhen(true)] out byte[]? output)
static bool False([NotNullWhen(true)] out byte[]? output)
{
output = null;
return false;
}
static int CalculateCompleteImageSize(int width, int height, int bytesPerDxtBlock, int levelCount)
{
int totalSize = 0;
for (int levelIndex = 0; levelIndex < levelCount; levelIndex++)
{
int levelWidth = int.Max(1, width >> levelIndex);
int levelHeight = int.Max(1, height >> levelIndex);
int blocksX = (levelWidth + 3) >> 2;
int blocksY = (levelHeight + 3) >> 2;
totalSize += blocksX * blocksY * bytesPerDxtBlock;
}
return totalSize;
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,11 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cFlag>@?$scalar_type@G@crnd@@")]
[DemangledName("enum crnd::scalar_type<unsigned short>::<unnamed-enum-cFlag>")]
[CleanName("Enum")]
public enum Enum_43wa3v
{
cFlag = 1
}
@@ -0,0 +1,11 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cFlag>@?$scalar_type@I@crnd@@")]
[DemangledName("enum crnd::scalar_type<unsigned int>::<unnamed-enum-cFlag>")]
[CleanName("Enum")]
public enum Enum_mvhugt
{
cFlag = 1
}
@@ -0,0 +1,11 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cFlag>@?$scalar_type@E@crnd@@")]
[DemangledName("enum crnd::scalar_type<unsigned char>::<unnamed-enum-cFlag>")]
[CleanName("Enum")]
public enum Enum_q5bxgp
{
cFlag = 1
}
@@ -0,0 +1,11 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cNumComps>@?$color_quad@EH@crnd@@")]
[DemangledName("enum crnd::color_quad<unsigned char, int>::<unnamed-enum-cNumComps>")]
[CleanName("Enum")]
public enum Enum_xpjve5
{
cNumComps = -4
}
@@ -0,0 +1,14 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cSigned>@?$color_quad_component_traits@E@crnd@@")]
[DemangledName("enum crnd::color_quad_component_traits<unsigned char>::<unnamed-enum-cSigned>")]
[CleanName("Enum")]
public enum Enum_yqz7zz
{
cSigned = 0,
cFloat = 0,
cMin = 0,
cMax = -1
}
@@ -0,0 +1,24 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4crn_format@@")]
[DemangledName("enum crn_format")]
public enum crn_format
{
cCRNFmtInvalid = -1,
cCRNFmtDXT1 = 0,
cCRNFmtFirstValid = 0,
cCRNFmtDXT3 = 1,
cCRNFmtDXT5 = 2,
cCRNFmtDXT5_CCxY = 3,
cCRNFmtDXT5_xGxR = 4,
cCRNFmtDXT5_xGBR = 5,
cCRNFmtDXT5_AGBR = 6,
cCRNFmtDXN_XY = 7,
cCRNFmtDXN_YX = 8,
cCRNFmtDXT5A = 9,
cCRNFmtETC1 = 10,
cCRNFmtTotal = 11,
cCRNFmtForceDWORD = -1
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4crn_header_flags@crnd@@")]
[DemangledName("enum crnd::crn_header_flags")]
public enum crn_header_flags
{
cCRNHeaderFlagSegmented = 1
}
@@ -0,0 +1,17 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4crn_limits@@")]
[DemangledName("enum crn_limits")]
public enum crn_limits
{
cCRNMaxLevelResolution = 4096,
cCRNMinPaletteSize = 8,
cCRNMaxPaletteSize = 8192,
cCRNMaxFaces = 6,
cCRNMaxLevels = 16,
cCRNMaxHelperThreads = 16,
cCRNMinQualityLevel = 0,
cCRNMaxQualityLevel = 255
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cCRNSigValue>@crn_header@crnd@@")]
[DemangledName("enum crnd::crn_header::<unnamed-enum-cCRNSigValue>")]
public enum crnd_crn_header_unnamed_enum
{
cCRNSigValue = 18552
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cMagicValue>@crn_unpacker@crnd@@")]
[DemangledName("enum crnd::crn_unpacker::<unnamed-enum-cMagicValue>")]
public enum crnd_crn_unpacker_unnamed_enum
{
cMagicValue = 519686845
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cNumSelectorBytes>@dxt1_block@crnd@@")]
[DemangledName("enum crnd::dxt1_block::<unnamed-enum-cNumSelectorBytes>")]
public enum crnd_dxt1_block_unnamed_enum
{
cNumSelectorBytes = 4
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cNumAlphaBytes>@dxt3_block@crnd@@")]
[DemangledName("enum crnd::dxt3_block::<unnamed-enum-cNumAlphaBytes>")]
public enum crnd_dxt3_block_unnamed_enum
{
cNumAlphaBytes = 8
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cNumSelectorBytes>@dxt5_block@crnd@@")]
[DemangledName("enum crnd::dxt5_block::<unnamed-enum-cNumSelectorBytes>")]
public enum crnd_dxt5_block_unnamed_enum
{
cNumSelectorBytes = 6
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4<unnamed-enum-cBitBufSize>@symbol_codec@crnd@@")]
[DemangledName("enum crnd::symbol_codec::<unnamed-enum-cBitBufSize>")]
public enum crnd_symbol_codec_unnamed_enum
{
cBitBufSize = 0x20
}
@@ -0,0 +1,19 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4dxt_constants@crnd@@")]
[DemangledName("enum crnd::dxt_constants")]
public enum dxt_constants
{
cDXTBlockShift = 2,
cDXTBlockSize = 4,
cDXT1BytesPerBlock = 8,
cDXT5NBytesPerBlock = 16,
cDXT1SelectorBits = 2,
cDXT1SelectorValues = 4,
cDXT1SelectorMask = 3,
cDXT5SelectorBits = 3,
cDXT5SelectorValues = 8,
cDXT5SelectorMask = 7
}
@@ -0,0 +1,10 @@
using AssetRipper.Conversions.Crunch.Helpers;
namespace AssetRipper.Conversions.Crunch.Enumerations;
[MangledName(".?AW4eClear@crnd@@")]
[DemangledName("enum crnd::eClear")]
public enum eClear
{
cClear
}
@@ -10,6 +10,6 @@ internal static partial class Get_alloc_failed
[return: NativeType("bool")]
public unsafe static bool Invoke(void* @this)
{
return (unchecked((crnd_vector_f3cmzmc*)@this)->field_3 & 1) == 1;
return (unchecked((crnd_vector_uksit8*)@this)->m_alloc_failed & 1) == 1;
}
}
@@ -16,9 +16,9 @@ internal static partial class Get_alpha
{
if ((uint)x >= 4u || (uint)y >= 4u)
{
crnd_assert.Invoke(String_cahur4b.__pointer, String_yguirrd.__pointer, 3483);
crnd_assert.Invoke(String_jsxkht.__pointer, String_vvx8bt.__pointer, 3483);
}
int num = (byte)((sbyte*)(&((crnd_dxt3_block*)@this)->field_0))[(uint)((y << 1) + (x >>> 1))];
int num = (byte)((sbyte*)(&((crnd_dxt3_block*)@this)->m_alpha))[(uint)((y << 1) + (x >>> 1))];
if ((x & 1) != 0)
{
num >>>= 4;
@@ -15,33 +15,33 @@ internal static partial class Get_bits
{
if ((uint)num_bits > 32u)
{
crnd_assert.Invoke(String_bhrpdhd.__pointer, String_yguirrd.__pointer, 3199);
crnd_assert.Invoke(String_ya7rpa.__pointer, String_vvx8bt.__pointer, 3199);
}
while (((crnd_symbol_codec*)@this)->field_5 < num_bits)
while (((crnd_symbol_codec*)@this)->m_bit_count < num_bits)
{
int num = 0;
if (((crnd_symbol_codec*)@this)->field_1 != ((crnd_symbol_codec*)@this)->field_2)
if (((crnd_symbol_codec*)@this)->m_pDecode_buf_next != ((crnd_symbol_codec*)@this)->m_pDecode_buf_end)
{
void** field_ = &((crnd_symbol_codec*)@this)->field_1;
void* ptr = *field_;
*field_ = (byte*)ptr + 1;
void** pDecode_buf_next = &((crnd_symbol_codec*)@this)->m_pDecode_buf_next;
void* ptr = *pDecode_buf_next;
*pDecode_buf_next = (byte*)ptr + 1;
num = (byte)(*(sbyte*)ptr);
}
int num2;
checked
{
unchecked((crnd_symbol_codec*)@this)->field_5 += 8;
if (unchecked((crnd_symbol_codec*)@this)->field_5 > 32)
unchecked((crnd_symbol_codec*)@this)->m_bit_count += 8;
if (unchecked((crnd_symbol_codec*)@this)->m_bit_count > 32)
{
crnd_assert.Invoke(String_kf9n5db.__pointer, String_yguirrd.__pointer, 3208);
crnd_assert.Invoke(String_igi64g.__pointer, String_vvx8bt.__pointer, 3208);
}
num2 = num << 32 - unchecked((crnd_symbol_codec*)@this)->field_5;
num2 = num << 32 - unchecked((crnd_symbol_codec*)@this)->m_bit_count;
}
((crnd_symbol_codec*)@this)->field_4 |= num2;
((crnd_symbol_codec*)@this)->m_bit_buf |= num2;
}
int result = ((crnd_symbol_codec*)@this)->field_4 >>> 32 - num_bits;
((crnd_symbol_codec*)@this)->field_4 <<= num_bits;
((crnd_symbol_codec*)@this)->field_5 -= num_bits;
int result = ((crnd_symbol_codec*)@this)->m_bit_buf >>> 32 - num_bits;
((crnd_symbol_codec*)@this)->m_bit_buf <<= num_bits;
((crnd_symbol_codec*)@this)->m_bit_count -= num_bits;
return result;
}
}
@@ -12,8 +12,8 @@ internal static partial class Get_bits_init
{
unchecked
{
((crnd_symbol_codec*)@this)->field_4 = 0;
((crnd_symbol_codec*)@this)->field_5 = 0;
((crnd_symbol_codec*)@this)->m_bit_buf = 0;
((crnd_symbol_codec*)@this)->m_bit_count = 0;
}
}
}
@@ -10,13 +10,13 @@ internal static partial class Get_block_colors3
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("class crnd::color_quad<unsigned char, int> *")] void* pDst, [NativeType("unsigned short")] short color0, [NativeType("unsigned short")] short color1)
{
crnd_color_quad crnd_color_quad = default(crnd_color_quad);
crnd_color_quad crnd_color_quad2 = default(crnd_color_quad);
unpack_color_ifs9dpd.Invoke(&crnd_color_quad, color0, scaled: true, 255);
unpack_color_ifs9dpd.Invoke(&crnd_color_quad2, color1, scaled: true, 255);
color_quad_unsigned_char_int_Assignment.Invoke(pDst, &crnd_color_quad);
color_quad_unsigned_char_int_Assignment.Invoke(unchecked((byte*)pDst) + sizeof(crnd_color_quad), &crnd_color_quad2);
set.Invoke(unchecked((byte*)pDst + (nint)2 * sizeof(crnd_color_quad)), blue: unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_2) + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_2) >> 1, green: unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_1) + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_1) >> 1, red: unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_0) + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_0) >> 1, alpha: 255);
crnd_color_quad crnd_color_quad3 = default(crnd_color_quad);
unpack_color_gac4s5.Invoke(&crnd_color_quad2, color0, scaled: true, 255);
unpack_color_gac4s5.Invoke(&crnd_color_quad3, color1, scaled: true, 255);
color_quad_unsigned_char_int_Assignment.Invoke(pDst, &crnd_color_quad2);
color_quad_unsigned_char_int_Assignment.Invoke(unchecked((byte*)pDst) + sizeof(crnd_color_quad), &crnd_color_quad3);
set.Invoke(unchecked((byte*)pDst + (nint)2 * sizeof(crnd_color_quad)), blue: unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_2) + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_2) >> 1, green: unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_1) + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_1) >> 1, red: unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_0) + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_0) >> 1, alpha: 255);
set.Invoke(unchecked((byte*)pDst + (nint)3 * sizeof(crnd_color_quad)), 0, 0, 0, 0);
return 3;
}
@@ -10,16 +10,16 @@ internal static partial class Get_block_colors4
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("class crnd::color_quad<unsigned char, int> *")] void* pDst, [NativeType("unsigned short")] short color0, [NativeType("unsigned short")] short color1)
{
crnd_color_quad crnd_color_quad = default(crnd_color_quad);
crnd_color_quad crnd_color_quad2 = default(crnd_color_quad);
unpack_color_ifs9dpd.Invoke(&crnd_color_quad, color0, scaled: true, 255);
unpack_color_ifs9dpd.Invoke(&crnd_color_quad2, color1, scaled: true, 255);
color_quad_unsigned_char_int_Assignment.Invoke(pDst, &crnd_color_quad);
crnd_color_quad crnd_color_quad3 = default(crnd_color_quad);
unpack_color_gac4s5.Invoke(&crnd_color_quad2, color0, scaled: true, 255);
unpack_color_gac4s5.Invoke(&crnd_color_quad3, color1, scaled: true, 255);
color_quad_unsigned_char_int_Assignment.Invoke(pDst, &crnd_color_quad2);
unchecked
{
color_quad_unsigned_char_int_Assignment.Invoke((byte*)pDst + sizeof(crnd_color_quad), &crnd_color_quad2);
set.Invoke((byte*)pDst + (nint)2 * sizeof(crnd_color_quad), blue: checked(unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_2) * 2 + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_2)) / 3, green: checked(unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_1) * 2 + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_1)) / 3, red: checked(unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_0) * 2 + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_0)) / 3, alpha: 255);
set.Invoke((byte*)pDst + (nint)3 * sizeof(crnd_color_quad), blue: checked(unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_2) * 2 + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_2)) / 3, green: checked(unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_1) * 2 + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_1)) / 3, red: checked(unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad2.field_0))->field_0) * 2 + unchecked((byte)((anon_b9ijpuc*)(&crnd_color_quad.field_0))->field_0)) / 3, alpha: 255);
color_quad_unsigned_char_int_Assignment.Invoke((byte*)pDst + sizeof(crnd_color_quad), &crnd_color_quad3);
set.Invoke((byte*)pDst + (nint)2 * sizeof(crnd_color_quad), blue: checked(unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_2) * 2 + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_2)) / 3, green: checked(unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_1) * 2 + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_1)) / 3, red: checked(unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_0) * 2 + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_0)) / 3, alpha: 255);
set.Invoke((byte*)pDst + (nint)3 * sizeof(crnd_color_quad), blue: checked(unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_2) * 2 + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_2)) / 3, green: checked(unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_1) * 2 + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_1)) / 3, red: checked(unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad3.field))->field_0) * 2 + unchecked((byte)((anon_m9uqrv*)(&crnd_color_quad2.field))->field_0)) / 3, alpha: 255);
return 4;
}
}
@@ -6,25 +6,25 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?get_block_values6@dxt5_block@crnd@@SAIPEAV?$color_quad@EH@2@II@Z")]
[DemangledName("public: static unsigned int __cdecl crnd::dxt5_block::get_block_values6(class crnd::color_quad<unsigned char, int> *, unsigned int, unsigned int)")]
[CleanName("Get_block_values6")]
internal static partial class Get_block_values6_7gyjbyc
internal static partial class Get_block_values6_36ycpg
{
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("class crnd::color_quad<unsigned char, int> *")] void* pDst, [NativeType("unsigned int")] int l, [NativeType("unsigned int")] int h)
{
unchecked
{
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)->field_0))->field_3 = (sbyte)l;
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[1].field_0))->field_3 = (sbyte)h;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)->field))->field_3 = (sbyte)l;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[1].field))->field_3 = (sbyte)h;
sbyte field_ = (sbyte)((uint)(l * 4 + h) / 5u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[2L].field_0))->field_3 = field_;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[2L].field))->field_3 = field_;
sbyte field_2 = (sbyte)((uint)(l * 3 + h * 2) / 5u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[3L].field_0))->field_3 = field_2;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[3L].field))->field_3 = field_2;
sbyte field_3 = (sbyte)((uint)(l * 2 + h * 3) / 5u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[4L].field_0))->field_3 = field_3;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[4L].field))->field_3 = field_3;
sbyte field_4 = (sbyte)((uint)(l + h * 4) / 5u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[5L].field_0))->field_3 = field_4;
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[6L].field_0))->field_3 = 0;
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[7L].field_0))->field_3 = -1;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[5L].field))->field_3 = field_4;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[6L].field))->field_3 = 0;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[7L].field))->field_3 = -1;
return 6;
}
}
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?get_block_values6@dxt5_block@crnd@@SAIPEAIII@Z")]
[DemangledName("public: static unsigned int __cdecl crnd::dxt5_block::get_block_values6(unsigned int *, unsigned int, unsigned int)")]
[CleanName("Get_block_values6")]
internal static partial class Get_block_values6_5klbycb
internal static partial class Get_block_values6_8iwdqp
{
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("unsigned int *")] void* pDst, [NativeType("unsigned int")] int l, [NativeType("unsigned int")] int h)
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?get_block_values8@dxt5_block@crnd@@SAIPEAIII@Z")]
[DemangledName("public: static unsigned int __cdecl crnd::dxt5_block::get_block_values8(unsigned int *, unsigned int, unsigned int)")]
[CleanName("Get_block_values8")]
internal static partial class Get_block_values8_ml7jl2d
internal static partial class Get_block_values8_9fbjk8
{
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("unsigned int *")] void* pDst, [NativeType("unsigned int")] int l, [NativeType("unsigned int")] int h)
@@ -6,27 +6,27 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?get_block_values8@dxt5_block@crnd@@SAIPEAV?$color_quad@EH@2@II@Z")]
[DemangledName("public: static unsigned int __cdecl crnd::dxt5_block::get_block_values8(class crnd::color_quad<unsigned char, int> *, unsigned int, unsigned int)")]
[CleanName("Get_block_values8")]
internal static partial class Get_block_values8_xv25ufa
internal static partial class Get_block_values8_ekrbu2
{
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("class crnd::color_quad<unsigned char, int> *")] void* pDst, [NativeType("unsigned int")] int l, [NativeType("unsigned int")] int h)
{
unchecked
{
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)->field_0))->field_3 = (sbyte)l;
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[1].field_0))->field_3 = (sbyte)h;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)->field))->field_3 = (sbyte)l;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[1].field))->field_3 = (sbyte)h;
sbyte field_ = (sbyte)((uint)(l * 6 + h) / 7u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[2L].field_0))->field_3 = field_;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[2L].field))->field_3 = field_;
sbyte field_2 = (sbyte)((uint)(l * 5 + h * 2) / 7u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[3L].field_0))->field_3 = field_2;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[3L].field))->field_3 = field_2;
sbyte field_3 = (sbyte)((uint)(l * 4 + h * 3) / 7u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[4L].field_0))->field_3 = field_3;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[4L].field))->field_3 = field_3;
sbyte field_4 = (sbyte)((uint)(l * 3 + h * 4) / 7u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[5L].field_0))->field_3 = field_4;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[5L].field))->field_3 = field_4;
sbyte field_5 = (sbyte)((uint)(l * 2 + h * 5) / 7u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[6L].field_0))->field_3 = field_5;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[6L].field))->field_3 = field_5;
sbyte field_6 = (sbyte)((uint)(l + h * 6) / 7u);
((anon_b9ijpuc*)(&((crnd_color_quad*)pDst)[7L].field_0))->field_3 = field_6;
((anon_m9uqrv*)(&((crnd_color_quad*)pDst)[7L].field))->field_3 = field_6;
return 8;
}
}
@@ -5,15 +5,15 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?get_block_values@dxt5_block@crnd@@SAIPEAV?$color_quad@EH@2@II@Z")]
[DemangledName("public: static unsigned int __cdecl crnd::dxt5_block::get_block_values(class crnd::color_quad<unsigned char, int> *, unsigned int, unsigned int)")]
[CleanName("Get_block_values")]
internal static partial class Get_block_values_pxz3b9a
internal static partial class Get_block_values_d4g83r
{
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("class crnd::color_quad<unsigned char, int> *")] void* pDst, [NativeType("unsigned int")] int l, [NativeType("unsigned int")] int h)
{
if (unchecked((uint)l > (uint)h))
{
return Get_block_values8_xv25ufa.Invoke(pDst, l, h);
return Get_block_values8_ekrbu2.Invoke(pDst, l, h);
}
return Get_block_values6_7gyjbyc.Invoke(pDst, l, h);
return Get_block_values6_36ycpg.Invoke(pDst, l, h);
}
}
@@ -5,15 +5,15 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?get_block_values@dxt5_block@crnd@@SAIPEAIII@Z")]
[DemangledName("public: static unsigned int __cdecl crnd::dxt5_block::get_block_values(unsigned int *, unsigned int, unsigned int)")]
[CleanName("Get_block_values")]
internal static partial class Get_block_values_2npk7qa
internal static partial class Get_block_values_u8zixf
{
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("unsigned int *")] void* pDst, [NativeType("unsigned int")] int l, [NativeType("unsigned int")] int h)
{
if (unchecked((uint)l > (uint)h))
{
return Get_block_values8_ml7jl2d.Invoke(pDst, l, h);
return Get_block_values8_9fbjk8.Invoke(pDst, l, h);
}
return Get_block_values6_5klbycb.Invoke(pDst, l, h);
return Get_block_values6_8iwdqp.Invoke(pDst, l, h);
}
}
@@ -10,6 +10,6 @@ internal static partial class Get_data
[return: NativeType("void const *")]
public unsafe static void* Invoke(void* @this)
{
return unchecked((crnd_crn_unpacker*)@this)->field_1;
return unchecked((crnd_crn_unpacker*)@this)->m_pData;
}
}
@@ -10,6 +10,6 @@ internal static partial class Get_data_size
[return: NativeType("unsigned int")]
public unsafe static int Invoke(void* @this)
{
return unchecked((crnd_crn_unpacker*)@this)->field_2;
return unchecked((crnd_crn_unpacker*)@this)->m_data_size;
}
}
@@ -15,9 +15,9 @@ internal static partial class Get_unshifted_max_code
{
if ((uint)len < 1u || (uint)len > 16u)
{
crnd_assert.Invoke(String_ajzw4md.__pointer, String_yguirrd.__pointer, 1960);
crnd_assert.Invoke(String_s4qupc.__pointer, String_vvx8bt.__pointer, 1960);
}
int num = ((int*)(&((crnd_prefix_coding_decoder_tables*)@this)->field_8))[(uint)(len - 1)];
int num = ((int*)(&((crnd_prefix_coding_decoder_tables*)@this)->m_max_codes))[(uint)(len - 1)];
if (num == 0)
{
return -1;
@@ -17,23 +17,23 @@ internal static partial class Set_alpha
{
if ((uint)x >= 4u || (uint)y >= 4u)
{
crnd_assert.Invoke(String_cahur4b.__pointer, String_yguirrd.__pointer, 3460);
crnd_assert.Invoke(String_jsxkht.__pointer, String_vvx8bt.__pointer, 3460);
}
if ((b & 1) == 1)
{
if ((uint)num > 255u)
{
crnd_assert.Invoke(String_932ftxa.__pointer, String_yguirrd.__pointer, 3464);
crnd_assert.Invoke(String_exh4qe.__pointer, String_vvx8bt.__pointer, 3464);
}
num = (int)((uint)(num * 15 + 128) / 255u);
}
else if ((uint)num > 15u)
{
crnd_assert.Invoke(String_azii4xc.__pointer, String_yguirrd.__pointer, 3469);
crnd_assert.Invoke(String_sg8vgw.__pointer, String_vvx8bt.__pointer, 3469);
}
int num2 = (y << 1) + (x >>> 1);
int num3 = (byte)((sbyte*)(&((crnd_dxt3_block*)@this)->field_0))[(uint)num2];
((sbyte*)(&((crnd_dxt3_block*)@this)->field_0))[(uint)num2] = (sbyte)((num3 & ((15 << ((x & 1) << 2)) ^ -1)) | (num << ((x & 1) << 2)));
int num3 = (byte)((sbyte*)(&((crnd_dxt3_block*)@this)->m_alpha))[(uint)num2];
((sbyte*)(&((crnd_dxt3_block*)@this)->m_alpha))[(uint)num2] = (sbyte)((num3 & ((15 << ((x & 1) << 2)) ^ -1)) | (num << ((x & 1) << 2)));
}
}
}
@@ -17,9 +17,9 @@ internal static partial class assign
}
unchecked
{
if (((crnd_vector_f3cmzmc*)@this)->field_2 == ((crnd_vector_f3cmzmc*)other)->field_1)
if (((crnd_vector_uksit8*)@this)->m_capacity == ((crnd_vector_uksit8*)other)->m_size)
{
resize_rzzl5xd.Invoke(@this, 0);
resize_zpvfc7.Invoke(@this, 0);
if (ExceptionInfo.Current != null)
{
return false;
@@ -27,12 +27,12 @@ internal static partial class assign
}
else
{
clear_q4odfmb.Invoke(@this);
clear_mzsqxg.Invoke(@this);
if (ExceptionInfo.Current != null)
{
return false;
}
bool flag = increase_capacity_a7boycc.Invoke(@this, ((crnd_vector_f3cmzmc*)other)->field_1, grow_hint: false);
bool flag = increase_capacity_2iysmi.Invoke(@this, ((crnd_vector_uksit8*)other)->m_size, grow_hint: false);
if (ExceptionInfo.Current != null)
{
return false;
@@ -42,8 +42,8 @@ internal static partial class assign
return false;
}
}
llvm_memcpy_p0_p0_i64.Invoke(((crnd_vector_f3cmzmc*)@this)->field_0, ((crnd_vector_f3cmzmc*)other)->field_0, (long)(uint)((crnd_vector_f3cmzmc*)other)->field_1 * 1L, isVolatile: false);
((crnd_vector_f3cmzmc*)@this)->field_1 = ((crnd_vector_f3cmzmc*)other)->field_1;
llvm_memcpy_p0_p0_i64.Invoke(((crnd_vector_uksit8*)@this)->m_p, ((crnd_vector_uksit8*)other)->m_p, (long)(uint)((crnd_vector_uksit8*)other)->m_size * 1L, isVolatile: false);
((crnd_vector_uksit8*)@this)->m_size = ((crnd_vector_uksit8*)other)->m_size;
return true;
}
}
@@ -6,26 +6,26 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?clear@?$vector@I@crnd@@QEAAXXZ")]
[DemangledName("public: void __cdecl crnd::vector<unsigned int>::clear(void)")]
[CleanName("clear")]
internal static partial class clear_utei2oa
internal static partial class clear_2hj7fd
{
[return: NativeType("void")]
public unsafe static void Invoke(void* @this)
{
unchecked
{
if (((crnd_vector_maaktjc*)@this)->field_0 != null)
if (((crnd_vector_rgfndh*)@this)->m_p != null)
{
destruct_array_rsqiwgc.Invoke(n: ((crnd_vector_maaktjc*)@this)->field_1, p: ((crnd_vector_maaktjc*)@this)->field_0);
crnd_free.Invoke(((crnd_vector_maaktjc*)@this)->field_0);
destruct_array_h4d2m4.Invoke(n: ((crnd_vector_rgfndh*)@this)->m_size, p: ((crnd_vector_rgfndh*)@this)->m_p);
crnd_free.Invoke(((crnd_vector_rgfndh*)@this)->m_p);
if (ExceptionInfo.Current != null)
{
return;
}
((crnd_vector_maaktjc*)@this)->field_0 = null;
((crnd_vector_maaktjc*)@this)->field_1 = 0;
((crnd_vector_maaktjc*)@this)->field_2 = 0;
((crnd_vector_rgfndh*)@this)->m_p = null;
((crnd_vector_rgfndh*)@this)->m_size = 0;
((crnd_vector_rgfndh*)@this)->m_capacity = 0;
}
((crnd_vector_maaktjc*)@this)->field_3 = 0;
((crnd_vector_rgfndh*)@this)->m_alloc_failed = 0;
}
}
}
@@ -6,21 +6,21 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?clear@static_huffman_data_model@crnd@@QEAAXXZ")]
[DemangledName("public: void __cdecl crnd::static_huffman_data_model::clear(void)")]
[CleanName("clear")]
internal static partial class clear_egw7ktb
internal static partial class clear_9udjtr
{
[return: NativeType("void")]
public unsafe static void Invoke(void* @this)
{
unchecked
{
((crnd_static_huffman_data_model*)@this)->field_0 = 0;
clear_q4odfmb.Invoke(&((crnd_static_huffman_data_model*)@this)->field_1);
if (ExceptionInfo.Current == null && ((crnd_static_huffman_data_model*)@this)->field_2 != null)
((crnd_static_huffman_data_model*)@this)->m_total_syms = 0;
clear_mzsqxg.Invoke(&((crnd_static_huffman_data_model*)@this)->m_code_sizes);
if (ExceptionInfo.Current == null && ((crnd_static_huffman_data_model*)@this)->m_pDecode_tables != null)
{
crnd_delete_rldcmnc.Invoke(((crnd_static_huffman_data_model*)@this)->field_2);
crnd_delete_bvucig.Invoke(((crnd_static_huffman_data_model*)@this)->m_pDecode_tables);
if (ExceptionInfo.Current == null)
{
((crnd_static_huffman_data_model*)@this)->field_2 = null;
((crnd_static_huffman_data_model*)@this)->m_pDecode_tables = null;
}
}
}
@@ -1,37 +0,0 @@
using AssetRipper.Conversions.Crunch.Helpers;
using AssetRipper.Conversions.Crunch.Structures;
namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?clear@decoder_tables@prefix_coding@crnd@@QEAAXXZ")]
[DemangledName("public: void __cdecl crnd::prefix_coding::decoder_tables::clear(void)")]
[CleanName("clear")]
internal static partial class clear_ie5thac
{
[return: NativeType("void")]
public unsafe static void Invoke(void* @this)
{
unchecked
{
if (((crnd_prefix_coding_decoder_tables*)@this)->field_11 != null)
{
crnd_delete_array_nughn5d.Invoke(((crnd_prefix_coding_decoder_tables*)@this)->field_11);
if (ExceptionInfo.Current != null)
{
return;
}
((crnd_prefix_coding_decoder_tables*)@this)->field_11 = null;
((crnd_prefix_coding_decoder_tables*)@this)->field_10 = 0;
}
if (((crnd_prefix_coding_decoder_tables*)@this)->field_13 != null)
{
crnd_delete_array_rytswyc.Invoke(((crnd_prefix_coding_decoder_tables*)@this)->field_13);
if (ExceptionInfo.Current == null)
{
((crnd_prefix_coding_decoder_tables*)@this)->field_13 = null;
((crnd_prefix_coding_decoder_tables*)@this)->field_12 = 0;
}
}
}
}
}
@@ -6,26 +6,26 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?clear@?$vector@G@crnd@@QEAAXXZ")]
[DemangledName("public: void __cdecl crnd::vector<unsigned short>::clear(void)")]
[CleanName("clear")]
internal static partial class clear_bqconyd
internal static partial class clear_isy3cf
{
[return: NativeType("void")]
public unsafe static void Invoke(void* @this)
{
unchecked
{
if (((crnd_vector_rf9iywd*)@this)->field_0 != null)
if (((crnd_vector_h6df48*)@this)->m_p != null)
{
destruct_array_l9jmj2b.Invoke(n: ((crnd_vector_rf9iywd*)@this)->field_1, p: ((crnd_vector_rf9iywd*)@this)->field_0);
crnd_free.Invoke(((crnd_vector_rf9iywd*)@this)->field_0);
destruct_array_93njbe.Invoke(n: ((crnd_vector_h6df48*)@this)->m_size, p: ((crnd_vector_h6df48*)@this)->m_p);
crnd_free.Invoke(((crnd_vector_h6df48*)@this)->m_p);
if (ExceptionInfo.Current != null)
{
return;
}
((crnd_vector_rf9iywd*)@this)->field_0 = null;
((crnd_vector_rf9iywd*)@this)->field_1 = 0;
((crnd_vector_rf9iywd*)@this)->field_2 = 0;
((crnd_vector_h6df48*)@this)->m_p = null;
((crnd_vector_h6df48*)@this)->m_size = 0;
((crnd_vector_h6df48*)@this)->m_capacity = 0;
}
((crnd_vector_rf9iywd*)@this)->field_3 = 0;
((crnd_vector_h6df48*)@this)->m_alloc_failed = 0;
}
}
}
@@ -6,26 +6,26 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?clear@?$vector@E@crnd@@QEAAXXZ")]
[DemangledName("public: void __cdecl crnd::vector<unsigned char>::clear(void)")]
[CleanName("clear")]
internal static partial class clear_q4odfmb
internal static partial class clear_mzsqxg
{
[return: NativeType("void")]
public unsafe static void Invoke(void* @this)
{
unchecked
{
if (((crnd_vector_f3cmzmc*)@this)->field_0 != null)
if (((crnd_vector_uksit8*)@this)->m_p != null)
{
destruct_array_dhbxund.Invoke(n: ((crnd_vector_f3cmzmc*)@this)->field_1, p: ((crnd_vector_f3cmzmc*)@this)->field_0);
crnd_free.Invoke(((crnd_vector_f3cmzmc*)@this)->field_0);
destruct_array_s3iq3j.Invoke(n: ((crnd_vector_uksit8*)@this)->m_size, p: ((crnd_vector_uksit8*)@this)->m_p);
crnd_free.Invoke(((crnd_vector_uksit8*)@this)->m_p);
if (ExceptionInfo.Current != null)
{
return;
}
((crnd_vector_f3cmzmc*)@this)->field_0 = null;
((crnd_vector_f3cmzmc*)@this)->field_1 = 0;
((crnd_vector_f3cmzmc*)@this)->field_2 = 0;
((crnd_vector_uksit8*)@this)->m_p = null;
((crnd_vector_uksit8*)@this)->m_size = 0;
((crnd_vector_uksit8*)@this)->m_capacity = 0;
}
((crnd_vector_f3cmzmc*)@this)->field_3 = 0;
((crnd_vector_uksit8*)@this)->m_alloc_failed = 0;
}
}
}
@@ -0,0 +1,37 @@
using AssetRipper.Conversions.Crunch.Helpers;
using AssetRipper.Conversions.Crunch.Structures;
namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?clear@decoder_tables@prefix_coding@crnd@@QEAAXXZ")]
[DemangledName("public: void __cdecl crnd::prefix_coding::decoder_tables::clear(void)")]
[CleanName("clear")]
internal static partial class clear_v2azth
{
[return: NativeType("void")]
public unsafe static void Invoke(void* @this)
{
unchecked
{
if (((crnd_prefix_coding_decoder_tables*)@this)->m_lookup != null)
{
crnd_delete_array_wgct9q.Invoke(((crnd_prefix_coding_decoder_tables*)@this)->m_lookup);
if (ExceptionInfo.Current != null)
{
return;
}
((crnd_prefix_coding_decoder_tables*)@this)->m_lookup = null;
((crnd_prefix_coding_decoder_tables*)@this)->m_cur_lookup_size = 0;
}
if (((crnd_prefix_coding_decoder_tables*)@this)->m_sorted_symbol_order != null)
{
crnd_delete_array_yym6az.Invoke(((crnd_prefix_coding_decoder_tables*)@this)->m_sorted_symbol_order);
if (ExceptionInfo.Current == null)
{
((crnd_prefix_coding_decoder_tables*)@this)->m_sorted_symbol_order = null;
((crnd_prefix_coding_decoder_tables*)@this)->m_cur_sorted_symbol_order_size = 0;
}
}
}
}
}
@@ -12,14 +12,14 @@ internal static partial class color_quad_unsigned_char_int_Assignment
{
unchecked
{
sbyte field_ = ((anon_b9ijpuc*)(&((crnd_color_quad*)other)->field_0))->field_0;
((anon_b9ijpuc*)(&((crnd_color_quad*)@this)->field_0))->field_0 = field_;
sbyte field_2 = ((anon_b9ijpuc*)(&((crnd_color_quad*)other)->field_0))->field_1;
((anon_b9ijpuc*)(&((crnd_color_quad*)@this)->field_0))->field_1 = field_2;
sbyte field_3 = ((anon_b9ijpuc*)(&((crnd_color_quad*)other)->field_0))->field_2;
((anon_b9ijpuc*)(&((crnd_color_quad*)@this)->field_0))->field_2 = field_3;
sbyte field_4 = ((anon_b9ijpuc*)(&((crnd_color_quad*)other)->field_0))->field_3;
((anon_b9ijpuc*)(&((crnd_color_quad*)@this)->field_0))->field_3 = field_4;
sbyte field_ = ((anon_m9uqrv*)(&((crnd_color_quad*)other)->field))->field_0;
((anon_m9uqrv*)(&((crnd_color_quad*)@this)->field))->field_0 = field_;
sbyte field_2 = ((anon_m9uqrv*)(&((crnd_color_quad*)other)->field))->field_1;
((anon_m9uqrv*)(&((crnd_color_quad*)@this)->field))->field_1 = field_2;
sbyte field_3 = ((anon_m9uqrv*)(&((crnd_color_quad*)other)->field))->field_2;
((anon_m9uqrv*)(&((crnd_color_quad*)@this)->field))->field_2 = field_3;
sbyte field_4 = ((anon_m9uqrv*)(&((crnd_color_quad*)other)->field))->field_3;
((anon_m9uqrv*)(&((crnd_color_quad*)@this)->field))->field_3 = field_4;
return @this;
}
}
@@ -13,9 +13,9 @@ internal static partial class compute_decoder_table_bits
int result = 0;
unchecked
{
if ((uint)((crnd_static_huffman_data_model*)@this)->field_0 > 16u)
if ((uint)((crnd_static_huffman_data_model*)@this)->m_total_syms > 16u)
{
result = (byte)(sbyte)minimum.Invoke(1 + ceil_log2i.Invoke(((crnd_static_huffman_data_model*)@this)->field_0), 11);
result = (byte)(sbyte)minimum.Invoke(1 + ceil_log2i.Invoke(((crnd_static_huffman_data_model*)@this)->m_total_syms), 11);
}
return result;
}
@@ -6,7 +6,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?construct_array@?$scalar_type@G@crnd@@SAXPEAGI@Z")]
[DemangledName("public: static void __cdecl crnd::scalar_type<unsigned short>::construct_array(unsigned short *, unsigned int)")]
[CleanName("construct_array")]
internal static partial class construct_array_gqnztta
internal static partial class construct_array_2cauua
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("unsigned short *")] void* p, [NativeType("unsigned int")] int n)
@@ -6,7 +6,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?construct_array@?$scalar_type@I@crnd@@SAXPEAII@Z")]
[DemangledName("public: static void __cdecl crnd::scalar_type<unsigned int>::construct_array(unsigned int *, unsigned int)")]
[CleanName("construct_array")]
internal static partial class construct_array_45u5mpd
internal static partial class construct_array_5nd2vv
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("unsigned int *")] void* p, [NativeType("unsigned int")] int n)
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$construct_array@I@helpers@crnd@@YAXPEAII@Z")]
[DemangledName("void __cdecl crnd::helpers::construct_array<unsigned int>(unsigned int *, unsigned int)")]
[CleanName("construct_array")]
internal static partial class construct_array_rijpqya
internal static partial class construct_array_7hpyj8
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("unsigned int *")] void* p, [NativeType("unsigned int")] int n)
@@ -6,7 +6,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?construct_array@?$scalar_type@E@crnd@@SAXPEAEI@Z")]
[DemangledName("public: static void __cdecl crnd::scalar_type<unsigned char>::construct_array(unsigned char *, unsigned int)")]
[CleanName("construct_array")]
internal static partial class construct_array_oifcoec
internal static partial class construct_array_mseefg
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("unsigned char *")] void* p, [NativeType("unsigned int")] int n)
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$construct_array@G@helpers@crnd@@YAXPEAGI@Z")]
[DemangledName("void __cdecl crnd::helpers::construct_array<unsigned short>(unsigned short *, unsigned int)")]
[CleanName("construct_array")]
internal static partial class construct_array_pri7s5c
internal static partial class construct_array_smzb78
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("unsigned short *")] void* p, [NativeType("unsigned int")] int n)
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$construct@Vcrn_unpacker@crnd@@@helpers@crnd@@YAPEAVcrn_unpacker@1@PEAV21@@Z")]
[DemangledName("class crnd::crn_unpacker * __cdecl crnd::helpers::construct<class crnd::crn_unpacker>(class crnd::crn_unpacker *)")]
[CleanName("construct")]
internal static partial class construct_bzfae7a
internal static partial class construct_fgrjha
{
[return: NativeType("class crnd::crn_unpacker *")]
public unsafe static void* Invoke([NativeType("class crnd::crn_unpacker *")] void* p)
@@ -5,12 +5,12 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$construct@Vdecoder_tables@prefix_coding@crnd@@@helpers@crnd@@YAPEAVdecoder_tables@prefix_coding@1@PEAV231@@Z")]
[DemangledName("class crnd::prefix_coding::decoder_tables * __cdecl crnd::helpers::construct<class crnd::prefix_coding::decoder_tables>(class crnd::prefix_coding::decoder_tables *)")]
[CleanName("construct")]
internal static partial class construct_e5fhx3a
internal static partial class construct_uri2px
{
[return: NativeType("class crnd::prefix_coding::decoder_tables *")]
public unsafe static void* Invoke([NativeType("class crnd::prefix_coding::decoder_tables *")] void* p)
{
decoder_tables_Constructor_2o5uqyd.Invoke(p);
decoder_tables_Constructor_zsf5x5.Invoke(p);
return p;
}
}
@@ -5,12 +5,12 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$construct@Vdecoder_tables@prefix_coding@crnd@@V123@@helpers@crnd@@YAPEAVdecoder_tables@prefix_coding@1@PEAV231@AEBV231@@Z")]
[DemangledName("class crnd::prefix_coding::decoder_tables * __cdecl crnd::helpers::construct<class crnd::prefix_coding::decoder_tables, class crnd::prefix_coding::decoder_tables>(class crnd::prefix_coding::decoder_tables *, class crnd::prefix_coding::decoder_tables const &)")]
[CleanName("construct")]
internal static partial class construct_zybj4yc
internal static partial class construct_va3fwv
{
[return: NativeType("class crnd::prefix_coding::decoder_tables *")]
public unsafe static void* Invoke([NativeType("class crnd::prefix_coding::decoder_tables *")] void* p, [NativeType("class crnd::prefix_coding::decoder_tables const &")] void* init)
{
decoder_tables_Constructor_3v4xfjd.Invoke(p, init);
decoder_tables_Constructor_jcwqfb.Invoke(p, init);
if (ExceptionInfo.Current != null)
{
return null;
@@ -11,34 +11,34 @@ internal static partial class crn_header_Constructor
{
unchecked
{
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_0);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_1);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_2);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->field_3);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_4);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_5);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_6);
crn_packed_uint_1_Constructor.Invoke(&((crnd_crn_header*)@this)->field_7);
crn_packed_uint_1_Constructor.Invoke(&((crnd_crn_header*)@this)->field_8);
crn_packed_uint_1_Constructor.Invoke(&((crnd_crn_header*)@this)->field_9);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_10);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->field_11);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->field_12);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->field_13);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->field_14);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->field_15);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->field_16);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->field_17);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->field_18);
crn_packed_uint_3_Constructor.Invoke(&((crnd_crn_header*)@this)->field_19);
crnd_crn_packed_uint_jymcebc* field_ = (crnd_crn_packed_uint_jymcebc*)(&((crnd_crn_header*)@this)->field_20);
crnd_crn_packed_uint_jymcebc* ptr = field_ + 1;
crnd_crn_packed_uint_jymcebc* intPtr = field_;
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_sig);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_header_size);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_header_crc16);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->m_data_size);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_data_crc16);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_width);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_height);
crn_packed_uint_1_Constructor.Invoke(&((crnd_crn_header*)@this)->m_levels);
crn_packed_uint_1_Constructor.Invoke(&((crnd_crn_header*)@this)->m_faces);
crn_packed_uint_1_Constructor.Invoke(&((crnd_crn_header*)@this)->m_format);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_flags);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->m_reserved);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->m_userdata0);
crn_packed_uint_4_Constructor.Invoke(&((crnd_crn_header*)@this)->m_userdata1);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->m_color_endpoints);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->m_color_selectors);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->m_alpha_endpoints);
crn_palette_Constructor.Invoke(&((crnd_crn_header*)@this)->m_alpha_selectors);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_header*)@this)->m_tables_size);
crn_packed_uint_3_Constructor.Invoke(&((crnd_crn_header*)@this)->m_tables_ofs);
crnd_crn_packed_uint_25ciii* level_ofs = (crnd_crn_packed_uint_25ciii*)(&((crnd_crn_header*)@this)->m_level_ofs);
crnd_crn_packed_uint_25ciii* ptr = level_ofs + 1;
crnd_crn_packed_uint_25ciii* intPtr = level_ofs;
while (true)
{
void* ptr2 = intPtr;
crn_packed_uint_4_Constructor.Invoke(ptr2);
crnd_crn_packed_uint_jymcebc* ptr3 = (crnd_crn_packed_uint_jymcebc*)ptr2 + 1;
crnd_crn_packed_uint_25ciii* ptr3 = (crnd_crn_packed_uint_25ciii*)ptr2 + 1;
if (ptr3 == ptr)
{
break;
@@ -10,6 +10,6 @@ internal static partial class crn_packed_uint_1_ToUInt32
[return: NativeType("unsigned int")]
public unsafe static int Invoke(void* @this)
{
return unchecked((byte)(*(sbyte*)(&((crnd_crn_packed_uint_94amu2d*)@this)->field_0)));
return unchecked((byte)(*(sbyte*)(&((crnd_crn_packed_uint_wqy4pm*)@this)->m_buf)));
}
}
@@ -16,7 +16,7 @@ internal static partial class crn_packed_uint_2_Assignment
{
for (int i = 0; (uint)i < 2u; i++)
{
((sbyte*)(&((crnd_crn_packed_uint_hnsywfd*)@this)->field_0))[(uint)i] = (sbyte)(num >>> 24);
((sbyte*)(&((crnd_crn_packed_uint_y3p293*)@this)->m_buf))[(uint)i] = (sbyte)(num >>> 24);
num <<= 8;
}
return @this;
@@ -10,6 +10,6 @@ internal static partial class crn_packed_uint_2_ToUInt32
[return: NativeType("unsigned int")]
public unsafe static int Invoke(void* @this)
{
return unchecked(((byte)(*(sbyte*)(&((crnd_crn_packed_uint_hnsywfd*)@this)->field_0)) << 8) | (byte)((sbyte*)(&((crnd_crn_packed_uint_hnsywfd*)@this)->field_0))[1]);
return unchecked(((byte)(*(sbyte*)(&((crnd_crn_packed_uint_y3p293*)@this)->m_buf)) << 8) | (byte)((sbyte*)(&((crnd_crn_packed_uint_y3p293*)@this)->m_buf))[1]);
}
}
@@ -10,6 +10,6 @@ internal static partial class crn_packed_uint_3_ToUInt32
[return: NativeType("unsigned int")]
public unsafe static int Invoke(void* @this)
{
return unchecked(((byte)(*(sbyte*)(&((crnd_crn_packed_uint_fru7ewb*)@this)->field_0)) << 16) | ((byte)((sbyte*)(&((crnd_crn_packed_uint_fru7ewb*)@this)->field_0))[1] << 8) | (byte)((sbyte*)(&((crnd_crn_packed_uint_fru7ewb*)@this)->field_0))[2]);
return unchecked(((byte)(*(sbyte*)(&((crnd_crn_packed_uint_7g8wrq*)@this)->m_buf)) << 16) | ((byte)((sbyte*)(&((crnd_crn_packed_uint_7g8wrq*)@this)->m_buf))[1] << 8) | (byte)((sbyte*)(&((crnd_crn_packed_uint_7g8wrq*)@this)->m_buf))[2]);
}
}
@@ -16,7 +16,7 @@ internal static partial class crn_packed_uint_4_Assignment
{
for (int i = 0; (uint)i < 4u; i++)
{
((sbyte*)(&((crnd_crn_packed_uint_jymcebc*)@this)->field_0))[(uint)i] = (sbyte)(num >>> 24);
((sbyte*)(&((crnd_crn_packed_uint_25ciii*)@this)->m_buf))[(uint)i] = (sbyte)(num >>> 24);
num <<= 8;
}
return @this;
@@ -10,6 +10,6 @@ internal static partial class crn_packed_uint_4_ToUInt32
[return: NativeType("unsigned int")]
public unsafe static int Invoke(void* @this)
{
return unchecked(((byte)(*(sbyte*)(&((crnd_crn_packed_uint_jymcebc*)@this)->field_0)) << 24) | ((byte)((sbyte*)(&((crnd_crn_packed_uint_jymcebc*)@this)->field_0))[1] << 16) | ((byte)((sbyte*)(&((crnd_crn_packed_uint_jymcebc*)@this)->field_0))[2] << 8) | (byte)((sbyte*)(&((crnd_crn_packed_uint_jymcebc*)@this)->field_0))[3]);
return unchecked(((byte)(*(sbyte*)(&((crnd_crn_packed_uint_25ciii*)@this)->m_buf)) << 24) | ((byte)((sbyte*)(&((crnd_crn_packed_uint_25ciii*)@this)->m_buf))[1] << 16) | ((byte)((sbyte*)(&((crnd_crn_packed_uint_25ciii*)@this)->m_buf))[2] << 8) | (byte)((sbyte*)(&((crnd_crn_packed_uint_25ciii*)@this)->m_buf))[3]);
}
}
@@ -11,9 +11,9 @@ internal static partial class crn_palette_Constructor
{
unchecked
{
crn_packed_uint_3_Constructor.Invoke(&((crnd_crn_palette*)@this)->field_0);
crn_packed_uint_3_Constructor.Invoke(&((crnd_crn_palette*)@this)->field_1);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_palette*)@this)->field_2);
crn_packed_uint_3_Constructor.Invoke(&((crnd_crn_palette*)@this)->m_ofs);
crn_packed_uint_3_Constructor.Invoke(&((crnd_crn_palette*)@this)->m_size);
crn_packed_uint_2_Constructor.Invoke(&((crnd_crn_palette*)@this)->m_num);
return @this;
}
}
@@ -12,22 +12,22 @@ internal static partial class crn_unpacker_Constructor
{
unchecked
{
((crnd_crn_unpacker*)@this)->field_0 = 519686845;
((crnd_crn_unpacker*)@this)->field_1 = null;
((crnd_crn_unpacker*)@this)->field_2 = 0;
crn_header_Constructor.Invoke(&((crnd_crn_unpacker*)@this)->field_3);
((crnd_crn_unpacker*)@this)->field_4 = null;
symbol_codec_Constructor.Invoke(&((crnd_crn_unpacker*)@this)->field_5);
crnd_static_huffman_data_model* field_ = &((crnd_crn_unpacker*)@this)->field_6;
static_huffman_data_model_Constructor_tl33idc.Invoke(field_);
InlineArray2_crnd_static_huffman_data_model* field_2 = &((crnd_crn_unpacker*)@this)->field_7;
crnd_static_huffman_data_model* ptr = (crnd_static_huffman_data_model*)field_2;
((crnd_crn_unpacker*)@this)->m_magic = 519686845;
((crnd_crn_unpacker*)@this)->m_pData = null;
((crnd_crn_unpacker*)@this)->m_data_size = 0;
crn_header_Constructor.Invoke(&((crnd_crn_unpacker*)@this)->m_tmp_header);
((crnd_crn_unpacker*)@this)->m_pHeader = null;
symbol_codec_Constructor.Invoke(&((crnd_crn_unpacker*)@this)->m_codec);
crnd_static_huffman_data_model* chunk_encoding_dm = &((crnd_crn_unpacker*)@this)->m_chunk_encoding_dm;
static_huffman_data_model_Constructor_c98ih8.Invoke(chunk_encoding_dm);
InlineArray2_crnd_static_huffman_data_model* endpoint_delta_dm = &((crnd_crn_unpacker*)@this)->m_endpoint_delta_dm;
crnd_static_huffman_data_model* ptr = (crnd_static_huffman_data_model*)endpoint_delta_dm;
crnd_static_huffman_data_model* ptr2 = ptr + 2L;
crnd_static_huffman_data_model* intPtr = ptr;
while (true)
{
void* ptr3 = intPtr;
static_huffman_data_model_Constructor_tl33idc.Invoke(ptr3);
static_huffman_data_model_Constructor_c98ih8.Invoke(ptr3);
if (ExceptionInfo.Current == null)
{
crnd_static_huffman_data_model* ptr4 = (crnd_static_huffman_data_model*)ptr3 + 1;
@@ -36,14 +36,14 @@ internal static partial class crn_unpacker_Constructor
intPtr = ptr4;
continue;
}
InlineArray2_crnd_static_huffman_data_model* field_3 = &((crnd_crn_unpacker*)@this)->field_8;
crnd_static_huffman_data_model* ptr5 = (crnd_static_huffman_data_model*)field_3;
InlineArray2_crnd_static_huffman_data_model* selector_delta_dm = &((crnd_crn_unpacker*)@this)->m_selector_delta_dm;
crnd_static_huffman_data_model* ptr5 = (crnd_static_huffman_data_model*)selector_delta_dm;
crnd_static_huffman_data_model* ptr6 = ptr5 + 2L;
crnd_static_huffman_data_model* intPtr2 = ptr5;
while (true)
{
void* ptr7 = intPtr2;
static_huffman_data_model_Constructor_tl33idc.Invoke(ptr7);
static_huffman_data_model_Constructor_c98ih8.Invoke(ptr7);
if (ExceptionInfo.Current == null)
{
crnd_static_huffman_data_model* ptr8 = (crnd_static_huffman_data_model*)ptr7 + 1;
@@ -52,26 +52,26 @@ internal static partial class crn_unpacker_Constructor
intPtr2 = ptr8;
continue;
}
crnd_vector_maaktjc* field_4 = &((crnd_crn_unpacker*)@this)->field_9;
vector_unsigned_int_Constructor.Invoke(field_4);
crnd_vector_rgfndh* color_endpoints = &((crnd_crn_unpacker*)@this)->m_color_endpoints;
vector_unsigned_int_Constructor.Invoke(color_endpoints);
if (ExceptionInfo.Current == null)
{
crnd_vector_maaktjc* field_5 = &((crnd_crn_unpacker*)@this)->field_10;
vector_unsigned_int_Constructor.Invoke(field_5);
crnd_vector_rgfndh* color_selectors = &((crnd_crn_unpacker*)@this)->m_color_selectors;
vector_unsigned_int_Constructor.Invoke(color_selectors);
if (ExceptionInfo.Current == null)
{
crnd_vector_rf9iywd* field_6 = &((crnd_crn_unpacker*)@this)->field_11;
vector_unsigned_short_Constructor.Invoke(field_6);
crnd_vector_h6df48* alpha_endpoints = &((crnd_crn_unpacker*)@this)->m_alpha_endpoints;
vector_unsigned_short_Constructor.Invoke(alpha_endpoints);
if (ExceptionInfo.Current == null)
{
vector_unsigned_short_Constructor.Invoke(&((crnd_crn_unpacker*)@this)->field_12);
vector_unsigned_short_Constructor.Invoke(&((crnd_crn_unpacker*)@this)->m_alpha_selectors);
if (ExceptionInfo.Current == null)
{
return @this;
}
ExceptionInfo current = ExceptionInfo.Current;
ExceptionInfo.Current = null;
vector_unsigned_short_Destructor.Invoke(field_6);
vector_unsigned_short_Destructor.Invoke(alpha_endpoints);
if (ExceptionInfo.Current != null)
{
return null;
@@ -80,7 +80,7 @@ internal static partial class crn_unpacker_Constructor
}
ExceptionInfo current2 = ExceptionInfo.Current;
ExceptionInfo.Current = null;
vector_unsigned_int_Destructor.Invoke(field_5);
vector_unsigned_int_Destructor.Invoke(color_selectors);
if (ExceptionInfo.Current != null)
{
return null;
@@ -89,7 +89,7 @@ internal static partial class crn_unpacker_Constructor
}
ExceptionInfo current3 = ExceptionInfo.Current;
ExceptionInfo.Current = null;
vector_unsigned_int_Destructor.Invoke(field_4);
vector_unsigned_int_Destructor.Invoke(color_endpoints);
if (ExceptionInfo.Current != null)
{
return null;
@@ -98,7 +98,7 @@ internal static partial class crn_unpacker_Constructor
}
ExceptionInfo current4 = ExceptionInfo.Current;
ExceptionInfo.Current = null;
crnd_static_huffman_data_model* ptr9 = (crnd_static_huffman_data_model*)field_3;
crnd_static_huffman_data_model* ptr9 = (crnd_static_huffman_data_model*)selector_delta_dm;
nint num = (nint)(ptr9 + 2L);
while (true)
{
@@ -142,7 +142,7 @@ internal static partial class crn_unpacker_Constructor
}
ExceptionInfo current6 = ExceptionInfo.Current;
ExceptionInfo.Current = null;
crnd_static_huffman_data_model* ptr12 = (crnd_static_huffman_data_model*)field_2;
crnd_static_huffman_data_model* ptr12 = (crnd_static_huffman_data_model*)endpoint_delta_dm;
nint num3 = (nint)(ptr12 + 2L);
while (true)
{
@@ -186,7 +186,7 @@ internal static partial class crn_unpacker_Constructor
}
ExceptionInfo current8 = ExceptionInfo.Current;
ExceptionInfo.Current = null;
static_huffman_data_model_Destructor.Invoke(field_);
static_huffman_data_model_Destructor.Invoke(chunk_encoding_dm);
if (ExceptionInfo.Current != null)
{
return null;
@@ -11,29 +11,29 @@ internal static partial class crn_unpacker_Destructor
{
unchecked
{
((crnd_crn_unpacker*)@this)->field_0 = 0;
vector_unsigned_short_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->field_12);
((crnd_crn_unpacker*)@this)->m_magic = 0;
vector_unsigned_short_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->m_alpha_selectors);
if (ExceptionInfo.Current != null)
{
return;
}
vector_unsigned_short_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->field_11);
vector_unsigned_short_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->m_alpha_endpoints);
if (ExceptionInfo.Current != null)
{
return;
}
vector_unsigned_int_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->field_10);
vector_unsigned_int_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->m_color_selectors);
if (ExceptionInfo.Current != null)
{
return;
}
vector_unsigned_int_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->field_9);
vector_unsigned_int_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->m_color_endpoints);
if (ExceptionInfo.Current != null)
{
return;
}
crnd_static_huffman_data_model* field_ = (crnd_static_huffman_data_model*)(&((crnd_crn_unpacker*)@this)->field_8);
nint num = (nint)(field_ + 2L);
crnd_static_huffman_data_model* selector_delta_dm = (crnd_static_huffman_data_model*)(&((crnd_crn_unpacker*)@this)->m_selector_delta_dm);
nint num = (nint)(selector_delta_dm + 2L);
while (true)
{
crnd_static_huffman_data_model* ptr = (crnd_static_huffman_data_model*)(num + (nint)(-1) * sizeof(crnd_static_huffman_data_model));
@@ -42,14 +42,14 @@ internal static partial class crn_unpacker_Destructor
{
return;
}
if (ptr == field_)
if (ptr == selector_delta_dm)
{
break;
}
num = (nint)ptr;
}
crnd_static_huffman_data_model* field_2 = (crnd_static_huffman_data_model*)(&((crnd_crn_unpacker*)@this)->field_7);
nint num2 = (nint)(field_2 + 2L);
crnd_static_huffman_data_model* endpoint_delta_dm = (crnd_static_huffman_data_model*)(&((crnd_crn_unpacker*)@this)->m_endpoint_delta_dm);
nint num2 = (nint)(endpoint_delta_dm + 2L);
while (true)
{
crnd_static_huffman_data_model* ptr2 = (crnd_static_huffman_data_model*)(num2 + (nint)(-1) * sizeof(crnd_static_huffman_data_model));
@@ -58,13 +58,13 @@ internal static partial class crn_unpacker_Destructor
{
return;
}
if (ptr2 == field_2)
if (ptr2 == endpoint_delta_dm)
{
break;
}
num2 = (nint)ptr2;
}
static_huffman_data_model_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->field_6);
static_huffman_data_model_Destructor.Invoke(&((crnd_crn_unpacker*)@this)->m_chunk_encoding_dm);
}
}
}
@@ -14,7 +14,7 @@ internal static partial class crnd_assert
public unsafe static void Invoke([NativeType("char const *")] void* pExp, [NativeType("char const *")] void* pFile, [NativeType("unsigned int")] int line)
{
InlineArray512_SByte inlineArray512_SByte = default(InlineArray512_SByte);
sprintf.Invoke(&inlineArray512_SByte, String_tghxvvc.__pointer, default(ReadOnlySpan<nint>));
sprintf.Invoke(&inlineArray512_SByte, String_bkvqbi.__pointer, default(ReadOnlySpan<nint>));
crnd_output_debug_string.Invoke(&inlineArray512_SByte);
puts.Invoke(&inlineArray512_SByte);
if (crnd_is_debugger_present.Invoke())
@@ -12,20 +12,20 @@ internal static partial class crnd_create_segmented_file
[return: NativeType("bool")]
public unsafe static bool Invoke([NativeType("void const *")] void* pData, [NativeType("unsigned int")] int data_size, [NativeType("void *")] void* pBase_data, [NativeType("unsigned int")] int base_data_size)
{
crnd_crn_header crnd_crn_header = default(crnd_crn_header);
crnd_crn_header crnd_crn_header2 = default(crnd_crn_header);
unchecked
{
if (pData == null || (uint)data_size < 62u)
{
return false;
}
crn_header_Constructor.Invoke(&crnd_crn_header);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header, pData, data_size);
crn_header_Constructor.Invoke(&crnd_crn_header2);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header2, pData, data_size);
if (ptr == null)
{
return false;
}
if ((crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_10) & 1) != 0)
if ((crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_flags) & 1) != 0)
{
return false;
}
@@ -35,13 +35,13 @@ internal static partial class crnd_create_segmented_file
return false;
}
llvm_memcpy_p0_p0_i64.Invoke(pBase_data, pData, (uint)num, isVolatile: false);
crn_packed_uint_2_Assignment.Invoke(val: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->field_10) | 1, @this: &((crnd_crn_header*)pBase_data)->field_10);
crn_packed_uint_4_Assignment.Invoke(&((crnd_crn_header*)pBase_data)->field_3, num);
crn_packed_uint_2_Assignment.Invoke(val: (ushort)crc16.Invoke(len: crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->field_3) - crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->field_1), pBuf: (byte*)pBase_data + (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->field_1), crc: 0), @this: &((crnd_crn_header*)pBase_data)->field_4);
crn_packed_uint_2_Assignment.Invoke(val: (ushort)crc16.Invoke(len: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->field_1) - (int)((long)(&((crnd_crn_header*)pBase_data)->field_3) - (long)pBase_data), pBuf: &((crnd_crn_header*)pBase_data)->field_3, crc: 0), @this: &((crnd_crn_header*)pBase_data)->field_2);
crn_packed_uint_2_Assignment.Invoke(val: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->m_flags) | 1, @this: &((crnd_crn_header*)pBase_data)->m_flags);
crn_packed_uint_4_Assignment.Invoke(&((crnd_crn_header*)pBase_data)->m_data_size, num);
crn_packed_uint_2_Assignment.Invoke(val: (ushort)crc16.Invoke(len: crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->m_data_size) - crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->m_header_size), pBuf: (byte*)pBase_data + (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->m_header_size), crc: 0), @this: &((crnd_crn_header*)pBase_data)->m_data_crc16);
crn_packed_uint_2_Assignment.Invoke(val: (ushort)crc16.Invoke(len: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pBase_data)->m_header_size) - (int)((long)(&((crnd_crn_header*)pBase_data)->m_data_size) - (long)pBase_data), pBuf: &((crnd_crn_header*)pBase_data)->m_data_size, crc: 0), @this: &((crnd_crn_header*)pBase_data)->m_header_crc16);
if (!crnd_validate_file.Invoke(pBase_data, num, null))
{
crnd_assert.Invoke(String_2bpyz2d.__pointer, String_yguirrd.__pointer, 2898);
crnd_assert.Invoke(String_82dmwb.__pointer, String_vvx8bt.__pointer, 2898);
}
return true;
}
@@ -35,7 +35,7 @@ internal static partial class crnd_crn_format_to_fourcc
case 10:
return 826496069;
default:
crnd_assert.Invoke(String_xxn2wad.__pointer, String_yguirrd.__pointer, 2635);
crnd_assert.Invoke(String_ak4am9.__pointer, String_vvx8bt.__pointer, 2635);
return 0;
}
}
@@ -6,7 +6,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_delete_array@I@crnd@@YAXPEAI@Z")]
[DemangledName("void __cdecl crnd::crnd_delete_array<unsigned int>(unsigned int *)")]
[CleanName("crnd_delete_array")]
internal static partial class crnd_delete_array_nughn5d
internal static partial class crnd_delete_array_wgct9q
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("unsigned int *")] void* p)
@@ -19,9 +19,9 @@ internal static partial class crnd_delete_array_nughn5d
int num2 = *(int*)((byte*)p + -8);
if (num == 0 || num != (num2 ^ -1))
{
crnd_assert.Invoke(String_ec57feb.__pointer, String_yguirrd.__pointer, 651);
crnd_assert.Invoke(String_bsbwfp.__pointer, String_vvx8bt.__pointer, 651);
}
destruct_array_lrbdoxa.Invoke(p, num);
destruct_array_yfmkw8.Invoke(p, num);
crnd_free.Invoke((byte*)p + -8);
if (ExceptionInfo.Current == null)
{
@@ -6,7 +6,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_delete_array@G@crnd@@YAXPEAG@Z")]
[DemangledName("void __cdecl crnd::crnd_delete_array<unsigned short>(unsigned short *)")]
[CleanName("crnd_delete_array")]
internal static partial class crnd_delete_array_rytswyc
internal static partial class crnd_delete_array_yym6az
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("unsigned short *")] void* p)
@@ -19,9 +19,9 @@ internal static partial class crnd_delete_array_rytswyc
int num2 = *(int*)((byte*)p + -8);
if (num == 0 || num != (num2 ^ -1))
{
crnd_assert.Invoke(String_ec57feb.__pointer, String_yguirrd.__pointer, 651);
crnd_assert.Invoke(String_bsbwfp.__pointer, String_vvx8bt.__pointer, 651);
}
destruct_array_viasmsc.Invoke(p, num);
destruct_array_v2phiu.Invoke(p, num);
crnd_free.Invoke((byte*)p + -8);
if (ExceptionInfo.Current == null)
{
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_delete@Vdecoder_tables@prefix_coding@crnd@@@crnd@@YAXPEAVdecoder_tables@prefix_coding@0@@Z")]
[DemangledName("void __cdecl crnd::crnd_delete<class crnd::prefix_coding::decoder_tables>(class crnd::prefix_coding::decoder_tables *)")]
[CleanName("crnd_delete")]
internal static partial class crnd_delete_rldcmnc
internal static partial class crnd_delete_bvucig
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("class crnd::prefix_coding::decoder_tables *")] void* p)
@@ -14,7 +14,7 @@ internal static partial class crnd_delete_rldcmnc
{
return;
}
destruct_py7r2pc.Invoke(p);
destruct_kgci2b.Invoke(p);
if (ExceptionInfo.Current == null)
{
crnd_free.Invoke(p);
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_delete@Vcrn_unpacker@crnd@@@crnd@@YAXPEAVcrn_unpacker@0@@Z")]
[DemangledName("void __cdecl crnd::crnd_delete<class crnd::crn_unpacker>(class crnd::crn_unpacker *)")]
[CleanName("crnd_delete")]
internal static partial class crnd_delete_e7rwdhb
internal static partial class crnd_delete_ps427s
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("class crnd::crn_unpacker *")] void* p)
@@ -14,7 +14,7 @@ internal static partial class crnd_delete_e7rwdhb
{
return;
}
destruct_f77lq2b.Invoke(p);
destruct_msam3p.Invoke(p);
if (ExceptionInfo.Current == null)
{
crnd_free.Invoke(p);
@@ -18,7 +18,7 @@ internal static partial class crnd_free
{
if (((int)p & 7) != 0)
{
crnd_mem_error.Invoke(String_gcwah5d.__pointer);
crnd_mem_error.Invoke(String_6fnra8.__pointer);
return;
}
((delegate*<void*, long, void*, bool, void*, void*>)g_pRealloc.Value)(p, 0L, null, true, g_pUser_data.Value);
@@ -26,7 +26,7 @@ internal static partial class crnd_get_crn_format_bits_per_texel
case 8:
return 8;
default:
crnd_assert.Invoke(String_xxn2wad.__pointer, String_yguirrd.__pointer, 2672);
crnd_assert.Invoke(String_ak4am9.__pointer, String_vvx8bt.__pointer, 2672);
return 0;
}
}
@@ -16,11 +16,11 @@ internal static partial class crnd_get_header
{
return null;
}
if (crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pData)->field_0) != 18552)
if (crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pData)->m_sig) != 18552)
{
return null;
}
if ((ulong)(uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pData)->field_1) < 74uL || (uint)data_size < (uint)crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)pData)->field_3))
if ((ulong)(uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)pData)->m_header_size) < 74uL || (uint)data_size < (uint)crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)pData)->m_data_size))
{
return null;
}
@@ -10,7 +10,7 @@ internal static partial class crnd_get_level_data
[return: NativeType("void const *")]
public unsafe static void* Invoke([NativeType("void const *")] void* pData, [NativeType("unsigned int")] int data_size, [NativeType("unsigned int")] int level_index, [NativeType("unsigned int *")] void* pSize)
{
crnd_crn_header crnd_crn_header = default(crnd_crn_header);
crnd_crn_header crnd_crn_header2 = default(crnd_crn_header);
unchecked
{
if (pSize != null)
@@ -21,23 +21,23 @@ internal static partial class crnd_get_level_data
{
return null;
}
crn_header_Constructor.Invoke(&crnd_crn_header);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header, pData, data_size);
crn_header_Constructor.Invoke(&crnd_crn_header2);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header2, pData, data_size);
if (ptr == null)
{
return null;
}
if ((uint)level_index >= (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7))
if ((uint)level_index >= (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels))
{
return null;
}
int num = crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->field_20) + (nint)(uint)level_index * (nint)sizeof(crnd_crn_packed_uint_jymcebc));
int num = crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->m_level_ofs) + (nint)(uint)level_index * (nint)sizeof(crnd_crn_packed_uint_25ciii));
if (pSize != null)
{
int num2 = data_size;
if ((uint)(level_index + 1) < (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7))
if ((uint)(level_index + 1) < (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels))
{
num2 = crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->field_20) + (nint)(uint)(level_index + 1) * (nint)sizeof(crnd_crn_packed_uint_jymcebc));
num2 = crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->m_level_ofs) + (nint)(uint)(level_index + 1) * (nint)sizeof(crnd_crn_packed_uint_25ciii));
}
*(int*)pSize = num2 - num;
}
@@ -10,36 +10,36 @@ internal static partial class crnd_get_level_info
[return: NativeType("bool")]
public unsafe static bool Invoke([NativeType("void const *")] void* pData, [NativeType("unsigned int")] int data_size, [NativeType("unsigned int")] int level_index, [NativeType("struct crnd::crn_level_info *")] void* pLevel_info)
{
crnd_crn_header crnd_crn_header = default(crnd_crn_header);
crnd_crn_header crnd_crn_header2 = default(crnd_crn_header);
unchecked
{
if (pData == null || (uint)data_size < 62u || pLevel_info == null)
{
return false;
}
if ((long)(uint)((crnd_crn_level_info*)pLevel_info)->field_0 != 32L)
if ((long)(uint)((crnd_crn_level_info*)pLevel_info)->m_struct_size != 32L)
{
return false;
}
crn_header_Constructor.Invoke(&crnd_crn_header);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header, pData, data_size);
crn_header_Constructor.Invoke(&crnd_crn_header2);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header2, pData, data_size);
if (ptr == null)
{
return false;
}
if ((uint)level_index >= (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7))
if ((uint)level_index >= (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels))
{
return false;
}
int num = maximum.Invoke(1, crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_5) >>> level_index);
int num2 = maximum.Invoke(1, crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_6) >>> level_index);
((crnd_crn_level_info*)pLevel_info)->field_1 = num;
((crnd_crn_level_info*)pLevel_info)->field_2 = num2;
((crnd_crn_level_info*)pLevel_info)->field_3 = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_8);
((crnd_crn_level_info*)pLevel_info)->field_4 = num + 3 >>> 2;
((crnd_crn_level_info*)pLevel_info)->field_5 = num2 + 3 >>> 2;
((crnd_crn_level_info*)pLevel_info)->field_6 = InstructionHelper.Select((crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9) != 0) ? (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9) == 9) : true, 8, 16);
((crnd_crn_level_info*)pLevel_info)->field_7 = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9);
int num = maximum.Invoke(1, crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_width) >>> level_index);
int num2 = maximum.Invoke(1, crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_height) >>> level_index);
((crnd_crn_level_info*)pLevel_info)->m_width = num;
((crnd_crn_level_info*)pLevel_info)->m_height = num2;
((crnd_crn_level_info*)pLevel_info)->m_faces = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_faces);
((crnd_crn_level_info*)pLevel_info)->m_blocks_x = num + 3 >>> 2;
((crnd_crn_level_info*)pLevel_info)->m_blocks_y = num2 + 3 >>> 2;
((crnd_crn_level_info*)pLevel_info)->m_bytes_per_block = InstructionHelper.Select((crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format) != 0) ? (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format) == 9) : true, 8, 16);
((crnd_crn_level_info*)pLevel_info)->m_format = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format);
return true;
}
}
@@ -10,20 +10,20 @@ internal static partial class crnd_get_segmented_file_size
[return: NativeType("unsigned int")]
public unsafe static int Invoke([NativeType("void const *")] void* pData, [NativeType("unsigned int")] int data_size)
{
crnd_crn_header crnd_crn_header = default(crnd_crn_header);
crnd_crn_header crnd_crn_header2 = default(crnd_crn_header);
unchecked
{
if (pData == null || (uint)data_size < 62u)
{
return 0;
}
crn_header_Constructor.Invoke(&crnd_crn_header);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header, pData, data_size);
crn_header_Constructor.Invoke(&crnd_crn_header2);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header2, pData, data_size);
if (ptr == null)
{
return 0;
}
return maximum.Invoke(maximum.Invoke(maximum.Invoke(maximum.Invoke(maximum.Invoke(crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_1), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_14.field_0) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_14.field_1)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_15.field_0) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_15.field_1)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_16.field_0) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_16.field_1)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_17.field_0) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_17.field_1)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_19) + crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_18));
return maximum.Invoke(maximum.Invoke(maximum.Invoke(maximum.Invoke(maximum.Invoke(crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_header_size), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_endpoints.m_ofs) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_endpoints.m_size)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_selectors.m_ofs) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_selectors.m_size)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_endpoints.m_ofs) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_endpoints.m_size)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_selectors.m_ofs) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_selectors.m_size)), crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_tables_ofs) + crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_tables_size));
}
}
}
@@ -10,31 +10,31 @@ internal static partial class crnd_get_texture_info
[return: NativeType("bool")]
public unsafe static bool Invoke([NativeType("void const *")] void* pData, [NativeType("unsigned int")] int data_size, [NativeType("struct crnd::crn_texture_info *")] void* pInfo)
{
crnd_crn_header crnd_crn_header = default(crnd_crn_header);
crnd_crn_header crnd_crn_header2 = default(crnd_crn_header);
unchecked
{
if (pData == null || (ulong)(uint)data_size < 74uL || pInfo == null)
{
return false;
}
if ((long)(uint)((crnd_crn_texture_info*)pInfo)->field_0 != 36L)
if ((long)(uint)((crnd_crn_texture_info*)pInfo)->m_struct_size != 36L)
{
return false;
}
crn_header_Constructor.Invoke(&crnd_crn_header);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header, pData, data_size);
crn_header_Constructor.Invoke(&crnd_crn_header2);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header2, pData, data_size);
if (ptr == null)
{
return false;
}
((crnd_crn_texture_info*)pInfo)->field_1 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_5);
((crnd_crn_texture_info*)pInfo)->field_2 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_6);
((crnd_crn_texture_info*)pInfo)->field_3 = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7);
((crnd_crn_texture_info*)pInfo)->field_4 = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_8);
((crnd_crn_texture_info*)pInfo)->field_8 = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9);
((crnd_crn_texture_info*)pInfo)->field_5 = InstructionHelper.Select((crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9) != 0) ? (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9) == 9) : true, 8, 16);
((crnd_crn_texture_info*)pInfo)->field_6 = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_12);
((crnd_crn_texture_info*)pInfo)->field_7 = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_13);
((crnd_crn_texture_info*)pInfo)->m_width = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_width);
((crnd_crn_texture_info*)pInfo)->m_height = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_height);
((crnd_crn_texture_info*)pInfo)->m_levels = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels);
((crnd_crn_texture_info*)pInfo)->m_faces = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_faces);
((crnd_crn_texture_info*)pInfo)->m_format = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format);
((crnd_crn_texture_info*)pInfo)->m_bytes_per_block = InstructionHelper.Select((crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format) != 0) ? (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format) == 9) : true, 8, 16);
((crnd_crn_texture_info*)pInfo)->m_userdata0 = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_userdata0);
((crnd_crn_texture_info*)pInfo)->m_userdata1 = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_userdata1);
return true;
}
}
@@ -28,7 +28,7 @@ internal static partial class crnd_malloc
void* ptr;
if ((ulong)num > 2147418112uL)
{
crnd_mem_error.Invoke(String_ypy7scc.__pointer);
crnd_mem_error.Invoke(String_mqjrcv.__pointer);
ptr = null;
}
else
@@ -48,14 +48,14 @@ internal static partial class crnd_malloc
}
if (ptr3 == null || (ulong)localsPointer->field_0 < (ulong)num)
{
crnd_mem_error.Invoke(String_xewaojb.__pointer);
crnd_mem_error.Invoke(String_eafej9.__pointer);
ptr = null;
}
else
{
if (((int)ptr3 & 7) != 0)
{
crnd_assert.Invoke(String_e9ixvnc.__pointer, String_yguirrd.__pointer, 2533);
crnd_assert.Invoke(String_vgj8eq.__pointer, String_vvx8bt.__pointer, 2533);
}
ptr = ptr3;
}
@@ -10,6 +10,6 @@ internal static partial class crnd_mem_error
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("char const *")] void* p_msg)
{
crnd_assert.Invoke(p_msg, String_yguirrd.__pointer, 2506);
crnd_assert.Invoke(p_msg, String_vvx8bt.__pointer, 2506);
}
}
@@ -18,7 +18,7 @@ internal static partial class crnd_msize
{
if (((int)p & 7) != 0)
{
crnd_mem_error.Invoke(String_zijibvd.__pointer);
crnd_mem_error.Invoke(String_x22k5v.__pointer);
return 0L;
}
long result = ((delegate*<void*, void*, long>)g_pMSize.Value)(p, g_pUser_data.Value);
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_new@Vdecoder_tables@prefix_coding@crnd@@@crnd@@YAPEAVdecoder_tables@prefix_coding@0@AEBV120@@Z")]
[DemangledName("class crnd::prefix_coding::decoder_tables * __cdecl crnd::crnd_new<class crnd::prefix_coding::decoder_tables>(class crnd::prefix_coding::decoder_tables const &)")]
[CleanName("crnd_new")]
internal static partial class crnd_new_vzd3zqa
internal static partial class crnd_new_485jak
{
[return: NativeType("class crnd::prefix_coding::decoder_tables *")]
public unsafe static void* Invoke([NativeType("class crnd::prefix_coding::decoder_tables const &")] void* init)
@@ -20,7 +20,7 @@ internal static partial class crnd_new_vzd3zqa
{
return null;
}
void* result = construct_zybj4yc.Invoke(ptr2, init);
void* result = construct_va3fwv.Invoke(ptr2, init);
if (ExceptionInfo.Current != null)
{
return null;
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_new_array@G@crnd@@YAPEAGI@Z")]
[DemangledName("unsigned short * __cdecl crnd::crnd_new_array<unsigned short>(unsigned int)")]
[CleanName("crnd_new_array")]
internal static partial class crnd_new_array_ovofsdb
internal static partial class crnd_new_array_ped3ba
{
[return: NativeType("unsigned short *")]
public unsafe static void* Invoke([NativeType("unsigned int")] int num)
@@ -30,7 +30,7 @@ internal static partial class crnd_new_array_ovofsdb
void* ptr3 = (byte*)ptr2 + 8;
*(int*)((byte*)ptr3 + -4) = num2;
*(int*)((byte*)ptr3 + -8) = num2 ^ -1;
construct_array_pri7s5c.Invoke(ptr3, num2);
construct_array_smzb78.Invoke(ptr3, num2);
return ptr3;
}
}
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_new_array@I@crnd@@YAPEAII@Z")]
[DemangledName("unsigned int * __cdecl crnd::crnd_new_array<unsigned int>(unsigned int)")]
[CleanName("crnd_new_array")]
internal static partial class crnd_new_array_linsntd
internal static partial class crnd_new_array_zqdtgg
{
[return: NativeType("unsigned int *")]
public unsafe static void* Invoke([NativeType("unsigned int")] int num)
@@ -30,7 +30,7 @@ internal static partial class crnd_new_array_linsntd
void* ptr3 = (byte*)ptr2 + 8;
*(int*)((byte*)ptr3 + -4) = num2;
*(int*)((byte*)ptr3 + -8) = num2 ^ -1;
construct_array_rijpqya.Invoke(ptr3, num2);
construct_array_7hpyj8.Invoke(ptr3, num2);
return ptr3;
}
}
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_new@Vcrn_unpacker@crnd@@@crnd@@YAPEAVcrn_unpacker@0@XZ")]
[DemangledName("class crnd::crn_unpacker * __cdecl crnd::crnd_new<class crnd::crn_unpacker>(void)")]
[CleanName("crnd_new")]
internal static partial class crnd_new_xzix9sb
internal static partial class crnd_new_jsasrf
{
[return: NativeType("class crnd::crn_unpacker *")]
public unsafe static void* Invoke()
@@ -20,7 +20,7 @@ internal static partial class crnd_new_xzix9sb
{
return null;
}
void* result = construct_bzfae7a.Invoke(ptr2);
void* result = construct_fgrjha.Invoke(ptr2);
if (ExceptionInfo.Current != null)
{
return null;
@@ -5,7 +5,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("??$crnd_new@Vdecoder_tables@prefix_coding@crnd@@@crnd@@YAPEAVdecoder_tables@prefix_coding@0@XZ")]
[DemangledName("class crnd::prefix_coding::decoder_tables * __cdecl crnd::crnd_new<class crnd::prefix_coding::decoder_tables>(void)")]
[CleanName("crnd_new")]
internal static partial class crnd_new_9bg4xgd
internal static partial class crnd_new_nwmzm6
{
[return: NativeType("class crnd::prefix_coding::decoder_tables *")]
public unsafe static void* Invoke()
@@ -20,6 +20,6 @@ internal static partial class crnd_new_9bg4xgd
{
return null;
}
return construct_e5fhx3a.Invoke(ptr2);
return construct_uri2px.Invoke(ptr2);
}
}
@@ -24,12 +24,12 @@ internal static partial class crnd_realloc
void* ptr;
if (((int)p & 7) != 0)
{
crnd_mem_error.Invoke(String_ifury7b.__pointer);
crnd_mem_error.Invoke(String_f3peyu.__pointer);
ptr = null;
}
else if ((ulong)size > 2147418112uL)
{
crnd_mem_error.Invoke(String_ypy7scc.__pointer);
crnd_mem_error.Invoke(String_mqjrcv.__pointer);
ptr = null;
}
else
@@ -49,7 +49,7 @@ internal static partial class crnd_realloc
}
if (((int)ptr3 & 7) != 0)
{
crnd_assert.Invoke(String_e9ixvnc.__pointer, String_yguirrd.__pointer, 2558);
crnd_assert.Invoke(String_vgj8eq.__pointer, String_vvx8bt.__pointer, 2558);
}
ptr = ptr3;
}
@@ -6,12 +6,12 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?crnd_trace@crnd@@YAXPEBDZZ")]
[DemangledName("void __cdecl crnd::crnd_trace(char const *, ...)")]
[CleanName("crnd_trace")]
internal static partial class crnd_trace_53itvya
internal static partial class crnd_trace_7532hv
{
public unsafe static void Invoke(void* pFmt, ReadOnlySpan<nint> args)
{
void* args2 = null;
InstructionHelper.VAStart(&args2, args);
crnd_trace_5g37v2a.Invoke(pFmt, args2);
crnd_trace_kv3t38.Invoke(pFmt, args2);
}
}
@@ -6,7 +6,7 @@ namespace AssetRipper.Conversions.Crunch.GlobalFunctions;
[MangledName("?crnd_trace@crnd@@YAXPEBDPEAD@Z")]
[DemangledName("void __cdecl crnd::crnd_trace(char const *, char *)")]
[CleanName("crnd_trace")]
internal static partial class crnd_trace_5g37v2a
internal static partial class crnd_trace_kv3t38
{
[return: NativeType("void")]
public unsafe static void Invoke([NativeType("char const *")] void* pFmt, [NativeType("char *")] void* args)
@@ -13,7 +13,7 @@ internal static partial class crnd_unpack_begin
{
return null;
}
void* ptr = crnd_new_xzix9sb.Invoke();
void* ptr = crnd_new_jsasrf.Invoke();
if (ExceptionInfo.Current != null)
{
return null;
@@ -23,14 +23,14 @@ internal static partial class crnd_unpack_begin
{
return null;
}
bool flag = init_lqqdgrc.Invoke(ptr2, pData, data_size);
bool flag = init_4dt3g9.Invoke(ptr2, pData, data_size);
if (ExceptionInfo.Current != null)
{
return null;
}
if (!flag)
{
crnd_delete_e7rwdhb.Invoke(ptr2);
crnd_delete_ps427s.Invoke(ptr2);
if (ExceptionInfo.Current != null)
{
return null;
@@ -17,7 +17,7 @@ internal static partial class crnd_unpack_end
{
return false;
}
crnd_delete_e7rwdhb.Invoke(pContext);
crnd_delete_ps427s.Invoke(pContext);
if (ExceptionInfo.Current != null)
{
return false;
@@ -17,6 +17,6 @@ internal static partial class crnd_unpack_level
{
return false;
}
return unpack_level_cvfjdga.Invoke(pContext, pDst, dst_size_in_bytes, row_pitch_in_bytes, level_index);
return unpack_level_vni4dg.Invoke(pContext, pDst, dst_size_in_bytes, row_pitch_in_bytes, level_index);
}
}
@@ -17,6 +17,6 @@ internal static partial class crnd_unpack_level_segmented
{
return false;
}
return unpack_level_zjb72ec.Invoke(pContext, pSrc, src_size_in_bytes, pDst, dst_size_in_bytes, row_pitch_in_bytes, level_index);
return unpack_level_u9ch6s.Invoke(pContext, pSrc, src_size_in_bytes, pDst, dst_size_in_bytes, row_pitch_in_bytes, level_index);
}
}
@@ -11,76 +11,76 @@ internal static partial class crnd_validate_file
[return: NativeType("bool")]
public unsafe static bool Invoke([NativeType("void const *")] void* pData, [NativeType("unsigned int")] int data_size, [NativeType("struct crnd::crn_file_info *")] void* pFile_info)
{
crnd_crn_header crnd_crn_header = default(crnd_crn_header);
crnd_crn_header crnd_crn_header2 = default(crnd_crn_header);
unchecked
{
if (pFile_info != null)
{
if ((long)(uint)((crnd_crn_file_info*)pFile_info)->field_0 != 104L)
if ((long)(uint)((crnd_crn_file_info*)pFile_info)->m_struct_size != 104L)
{
return false;
}
llvm_memset_p0_i64.Invoke(&((crnd_crn_file_info*)pFile_info)->field_0 + 1, 0, 100L, isVolatile: false);
llvm_memset_p0_i64.Invoke(&((crnd_crn_file_info*)pFile_info)->m_struct_size + 1, 0, 100L, isVolatile: false);
}
if (pData == null || (uint)data_size < 62u)
{
return false;
}
crn_header_Constructor.Invoke(&crnd_crn_header);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header, pData, data_size);
crn_header_Constructor.Invoke(&crnd_crn_header2);
void* ptr = crnd_get_header.Invoke(&crnd_crn_header2, pData, data_size);
if (ptr == null)
{
return false;
}
if ((ushort)crc16.Invoke(len: (int)checked(unchecked((uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_1)) - unchecked((long)(&((crnd_crn_header*)ptr)->field_3) - (long)ptr)), pBuf: &((crnd_crn_header*)ptr)->field_3, crc: 0) != crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_2))
if ((ushort)crc16.Invoke(len: (int)checked(unchecked((uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_header_size)) - unchecked((long)(&((crnd_crn_header*)ptr)->m_data_size) - (long)ptr)), pBuf: &((crnd_crn_header*)ptr)->m_data_size, crc: 0) != crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_header_crc16))
{
return false;
}
if ((ushort)crc16.Invoke(len: crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_3) - crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_1), pBuf: (byte*)pData + (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_1), crc: 0) != crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_4))
if ((ushort)crc16.Invoke(len: crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_data_size) - crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_header_size), pBuf: (byte*)pData + (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_header_size), crc: 0) != crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_data_crc16))
{
return false;
}
if (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_8) != 1 && crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_8) != 6)
if (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_faces) != 1 && crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_faces) != 6)
{
return false;
}
if ((uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_5) < 1u || (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_5) > 4096u)
if ((uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_width) < 1u || (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_width) > 4096u)
{
return false;
}
if ((uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_6) < 1u || (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_6) > 4096u)
if ((uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_height) < 1u || (uint)crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_height) > 4096u)
{
return false;
}
if ((uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7) < 1u || (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7) > (uint)compute_max_mips.Invoke(height: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_6), width: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_5)))
if ((uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels) < 1u || (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels) > (uint)compute_max_mips.Invoke(height: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_height), width: crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_width)))
{
return false;
}
if (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9) < 0 || crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_9) >= 11)
if (crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format) < 0 || crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_format) >= 11)
{
return false;
}
if (pFile_info != null)
{
((crnd_crn_file_info*)pFile_info)->field_1 = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_3);
((crnd_crn_file_info*)pFile_info)->field_2 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_1);
((crnd_crn_file_info*)pFile_info)->field_3 = crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_14.field_1) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_15.field_1) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_16.field_1) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_17.field_1);
((crnd_crn_file_info*)pFile_info)->field_4 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_18);
((crnd_crn_file_info*)pFile_info)->field_5 = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7);
for (int i = 0; (uint)i < (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7); i++)
((crnd_crn_file_info*)pFile_info)->m_actual_data_size = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_data_size);
((crnd_crn_file_info*)pFile_info)->m_header_size = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_header_size);
((crnd_crn_file_info*)pFile_info)->m_total_palette_size = crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_endpoints.m_size) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_selectors.m_size) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_endpoints.m_size) + crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_selectors.m_size);
((crnd_crn_file_info*)pFile_info)->m_tables_size = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_tables_size);
((crnd_crn_file_info*)pFile_info)->m_levels = crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels);
for (int i = 0; (uint)i < (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels); i++)
{
int num = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_3);
if ((uint)(i + 1) < (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_7))
int num = crn_packed_uint_4_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_data_size);
if ((uint)(i + 1) < (uint)crn_packed_uint_1_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_levels))
{
num = crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->field_20) + (nint)(uint)(i + 1) * (nint)sizeof(crnd_crn_packed_uint_jymcebc));
num = crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->m_level_ofs) + (nint)(uint)(i + 1) * (nint)sizeof(crnd_crn_packed_uint_25ciii));
}
int num2 = num - crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->field_20) + (nint)(uint)i * (nint)sizeof(crnd_crn_packed_uint_jymcebc));
((int*)(&((crnd_crn_file_info*)pFile_info)->field_6))[(uint)i] = num2;
int num2 = num - crn_packed_uint_4_ToUInt32.Invoke((byte*)(&((crnd_crn_header*)ptr)->m_level_ofs) + (nint)(uint)i * (nint)sizeof(crnd_crn_packed_uint_25ciii));
((int*)(&((crnd_crn_file_info*)pFile_info)->m_level_compressed_size))[(uint)i] = num2;
}
((crnd_crn_file_info*)pFile_info)->field_7 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_14.field_2);
((crnd_crn_file_info*)pFile_info)->field_8 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_15.field_2);
((crnd_crn_file_info*)pFile_info)->field_9 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_16.field_2);
((crnd_crn_file_info*)pFile_info)->field_10 = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->field_17.field_2);
((crnd_crn_file_info*)pFile_info)->m_color_endpoint_palette_entries = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_endpoints.m_num);
((crnd_crn_file_info*)pFile_info)->m_color_selector_palette_entries = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_color_selectors.m_num);
((crnd_crn_file_info*)pFile_info)->m_alpha_endpoint_palette_entries = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_endpoints.m_num);
((crnd_crn_file_info*)pFile_info)->m_alpha_selector_palette_entries = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)ptr)->m_alpha_selectors.m_num);
}
return true;
}
@@ -13,43 +13,43 @@ internal static partial class decode
{
unchecked
{
void* field_ = ((crnd_static_huffman_data_model*)model)->field_2;
if (((crnd_symbol_codec*)@this)->field_5 < 24)
void* pDecode_tables = ((crnd_static_huffman_data_model*)model)->m_pDecode_tables;
if (((crnd_symbol_codec*)@this)->m_bit_count < 24)
{
if (((crnd_symbol_codec*)@this)->field_5 < 16)
if (((crnd_symbol_codec*)@this)->m_bit_count < 16)
{
int num = 0;
int num2 = 0;
void* ptr = ((crnd_symbol_codec*)@this)->field_1;
if (ptr < ((crnd_symbol_codec*)@this)->field_2)
void* ptr = ((crnd_symbol_codec*)@this)->m_pDecode_buf_next;
if (ptr < ((crnd_symbol_codec*)@this)->m_pDecode_buf_end)
{
void* ptr2 = ptr;
ptr = (byte*)ptr2 + 1;
num = (byte)(*(sbyte*)ptr2);
}
if (ptr < ((crnd_symbol_codec*)@this)->field_2)
if (ptr < ((crnd_symbol_codec*)@this)->m_pDecode_buf_end)
{
void* ptr3 = ptr;
ptr = (byte*)ptr3 + 1;
num2 = (byte)(*(sbyte*)ptr3);
}
((crnd_symbol_codec*)@this)->field_1 = ptr;
((crnd_symbol_codec*)@this)->m_pDecode_buf_next = ptr;
int num3;
checked
{
unchecked((crnd_symbol_codec*)@this)->field_5 += 16;
num3 = ((num << 8) | num2) << 32 - unchecked((crnd_symbol_codec*)@this)->field_5;
unchecked((crnd_symbol_codec*)@this)->m_bit_count += 16;
num3 = ((num << 8) | num2) << 32 - unchecked((crnd_symbol_codec*)@this)->m_bit_count;
}
((crnd_symbol_codec*)@this)->field_4 |= num3;
((crnd_symbol_codec*)@this)->m_bit_buf |= num3;
}
else
{
int num4;
if (((crnd_symbol_codec*)@this)->field_1 < ((crnd_symbol_codec*)@this)->field_2)
if (((crnd_symbol_codec*)@this)->m_pDecode_buf_next < ((crnd_symbol_codec*)@this)->m_pDecode_buf_end)
{
void** field_2 = &((crnd_symbol_codec*)@this)->field_1;
void* ptr4 = *field_2;
*field_2 = (byte*)ptr4 + 1;
void** pDecode_buf_next = &((crnd_symbol_codec*)@this)->m_pDecode_buf_next;
void* ptr4 = *pDecode_buf_next;
*pDecode_buf_next = (byte*)ptr4 + 1;
num4 = (byte)(*(sbyte*)ptr4);
}
else
@@ -60,44 +60,44 @@ internal static partial class decode
int num6;
checked
{
unchecked((crnd_symbol_codec*)@this)->field_5 += 8;
num6 = num5 << 32 - unchecked((crnd_symbol_codec*)@this)->field_5;
unchecked((crnd_symbol_codec*)@this)->m_bit_count += 8;
num6 = num5 << 32 - unchecked((crnd_symbol_codec*)@this)->m_bit_count;
}
((crnd_symbol_codec*)@this)->field_4 |= num6;
((crnd_symbol_codec*)@this)->m_bit_buf |= num6;
}
}
int num7 = (((crnd_symbol_codec*)@this)->field_4 >>> 16) + 1;
int num7 = (((crnd_symbol_codec*)@this)->m_bit_buf >>> 16) + 1;
int num9;
int i;
if ((uint)num7 <= (uint)((crnd_prefix_coding_decoder_tables*)field_)->field_4)
if ((uint)num7 <= (uint)((crnd_prefix_coding_decoder_tables*)pDecode_tables)->m_table_max_code)
{
int num8 = ((int*)((crnd_prefix_coding_decoder_tables*)field_)->field_11)[(uint)(((crnd_symbol_codec*)@this)->field_4 >>> 32 - ((crnd_prefix_coding_decoder_tables*)field_)->field_2)];
int num8 = ((int*)((crnd_prefix_coding_decoder_tables*)pDecode_tables)->m_lookup)[(uint)(((crnd_symbol_codec*)@this)->m_bit_buf >>> 32 - ((crnd_prefix_coding_decoder_tables*)pDecode_tables)->m_table_bits)];
if (num8 == -1)
{
crnd_assert.Invoke(String_fwybtzb.__pointer, String_yguirrd.__pointer, 3253);
crnd_assert.Invoke(String_hdsqwd.__pointer, String_vvx8bt.__pointer, 3253);
}
num9 = num8 & 0xFFFF;
i = num8 >>> 16;
if ((byte)(*(sbyte*)vector_unsigned_char_Index_3lowkad.Invoke(&((crnd_static_huffman_data_model*)model)->field_1, num9)) != i)
if ((byte)(*(sbyte*)vector_unsigned_char_Operator_btiznu.Invoke(&((crnd_static_huffman_data_model*)model)->m_code_sizes, num9)) != i)
{
crnd_assert.Invoke(String_e4i4x9a.__pointer, String_yguirrd.__pointer, 3257);
crnd_assert.Invoke(String_8pbqr2.__pointer, String_vvx8bt.__pointer, 3257);
}
}
else
{
for (i = ((crnd_prefix_coding_decoder_tables*)field_)->field_5; (uint)num7 > (uint)((int*)(&((crnd_prefix_coding_decoder_tables*)field_)->field_8))[(uint)(i - 1)]; i++)
for (i = ((crnd_prefix_coding_decoder_tables*)pDecode_tables)->m_decode_start_code_size; (uint)num7 > (uint)((int*)(&((crnd_prefix_coding_decoder_tables*)pDecode_tables)->m_max_codes))[(uint)(i - 1)]; i++)
{
}
int num10 = ((int*)(&((crnd_prefix_coding_decoder_tables*)field_)->field_9))[(uint)(i - 1)] + (((crnd_symbol_codec*)@this)->field_4 >>> 32 - i);
if ((uint)num10 >= (uint)((crnd_static_huffman_data_model*)model)->field_0)
int num10 = ((int*)(&((crnd_prefix_coding_decoder_tables*)pDecode_tables)->m_val_ptrs))[(uint)(i - 1)] + (((crnd_symbol_codec*)@this)->m_bit_buf >>> 32 - i);
if ((uint)num10 >= (uint)((crnd_static_huffman_data_model*)model)->m_total_syms)
{
crnd_assert.Invoke(String_xzkwrkb.__pointer, String_yguirrd.__pointer, 3275);
crnd_assert.Invoke(String_m5q5qr.__pointer, String_vvx8bt.__pointer, 3275);
return 0;
}
num9 = (ushort)((short*)((crnd_prefix_coding_decoder_tables*)field_)->field_13)[num10];
num9 = (ushort)((short*)((crnd_prefix_coding_decoder_tables*)pDecode_tables)->m_sorted_symbol_order)[num10];
}
((crnd_symbol_codec*)@this)->field_4 <<= i;
((crnd_symbol_codec*)@this)->field_5 -= i;
((crnd_symbol_codec*)@this)->m_bit_buf <<= i;
((crnd_symbol_codec*)@this)->m_bit_count -= i;
return num9;
}
}
@@ -20,16 +20,16 @@ internal static partial class decode_alpha_endpoints
localsPointer->field_0 = default(crnd_static_huffman_data_model);
unchecked
{
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_16.field_2);
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_alpha_endpoints.m_num);
bool flag;
if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_16.field_1), pBuf: (byte*)((crnd_crn_unpacker*)@this)->field_1 + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_16.field_0)))
if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_alpha_endpoints.m_size), pBuf: (byte*)((crnd_crn_unpacker*)@this)->m_pData + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_alpha_endpoints.m_ofs)))
{
flag = false;
}
else
{
static_huffman_data_model_Constructor_tl33idc.Invoke(&localsPointer->field_0);
bool flag2 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
static_huffman_data_model_Constructor_c98ih8.Invoke(&localsPointer->field_0);
bool flag2 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current != null)
{
goto IL_01e9;
@@ -40,7 +40,7 @@ internal static partial class decode_alpha_endpoints
}
else
{
bool flag3 = resize_w95s75a.Invoke(&((crnd_crn_unpacker*)@this)->field_11, num);
bool flag3 = resize_9ubjj8.Invoke(&((crnd_crn_unpacker*)@this)->m_alpha_endpoints, num);
if (ExceptionInfo.Current != null)
{
goto IL_01e9;
@@ -51,7 +51,7 @@ internal static partial class decode_alpha_endpoints
}
else
{
void* ptr = vector_unsigned_short_Index.Invoke(&((crnd_crn_unpacker*)@this)->field_11, 0);
void* ptr = vector_unsigned_short_Operator.Invoke(&((crnd_crn_unpacker*)@this)->m_alpha_endpoints, 0);
if (ExceptionInfo.Current != null)
{
goto IL_01e9;
@@ -62,11 +62,11 @@ internal static partial class decode_alpha_endpoints
int num4 = 0;
while ((uint)num4 < (uint)num)
{
int num5 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num5 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
int num6 = num5;
int num7 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num7 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
int num8 = num7;
@@ -82,7 +82,7 @@ internal static partial class decode_alpha_endpoints
}
goto IL_01e9;
}
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5);
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec);
flag = true;
}
}
@@ -31,16 +31,16 @@ internal static partial class decode_alpha_selectors
localsPointer->field_3 = default(InlineArray16_Int32);
unchecked
{
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_17.field_2);
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_alpha_selectors.m_num);
bool flag;
if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_17.field_1), pBuf: (byte*)((crnd_crn_unpacker*)@this)->field_1 + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_17.field_0)))
if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_alpha_selectors.m_size), pBuf: (byte*)((crnd_crn_unpacker*)@this)->m_pData + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_alpha_selectors.m_ofs)))
{
flag = false;
}
else
{
static_huffman_data_model_Constructor_tl33idc.Invoke(&localsPointer->field_0);
bool flag2 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
static_huffman_data_model_Constructor_c98ih8.Invoke(&localsPointer->field_0);
bool flag2 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current != null)
{
goto IL_04d9;
@@ -68,8 +68,8 @@ internal static partial class decode_alpha_selectors
}
}
}
zero_object_vtkonjd.Invoke(&localsPointer->field_3);
bool flag3 = resize_w95s75a.Invoke(&((crnd_crn_unpacker*)@this)->field_12, num * 3);
zero_object_ra884z.Invoke(&localsPointer->field_3);
bool flag3 = resize_9ubjj8.Invoke(&((crnd_crn_unpacker*)@this)->m_alpha_selectors, num * 3);
if (ExceptionInfo.Current != null)
{
goto IL_04d9;
@@ -80,7 +80,7 @@ internal static partial class decode_alpha_selectors
}
else
{
void* ptr = vector_unsigned_short_Index.Invoke(&((crnd_crn_unpacker*)@this)->field_12, 0);
void* ptr = vector_unsigned_short_Operator.Invoke(&((crnd_crn_unpacker*)@this)->m_alpha_selectors, 0);
if (ExceptionInfo.Current != null)
{
goto IL_04d9;
@@ -92,7 +92,7 @@ internal static partial class decode_alpha_selectors
int num5 = 0;
while ((uint)num5 < 8u)
{
int num6 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num6 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
int num7 = num6;
@@ -118,7 +118,7 @@ internal static partial class decode_alpha_selectors
ptr2 = (byte*)ptr5 + 2;
*(short*)ptr5 = num12;
}
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5);
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec);
flag = true;
}
}
@@ -21,8 +21,8 @@ internal static partial class decode_color_endpoints
localsPointer->field_0 = default(InlineArray2_crnd_static_huffman_data_model);
unchecked
{
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_14.field_2);
bool flag = resize_a3d3m5b.Invoke(&((crnd_crn_unpacker*)@this)->field_9, num);
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_color_endpoints.m_num);
bool flag = resize_dreg6y.Invoke(&((crnd_crn_unpacker*)@this)->m_color_endpoints, num);
if (ExceptionInfo.Current != null)
{
return false;
@@ -32,7 +32,7 @@ internal static partial class decode_color_endpoints
{
flag2 = false;
}
else if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_14.field_1), pBuf: (byte*)((crnd_crn_unpacker*)@this)->field_1 + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_14.field_0)))
else if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_color_endpoints.m_size), pBuf: (byte*)((crnd_crn_unpacker*)@this)->m_pData + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_color_endpoints.m_ofs)))
{
flag2 = false;
}
@@ -44,7 +44,7 @@ internal static partial class decode_color_endpoints
while (true)
{
void* ptr3 = intPtr;
static_huffman_data_model_Constructor_tl33idc.Invoke(ptr3);
static_huffman_data_model_Constructor_c98ih8.Invoke(ptr3);
if (ExceptionInfo.Current == null)
{
crnd_static_huffman_data_model* ptr4 = (crnd_static_huffman_data_model*)ptr3 + 1;
@@ -83,7 +83,7 @@ internal static partial class decode_color_endpoints
{
if ((uint)num3 < 2u)
{
bool flag3 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->field_5, (byte*)(&localsPointer->field_0) + (nint)(uint)num3 * (nint)sizeof(crnd_static_huffman_data_model));
bool flag3 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, (byte*)(&localsPointer->field_0) + (nint)(uint)num3 * (nint)sizeof(crnd_static_huffman_data_model));
if (ExceptionInfo.Current == null)
{
if (!flag3)
@@ -103,34 +103,34 @@ internal static partial class decode_color_endpoints
int num7 = 0;
int num8 = 0;
int num9 = 0;
void* ptr6 = vector_unsigned_int_Index.Invoke(&((crnd_crn_unpacker*)@this)->field_9, 0);
void* ptr6 = vector_unsigned_int_Operator.Invoke(&((crnd_crn_unpacker*)@this)->m_color_endpoints, 0);
if (ExceptionInfo.Current == null)
{
void* ptr7 = ptr6;
int num10 = 0;
while ((uint)num10 < (uint)num)
{
int num11 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num11 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
num4 = (num4 + num11) & 0x1F;
int num12 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, (byte*)(&localsPointer->field_0) + sizeof(crnd_static_huffman_data_model));
int num12 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, (byte*)(&localsPointer->field_0) + sizeof(crnd_static_huffman_data_model));
if (ExceptionInfo.Current == null)
{
num5 = (num5 + num12) & 0x3F;
int num13 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num13 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
num6 = (num6 + num13) & 0x1F;
int num14 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num14 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
num7 = (num7 + num14) & 0x1F;
int num15 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, (byte*)(&localsPointer->field_0) + sizeof(crnd_static_huffman_data_model));
int num15 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, (byte*)(&localsPointer->field_0) + sizeof(crnd_static_huffman_data_model));
if (ExceptionInfo.Current == null)
{
num8 = (num8 + num15) & 0x3F;
int num16 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num16 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
num9 = (num9 + num16) & 0x1F;
@@ -148,7 +148,7 @@ internal static partial class decode_color_endpoints
}
goto IL_03e6;
}
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5);
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec);
flag2 = true;
break;
}
@@ -32,14 +32,14 @@ internal static partial class decode_color_selectors
bool flag;
unchecked
{
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_15.field_2);
if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_15.field_1), pBuf: (byte*)((crnd_crn_unpacker*)@this)->field_1 + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_15.field_0)))
int num = crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_color_selectors.m_num);
if (!start_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, buf_size: crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_color_selectors.m_size), pBuf: (byte*)((crnd_crn_unpacker*)@this)->m_pData + (uint)crn_packed_uint_3_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_color_selectors.m_ofs)))
{
flag = false;
goto IL_04bb;
}
static_huffman_data_model_Constructor_tl33idc.Invoke(&localsPointer->field_0);
bool flag2 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
static_huffman_data_model_Constructor_c98ih8.Invoke(&localsPointer->field_0);
bool flag2 = decode_receive_static_data_model.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
if (!flag2)
@@ -64,10 +64,10 @@ internal static partial class decode_color_selectors
}
}
}
zero_object_vtkonjd.Invoke(&localsPointer->field_3);
zero_object_ra884z.Invoke(&localsPointer->field_3);
if (ExceptionInfo.Current == null)
{
bool flag3 = resize_a3d3m5b.Invoke(&((crnd_crn_unpacker*)@this)->field_10, num);
bool flag3 = resize_dreg6y.Invoke(&((crnd_crn_unpacker*)@this)->m_color_selectors, num);
if (ExceptionInfo.Current == null)
{
if (!flag3)
@@ -76,7 +76,7 @@ internal static partial class decode_color_selectors
}
else
{
void* ptr = vector_unsigned_int_Index.Invoke(&((crnd_crn_unpacker*)@this)->field_10, 0);
void* ptr = vector_unsigned_int_Operator.Invoke(&((crnd_crn_unpacker*)@this)->m_color_selectors, 0);
if (ExceptionInfo.Current != null)
{
goto IL_048f;
@@ -88,7 +88,7 @@ internal static partial class decode_color_selectors
int num5 = 0;
while ((uint)num5 < 8u)
{
int num6 = decode.Invoke(&((crnd_crn_unpacker*)@this)->field_5, &localsPointer->field_0);
int num6 = decode.Invoke(&((crnd_crn_unpacker*)@this)->m_codec, &localsPointer->field_0);
if (ExceptionInfo.Current == null)
{
int num7 = num6;
@@ -106,7 +106,7 @@ internal static partial class decode_color_selectors
ptr2 = (byte*)ptr3 + 4;
*(int*)ptr3 = num10;
}
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->field_5);
stop_decoding.Invoke(&((crnd_crn_unpacker*)@this)->m_codec);
flag = true;
}
goto IL_0477;
@@ -12,7 +12,7 @@ internal static partial class decode_palettes
{
unchecked
{
if (crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_14.field_2) != 0)
if (crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_color_endpoints.m_num) != 0)
{
bool flag = decode_color_endpoints.Invoke(@this);
if (ExceptionInfo.Current != null)
@@ -33,7 +33,7 @@ internal static partial class decode_palettes
return false;
}
}
if (crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->field_4)->field_16.field_2) != 0)
if (crn_packed_uint_2_ToUInt32.Invoke(&((crnd_crn_header*)((crnd_crn_unpacker*)@this)->m_pHeader)->m_alpha_endpoints.m_num) != 0)
{
bool flag3 = decode_alpha_endpoints.Invoke(@this);
if (ExceptionInfo.Current != null)
@@ -26,7 +26,7 @@ internal static partial class decode_receive_static_data_model
{
if (num == 0)
{
clear_egw7ktb.Invoke(model);
clear_9udjtr.Invoke(model);
if (ExceptionInfo.Current != null)
{
return false;
@@ -35,7 +35,7 @@ internal static partial class decode_receive_static_data_model
}
else
{
bool flag2 = resize_rzzl5xd.Invoke(&((crnd_static_huffman_data_model*)model)->field_1, num);
bool flag2 = resize_zpvfc7.Invoke(&((crnd_static_huffman_data_model*)model)->m_code_sizes, num);
if (ExceptionInfo.Current != null)
{
return false;
@@ -46,12 +46,12 @@ internal static partial class decode_receive_static_data_model
}
else
{
llvm_memset_p0_i64.Invoke(vector_unsigned_char_Index_o39mi9c.Invoke(&((crnd_static_huffman_data_model*)model)->field_1, 0), 0, 1L * (long)(uint)num, isVolatile: false);
llvm_memset_p0_i64.Invoke(vector_unsigned_char_Operator_ggxbum.Invoke(&((crnd_static_huffman_data_model*)model)->m_code_sizes, 0), 0, 1L * (long)(uint)num, isVolatile: false);
int num2 = decode_bits.Invoke(@this, 5);
if ((uint)num2 >= 1u && (uint)num2 <= 21u)
{
static_huffman_data_model_Constructor_tl33idc.Invoke(&localsPointer->field_0);
bool flag3 = resize_rzzl5xd.Invoke(&localsPointer->field_0.field_1, 21);
static_huffman_data_model_Constructor_c98ih8.Invoke(&localsPointer->field_0);
bool flag3 = resize_zpvfc7.Invoke(&localsPointer->field_0.m_code_sizes, 21);
if (ExceptionInfo.Current == null)
{
if (!flag3)
@@ -67,7 +67,7 @@ internal static partial class decode_receive_static_data_model
if (ExceptionInfo.Current == null)
{
sbyte b = (sbyte)num4;
void* ptr = vector_unsigned_char_Index_o39mi9c.Invoke(&localsPointer->field_0.field_1, (byte)((sbyte*)g_most_probable_codelength_codes.__pointer)[(uint)num3]);
void* ptr = vector_unsigned_char_Operator_ggxbum.Invoke(&localsPointer->field_0.m_code_sizes, (byte)((sbyte*)g_most_probable_codelength_codes.__pointer)[(uint)num3]);
if (ExceptionInfo.Current == null)
{
*(sbyte*)ptr = b;
@@ -100,7 +100,7 @@ internal static partial class decode_receive_static_data_model
if ((uint)num8 <= 16u)
{
sbyte b2 = (sbyte)num8;
void* ptr2 = vector_unsigned_char_Index_o39mi9c.Invoke(&((crnd_static_huffman_data_model*)model)->field_1, num5++);
void* ptr2 = vector_unsigned_char_Operator_ggxbum.Invoke(&((crnd_static_huffman_data_model*)model)->m_code_sizes, num5++);
if (ExceptionInfo.Current == null)
{
*(sbyte*)ptr2 = b2;
@@ -167,7 +167,7 @@ internal static partial class decode_receive_static_data_model
{
goto IL_0339;
}
void* ptr3 = vector_unsigned_char_Index_o39mi9c.Invoke(&((crnd_static_huffman_data_model*)model)->field_1, num5 - 1);
void* ptr3 = vector_unsigned_char_Operator_ggxbum.Invoke(&((crnd_static_huffman_data_model*)model)->m_code_sizes, num5 - 1);
if (ExceptionInfo.Current == null)
{
int num16 = (byte)(*(sbyte*)ptr3);
@@ -179,7 +179,7 @@ internal static partial class decode_receive_static_data_model
while ((uint)num5 < (uint)num17)
{
sbyte b3 = (sbyte)num16;
void* ptr4 = vector_unsigned_char_Index_o39mi9c.Invoke(&((crnd_static_huffman_data_model*)model)->field_1, num5++);
void* ptr4 = vector_unsigned_char_Operator_ggxbum.Invoke(&((crnd_static_huffman_data_model*)model)->m_code_sizes, num5++);
if (ExceptionInfo.Current == null)
{
*(sbyte*)ptr4 = b3;
@@ -226,7 +226,7 @@ internal static partial class decode_receive_static_data_model
flag = false;
goto IL_0410;
IL_03bc:
crnd_assert.Invoke(String_xzkwrkb.__pointer, String_yguirrd.__pointer, 3149);
crnd_assert.Invoke(String_m5q5qr.__pointer, String_vvx8bt.__pointer, 3149);
if (ExceptionInfo.Current == null)
{
flag = false;
Loaded 100 of 235 files, more files were not shown because too many files have changed in this diff. Show more