mirror of
https://github.com/WerWolv/ImHex-Patterns.git
synced 2026-03-31 05:15:54 -05:00
Compare commits
16 Commits
ImHex-v1.3
...
ImHex-v1.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dac2e0f786 | ||
|
|
f70b7066b9 | ||
|
|
3f44a743e8 | ||
|
|
834e5261b3 | ||
|
|
0e2966f10d | ||
|
|
b2bc248447 | ||
|
|
e6589ecba1 | ||
|
|
f75ba4b6ee | ||
|
|
cf18580960 | ||
|
|
e7d1973957 | ||
|
|
35cc68544b | ||
|
|
41d8967deb | ||
|
|
658ec20b37 | ||
|
|
fb5fcbafc1 | ||
|
|
6f7988e96e | ||
|
|
0a631f0c1f |
@@ -94,12 +94,14 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
|
||||
| PYC | | [`patterns/pyc.hexpat`](patterns/pyc.hexpat) | Python bytecode files |
|
||||
| QBCL | | [`patterns/qbcl.hexpat`](patterns/qbcl.hexpat) | Qubicle voxel scene project file |
|
||||
| QOI | `image/qoi` | [`patterns/qoi.hexpat`](patterns/qoi.hexpat) | QOI image files |
|
||||
| RAS | `image/x-sun-raster` | [`patterns/ras.hexpat`](patterns/ras.hexpat) | RAS image files |
|
||||
| Shell Link | `application/x-ms-shortcut` | [`patterns/lnk.hexpat`](patterns/lnk.hexpat) | Windows Shell Link file format |
|
||||
| shp | | [`patterns/shp.hexpat`](patterns/shp.hexpat) | ESRI shape file |
|
||||
| shx | | [`patterns/shx.hexpat`](patterns/shx.hexpat) | ESRI index file |
|
||||
| SPIRV | | [`patterns/spirv.hexpat`](patterns/spirv.hexpat) | SPIR-V header and instructions |
|
||||
| STL | `model/stl` | [`patterns/stl.hexpat`](patterns/stl.hexpat) | STL 3D Model format |
|
||||
| StuffItV5 | `application/x-stuffit` | [`patterns/sit5.hexpat`](patterns/sit5.hexpat) | StuffIt V5 archive |
|
||||
| SWF | |[`patterns/swf.hexpat`](patterns/swf.hexpat) | Shockwave Flash file format |
|
||||
| TAR | `application/x-tar` | [`patterns/tar.hexpat`](patterns/tar.hexpat) | Tar file format |
|
||||
| TIFF | `image/tiff` | [`patterns/tiff.hexpat`](patterns/tiff.hexpat) | Tag Image File Format |
|
||||
| TGA | `image/tga` | [`patterns/tga.hexpat`](patterns/tga.hexpat) | Truevision TGA/TARGA image |
|
||||
@@ -115,6 +117,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
|
||||
| XBEH | `audio/x-xbox-executable` | [`patterns/xbeh.hexpat`](patterns/xbeh.hexpat) | Xbox executable |
|
||||
| XCI | | [`patterns/xci.hexpat`](patterns/xci.hexpat) | Nintendo Switch XCI cardridge ROM |
|
||||
| Xilinx BIT | | [`patterns/xilinx_bit.hexpat`](patterns/xilinx_bit.hexpat) | Xilinx FPGA Bitstreams |
|
||||
| Xilinx Bootgen | | [`patterns/xilinx_bootgen.hexpat`](patterns/xilinx_bootgen.hexpat) | Xilinx ZynqMP Boot Images |
|
||||
| ZIP | `application/zip` | [`patterns/zip.hexpat`](patterns/zip.hexpat) | End of Central Directory Header, Central Directory File Headers |
|
||||
| ZLIB | `application/zlib` | [`patterns/zlib.hexpat`](patterns/zlib.hexpat) | ZLIB compressed data format |
|
||||
| ZSTD | `application/zstd` | [`patterns/zstd.hexpat`](patterns/zstd.hexpat) | Zstandard compressed data format |
|
||||
@@ -167,6 +170,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
|
||||
| ASCII+OEM | [`encodings/ascii_oem.tbl`](encodings/ascii_oem.tbl) | ASCII encoding with Windows OEM characters |
|
||||
| Baltic ISO | [`encodings/baltic_iso.tbl`](encodings/baltic_iso.tbl) | Baltic ISO encoding |
|
||||
| Baltic Windows | [`encodings/baltic_windows.tbl`](encodings/baltic_windows.tbl) | Baltic Windows encoding |
|
||||
| Big5 (Traditional Chinese) | [`encodings/big5.tbl`](encodings/big5.tbl) | Big5 encoding for Traditional Chinese |
|
||||
| Cyrillic ISO | [`encodings/cyrillic_iso.tbl`](encodings/cyrillic_iso.tbl) | Cyrillic ISO encoding |
|
||||
| Cyrillic Windows | [`encodings/cyrillic_windows.tbl`](encodings/cyrillic_windows.tbl) | Cyrillic Windows encoding |
|
||||
| Cyrillic KOI8-R | [`encodings/cyrillic_koi8_r.tbl`](encodings/cyrillic_koi8_r.tbl) | Cyrillic KOI8-R encoding (Russian Characters) |
|
||||
@@ -194,6 +198,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
|
||||
| Turkish Windows | [`encodings/turkish_windows.tbl`](encodings/turkish_windows.tbl) | Turkish Windows encoding |
|
||||
| UTF-8 | [`encodings/utf8.tbl`](encodings/utf8.tbl) | UTF-8 encoding |
|
||||
| Vietnamese | [`encodings/vietnamese.tbl`](encodings/vietnamese.tbl) | Vietnamese character encoding |
|
||||
> import custom encoding from File -> Import... -> Custome Encoding File
|
||||
|
||||
### Data Processor Nodes
|
||||
| Name | Path | Description |
|
||||
|
||||
18594
encodings/big5.tbl
Normal file
18594
encodings/big5.tbl
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/impl/imhex_check.pat>
|
||||
import hex.impl.imhex_check;
|
||||
|
||||
/*!
|
||||
Core intrinsic functions to interact with the ImHex Hex Editor
|
||||
*/
|
||||
|
||||
namespace hex::core {
|
||||
namespace auto hex::core {
|
||||
|
||||
/**
|
||||
A type representing a selection in the hex editor
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/impl/imhex_check.pat>
|
||||
import hex.impl.imhex_check;
|
||||
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
Library to allow decoding of more complex values
|
||||
*/
|
||||
|
||||
namespace hex::dec {
|
||||
namespace auto hex::dec {
|
||||
|
||||
/**
|
||||
Demangles a mangled name into a human readable name
|
||||
@@ -17,4 +19,46 @@ namespace hex::dec {
|
||||
return builtin::hex::dec::demangle(mangled_name);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Decompresses the bytes of a pattern into a section using the zlib algorithm
|
||||
@param pattern The pattern whose bytes should be decompressed
|
||||
@param section The section to decompress the data into
|
||||
@param window_size The window size passed to zlib
|
||||
@return true if successful, false otherwise
|
||||
*/
|
||||
fn zlib_decompress(ref auto pattern, std::mem::Section section, u64 window_size = 0) {
|
||||
return builtin::hex::dec::zlib_decompress(pattern, section, window_size);
|
||||
};
|
||||
|
||||
/**
|
||||
Decompresses the bytes of a pattern into a section using the bzip algorithm
|
||||
@param pattern The pattern whose bytes should be decompressed
|
||||
@param section The section to decompress the data into
|
||||
@return true if successful, false otherwise
|
||||
*/
|
||||
fn bzip_decompress(ref auto pattern, std::mem::Section section) {
|
||||
return builtin::hex::dec::bzip_decompress(pattern, section);
|
||||
};
|
||||
|
||||
/**
|
||||
Decompresses the bytes of a pattern into a section using the LZMA algorithm
|
||||
@param pattern The pattern whose bytes should be decompressed
|
||||
@param section The section to decompress the data into
|
||||
@return true if successful, false otherwise
|
||||
*/
|
||||
fn lzma_decompress(ref auto pattern, std::mem::Section section) {
|
||||
return builtin::hex::dec::lzma_decompress(pattern, section);
|
||||
};
|
||||
|
||||
/**
|
||||
Decompresses the bytes of a pattern into a section using the zstd algorithm
|
||||
@param pattern The pattern whose bytes should be decompressed
|
||||
@param section The section to decompress the data into
|
||||
@return true if successful, false otherwise
|
||||
*/
|
||||
fn zstd_decompress(ref auto pattern, std::mem::Section section) {
|
||||
return builtin::hex::dec::zstd_decompress(pattern, section);
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/impl/imhex_check.pat>
|
||||
import hex.impl.imhex_check;
|
||||
|
||||
/*!
|
||||
Library to do HTTP requests
|
||||
*/
|
||||
|
||||
namespace hex::http {
|
||||
namespace auto hex::http {
|
||||
|
||||
/**
|
||||
Performs a HTTP GET request to the given URL and returns the response body
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <hex/impl/imhex_check.pat>
|
||||
import hex.impl.imhex_check;
|
||||
|
||||
/*!
|
||||
Library to interact with the currently loaded provider.
|
||||
*/
|
||||
|
||||
namespace hex::prv {
|
||||
namespace auto hex::prv {
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
|
||||
#include <hex/impl/imhex_check.pat>
|
||||
#include <hex/dec.pat>
|
||||
import hex.impl.imhex_check;
|
||||
import hex.dec;
|
||||
|
||||
/*!
|
||||
Types to automatically decode mangled names
|
||||
*/
|
||||
|
||||
namespace hex::type {
|
||||
namespace auto hex::type {
|
||||
|
||||
/**
|
||||
A mangled name string that gets demangled when displayed
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/sys.pat>
|
||||
import std.sys;
|
||||
|
||||
/*!
|
||||
The array library contains a helper type to make it easier to create multi-dimensional arrays
|
||||
and pass arrays to functions as parameters.
|
||||
*/
|
||||
|
||||
namespace std {
|
||||
namespace auto std {
|
||||
|
||||
/**
|
||||
Simple one dimensional array wrapper
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/limits.pat>
|
||||
import std.limits;
|
||||
|
||||
/*!
|
||||
This library contains various helper functions for common bit operations.
|
||||
*/
|
||||
|
||||
namespace std::bit {
|
||||
namespace auto std::bit {
|
||||
|
||||
/**
|
||||
Calculates the number of 1 bits in a given number
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
The core library contains intrinsics and "compiler magic" functions that
|
||||
get extra help from the runtime to fulfill their purpose.
|
||||
*/
|
||||
|
||||
namespace std::core {
|
||||
namespace auto std::core {
|
||||
|
||||
/**
|
||||
The layout order of each field after byte-endianness has been handled.
|
||||
@@ -146,4 +146,14 @@ namespace std::core {
|
||||
fn set_display_name(ref auto pattern, str name) {
|
||||
builtin::std::core::set_display_name(pattern, name);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
Changes the comment attached to a pattern
|
||||
@param pattern The pattern to modify
|
||||
@param name The new comment of the pattern
|
||||
*/
|
||||
fn set_pattern_comment(ref auto pattern, str comment) {
|
||||
builtin::std::core::set_pattern_comment(pattern, name);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
of ASCII characters.
|
||||
*/
|
||||
|
||||
namespace std::ctype {
|
||||
namespace auto std::ctype {
|
||||
|
||||
/**
|
||||
Checks if the given character `c` is a digit between '0' and '9'
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
**These functions are considered dangerous and require the user to manually permit them**
|
||||
*/
|
||||
|
||||
namespace std::file {
|
||||
namespace auto std::file {
|
||||
|
||||
/**
|
||||
A handle representing a file that has been opened
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Library for doing arithmetic with fixed point numbers and converting them from/to floating point numbers.
|
||||
*/
|
||||
|
||||
namespace std::fxpt {
|
||||
namespace auto std::fxpt {
|
||||
|
||||
/**
|
||||
A fixed point value
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
The hash library contains various data hash functions
|
||||
*/
|
||||
|
||||
namespace std::hash {
|
||||
namespace auto std::hash {
|
||||
|
||||
/**
|
||||
Calculates the CRC32 hash of the bytes inside of a given pattern
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
The IO library allows formatting strings and outputting text to the console
|
||||
*/
|
||||
|
||||
namespace std {
|
||||
namespace auto std {
|
||||
|
||||
/**
|
||||
Formats the given arguments using the format string and prints the result to the console
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
Library to calculate the minimum and maximum values that fit into a given data type
|
||||
*/
|
||||
|
||||
namespace std::limits {
|
||||
namespace auto std::limits {
|
||||
|
||||
/**
|
||||
Returns the minimum value that can be stored in a `u8`.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
Library containing more advanced mathematical operations.
|
||||
*/
|
||||
|
||||
namespace std::math {
|
||||
namespace auto std::math {
|
||||
|
||||
/**
|
||||
Compares the values `a` and `b` with each other and returns the smaller of the two
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
/*!
|
||||
Library for doing raw memory accesses and other low-level operations.
|
||||
*/
|
||||
|
||||
namespace std::mem {
|
||||
namespace auto std::mem {
|
||||
|
||||
namespace impl {
|
||||
|
||||
@@ -128,7 +126,7 @@ namespace std::mem {
|
||||
@param size The size of the value to read
|
||||
@return The value read
|
||||
*/
|
||||
fn read_string(u128 address, u8 size) {
|
||||
fn read_string(u128 address, u128 size) {
|
||||
return builtin::std::mem::read_string(address, size);
|
||||
};
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
The Pointer library contains helper functions to deal with pointer types.
|
||||
The `relative_to` functions are meant to be used with the `[[pointer_base]]` attribute
|
||||
*/
|
||||
|
||||
namespace std::ptr {
|
||||
namespace auto std::ptr {
|
||||
|
||||
/**
|
||||
Use the offset of the current pointer as start address
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/limits.pat>
|
||||
import std.limits;
|
||||
|
||||
/*!
|
||||
Library to generate random numbers. Supports various different distribution types.
|
||||
*/
|
||||
|
||||
namespace std::random {
|
||||
namespace auto std::random {
|
||||
|
||||
/**
|
||||
Represents the type of distribution to use to generate a random number
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Libray to interact with strings.
|
||||
*/
|
||||
|
||||
namespace std::string {
|
||||
namespace auto std::string {
|
||||
|
||||
/**
|
||||
Base type for sized strings. Represents a string with its size preceeding it.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Basic helper functions
|
||||
*/
|
||||
|
||||
namespace std {
|
||||
namespace auto std {
|
||||
|
||||
/**
|
||||
Asserts that a given value is true. If it's not, abort evaluation and print the given message to the console
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Library to handle time and date related operations.
|
||||
*/
|
||||
|
||||
namespace std::time {
|
||||
namespace auto std::time {
|
||||
|
||||
/**
|
||||
A structured representation of a time and date.
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/math.pat>
|
||||
import std.io;
|
||||
import std.math;
|
||||
|
||||
/*!
|
||||
Types used to change the base of the displayed integer value.
|
||||
Used like `type::Hex<u32> hexNumber;`, `type::Oct<u16> octalNumber;`
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Integer type representing a Hexadecimal value. Displays its value in hexadecimal format.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include <std/io.pat>
|
||||
#include <std/string.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.io;
|
||||
import std.string;
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
Type representing a Base64 encoded string
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Type representing a Base64 encoded string
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Type to decode a BCD (Binary Coded Decimal) number
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Decodes a BCD value where one byte represents a single digit
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Types to display single bytes using various different representations
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Type visualizing the value of each individual bit
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/core.pat>
|
||||
import std.io;
|
||||
import std.core;
|
||||
|
||||
/*!
|
||||
Types representing RGB or RGBA colors. The decoded color will be displayed in their color field
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Type representing a generic RGBA color with a variable number of bits for each color
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/math.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.io;
|
||||
import std.math;
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
Type representing a 16 bit half precision floating point number
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Type representing a 16 bit half precision floating point number
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Types to deal with UUIDs (Universally Unique Identifiers) / GUIDs (Globally Unique Identifiers) as described in RFC 4122
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Type representing a GUID value
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/string.pat>
|
||||
import std.io;
|
||||
import std.string;
|
||||
|
||||
/*!
|
||||
Types used to decode IP addresses
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
A 4 byte IPv4 Address as described in RFC 791
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
Types used to decode Little Endian Base 128 numbers used to store large numbers as space efficiently as possible
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Base LEB128 type. Use `uLEB128` and `sLEB128` instead.
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Types used to decode MAC Addresses
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
A MAC Address as used in the Internet Protocol
|
||||
|
||||
@@ -1,38 +1,43 @@
|
||||
#include <std/string.pat>
|
||||
#include <std/sys.pat>
|
||||
#include <std/io.pat>
|
||||
#include <std/ctype.pat>
|
||||
import std.string;
|
||||
import std.sys;
|
||||
import std.io;
|
||||
import std.ctype;
|
||||
|
||||
/*!
|
||||
Types used to parse and enforce specific magic numbers
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type
|
||||
{
|
||||
fn fm(ref auto value)
|
||||
{
|
||||
str result;
|
||||
for (u32 i = 0, i < sizeof(value), i += 1)
|
||||
{
|
||||
char c = value[i];
|
||||
|
||||
if (std::ctype::isprint(c))
|
||||
result += c;
|
||||
else
|
||||
result += std::format("\\x{:02X}", u8(c));
|
||||
}
|
||||
return std::format("\"{}\"", result);
|
||||
};
|
||||
|
||||
/**
|
||||
A Magic number. Throws an error if the magic number does not match the expected value
|
||||
@tparam ExpectedValue A string representing the expected value
|
||||
*/
|
||||
struct Magic<auto ExpectedValue> {
|
||||
struct Magic<auto ExpectedValue>
|
||||
{
|
||||
char value[std::string::length(ExpectedValue)];
|
||||
std::assert(value == ExpectedValue, std::format("Invalid magic value! Expected \"{}\", got \"{}\".", ExpectedValue, value));
|
||||
std::assert_warn(value == ExpectedValue, std::format("Invalid magic value! Expected {}, got {} at position 0x{:X}", type::fm(ExpectedValue), type::fm(value), $ - std::string::length(ExpectedValue)));
|
||||
} [[sealed, format("type::impl::format_magic")]];
|
||||
|
||||
namespace impl {
|
||||
|
||||
fn format_magic(ref auto magic) {
|
||||
str result;
|
||||
for (u32 i = 0, i < sizeof(magic.value), i += 1) {
|
||||
char c = magic.value[i];
|
||||
|
||||
if (std::ctype::isprint(c))
|
||||
result += c;
|
||||
else
|
||||
result += std::format("\\x{:02X}", u8(c));
|
||||
}
|
||||
return std::format("\"{}\"", result);
|
||||
namespace impl
|
||||
{
|
||||
fn format_magic(ref auto magic)
|
||||
{
|
||||
return fm(magic.value);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
/*!
|
||||
Types dealing with various kinds of resource paths
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
Type representing a single path segment. Use the `Path` type instead of using this on its own
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
/*!
|
||||
Types used to pretty print size values
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
A generic size type which displays its value in Bytes (or kiB, MiB, GiB, TiB, PiB, EiB if larger)
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/time.pat>
|
||||
import std.io;
|
||||
import std.time;
|
||||
|
||||
/*!
|
||||
Types used to decode various different time formats
|
||||
*/
|
||||
|
||||
namespace type {
|
||||
namespace auto type {
|
||||
|
||||
/**
|
||||
A 32 bit Unix time value
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
// Explicitly don't add these types to the `type` namespace for usability
|
||||
// namespace type {
|
||||
// namespace auto type {
|
||||
|
||||
// using char = s8;
|
||||
using byte = s8;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
// Explicitly don't add these types to the `type` namespace for usability
|
||||
// namespace type {
|
||||
// namespace auto type {
|
||||
|
||||
using uint8_t = u8;
|
||||
using uint16_t = u16;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
// Explicitly don't add these types to the `type` namespace for usability
|
||||
// namespace type {
|
||||
// namespace auto type {
|
||||
|
||||
using le16 = le u16;
|
||||
using be16 = be u16;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
// Explicitly don't add these types to the `type` namespace for usability
|
||||
// namespace type {
|
||||
// namespace auto type {
|
||||
|
||||
// using u8 = u8;
|
||||
// using u16 = u16;
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
// Explicitly don't add these types to the `type` namespace for usability
|
||||
// namespace type {
|
||||
// namespace auto type {
|
||||
|
||||
using BYTE = u8;
|
||||
using WORD = u16;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Autodesk 3DS Max Model file
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <type/base.pat>
|
||||
import std.io;
|
||||
import type.base;
|
||||
|
||||
#pragma MIME image/x-3ds
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma description 7z File Format
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/math.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
import std.math;
|
||||
|
||||
|
||||
enum Type:u8{
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
#pragma description Crash Bandicoot - Back in Time (fan game) User created level format
|
||||
// Supports all versions till 0.94c, newer versions might be compatible!
|
||||
|
||||
#include <type/magic.pat>
|
||||
#include <std/string.pat>
|
||||
#include <std/array.pat>
|
||||
import type.magic;
|
||||
import std.string;
|
||||
import std.array;
|
||||
|
||||
|
||||
struct Header {
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma endian little
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/sys.pat>
|
||||
import std.io;
|
||||
import std.sys;
|
||||
|
||||
#define ATMOSPHERE_REBOOT_TO_FATAL_MAGIC "AFE2"
|
||||
#define ATMOSPHERE_REBOOT_TO_FATAL_MAGIC_1 "AFE1"
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#pragma MIME application/x-archive
|
||||
|
||||
#include <std/string.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/sys.pat>
|
||||
import std.string;
|
||||
import std.mem;
|
||||
import std.sys;
|
||||
|
||||
struct ARFile {
|
||||
char file_name[16];
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma endian little
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
|
||||
#define VTOR 0x00000000
|
||||
#define EXTERNAL_INTERRUPT_COUNT 64
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#pragma MIME application/x-bittorrent
|
||||
|
||||
#include <std/ctype.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/string.pat>
|
||||
import std.ctype;
|
||||
import std.mem;
|
||||
import std.string;
|
||||
|
||||
namespace bencode {
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma MIME image/bmp
|
||||
#pragma endian little
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
struct BitmapFileHeader {
|
||||
u8 bfType[2];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <std/math.pat>
|
||||
#include <std/core.pat>
|
||||
#include <type/magic.pat>
|
||||
#include <type/time.pat>
|
||||
import std.math;
|
||||
import std.core;
|
||||
import type.magic;
|
||||
import type.time;
|
||||
|
||||
using CFBinaryPlistObject;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma MIME application/bson
|
||||
|
||||
#include <std/mem.pat>
|
||||
#include <type/time.pat>
|
||||
import std.mem;
|
||||
import type.time;
|
||||
|
||||
enum Type : u8 {
|
||||
Double = 0x01,
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma description GoldSrc engine maps format (used in Half-Life 1)
|
||||
|
||||
#include <std/ptr.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/sys.pat>
|
||||
import std.ptr;
|
||||
import std.mem;
|
||||
import std.sys;
|
||||
|
||||
#pragma endian little
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Windows HtmlHelp Data (ITSF / CHM)
|
||||
|
||||
#include <type/magic.pat>
|
||||
#include <type/size.pat>
|
||||
#include <type/guid.pat>
|
||||
#include <type/leb128.pat>
|
||||
#include <std/sys.pat>
|
||||
import type.magic;
|
||||
import type.size;
|
||||
import type.guid;
|
||||
import type.leb128;
|
||||
import std.sys;
|
||||
|
||||
enum WindowsLanguageId : u32 {
|
||||
Arabic_SaudiArabia = 0x401,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma MIME application/x-coff
|
||||
|
||||
#include <type/time.pat>
|
||||
#include <type/size.pat>
|
||||
import type.time;
|
||||
import type.size;
|
||||
|
||||
enum Machine : u16 {
|
||||
Unknown = 0x0000,
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Old Binary CPIO Format
|
||||
|
||||
#include <type/base.pat>
|
||||
import type.base;
|
||||
|
||||
#include <std/time.pat>
|
||||
#include <std/core.pat>
|
||||
#include <std/sys.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.time;
|
||||
import std.core;
|
||||
import std.sys;
|
||||
import std.mem;
|
||||
|
||||
#pragma MIME application/x-cpio
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma description Dalvik EXecutable Format
|
||||
|
||||
#include <type/leb128.pat>
|
||||
import type.leb128;
|
||||
|
||||
struct header_item {
|
||||
u8 magic[8];
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
#pragma MIME application/dicom
|
||||
#pragma endian little
|
||||
|
||||
#include <std/core.pat>
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/string.pat>
|
||||
#include <std/sys.pat>
|
||||
#include <type/magic.pat>
|
||||
import std.core;
|
||||
import std.io;
|
||||
import std.mem;
|
||||
import std.string;
|
||||
import std.sys;
|
||||
import type.magic;
|
||||
|
||||
u32 UNDEFINED_LENGTH = 0xffffffff;
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#pragma endian big
|
||||
|
||||
#include <type/magic.pat>
|
||||
#include <type/size.pat>
|
||||
#include <type/guid.pat>
|
||||
#include <std/mem.pat>
|
||||
import type.magic;
|
||||
import type.size;
|
||||
import type.guid;
|
||||
import std.mem;
|
||||
|
||||
// Parse DMG Structure per http://newosxbook.com/DMG.html
|
||||
//
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
// Apple macOS .DS_Store format
|
||||
#pragma endian big
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
struct RecordEntry {
|
||||
u32 length;
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
#pragma MIME application/x-object
|
||||
#pragma MIME application/x-sharedlib
|
||||
|
||||
#include <std/core.pat>
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.core;
|
||||
import std.io;
|
||||
import std.mem;
|
||||
|
||||
using BitfieldOrder = std::core::BitfieldOrder;
|
||||
|
||||
|
||||
@@ -3,12 +3,12 @@
|
||||
|
||||
#pragma endian big
|
||||
|
||||
#include <std/sys.pat>
|
||||
#include <std/io.pat>
|
||||
#include <std/core.pat>
|
||||
import std.sys;
|
||||
import std.io;
|
||||
import std.core;
|
||||
|
||||
#include <type/magic.pat>
|
||||
#include <type/size.pat>
|
||||
import type.magic;
|
||||
import type.size;
|
||||
|
||||
// These are used in order for the children to be able to find strings
|
||||
u64 fdt_addr;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Free Lossless Audio Codec, FLAC Audio Format
|
||||
|
||||
#include <std/sys.pat>
|
||||
#include <std/core.pat>
|
||||
#include <std/io.pat>
|
||||
import std.sys;
|
||||
import std.core;
|
||||
import std.io;
|
||||
|
||||
#pragma endian big
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Drive File System
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
struct DiskTimeStamp {
|
||||
u8 seconds, minutes, hours;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#pragma MIME application/x-gameboy-rom
|
||||
|
||||
#include <type/size.pat>
|
||||
#include <std/string.pat>
|
||||
#include <std/mem.pat>
|
||||
import type.size;
|
||||
import std.string;
|
||||
import std.mem;
|
||||
|
||||
bool uppercaseROMFeatures in;
|
||||
bool brandedROMFeatures in;
|
||||
|
||||
@@ -13,13 +13,13 @@
|
||||
#define EXTENSION_INTRODUCER_MAGIC 0x21
|
||||
#define GIF_TRAILER_MAGIC 0x3B
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/core.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/string.pat>
|
||||
#include <std/math.pat>
|
||||
import std.io;
|
||||
import std.core;
|
||||
import std.mem;
|
||||
import std.string;
|
||||
import std.math;
|
||||
|
||||
#include <type/magic.pat>
|
||||
import type.magic;
|
||||
|
||||
bitfield GCT_Flags {
|
||||
size : 3 [[comment("physical size = 2^(flags.size + 1)")]];
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include <std/mem.pat>
|
||||
#include <std/io.pat>
|
||||
import std.mem;
|
||||
import std.io;
|
||||
|
||||
/**
|
||||
* @brief The glTF magic section.
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
#pragma MIME application/gzip
|
||||
|
||||
#include <type/time.pat>
|
||||
#include <type/size.pat>
|
||||
#include <std/core.pat>
|
||||
#include <std/mem.pat>
|
||||
import type.time;
|
||||
import type.size;
|
||||
import std.core;
|
||||
import std.mem;
|
||||
|
||||
using BitfieldOrder = std::core::BitfieldOrder;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <std/mem.pat>
|
||||
#include <std/io.pat>
|
||||
#include <std/string.pat>
|
||||
import std.mem;
|
||||
import std.io;
|
||||
import std.string;
|
||||
|
||||
struct Header {
|
||||
u32 magic;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma author Surasia
|
||||
#pragma description Halo Infinite HavokScript 5.1 "luas" file
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/core.pat>
|
||||
#include <std/string.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
import std.core;
|
||||
import std.string;
|
||||
|
||||
struct String32 {
|
||||
s32 length;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma endian little
|
||||
|
||||
#include <std/sys.pat>
|
||||
import std.sys;
|
||||
|
||||
#pragma MIME image/vnd.microsoft.icon
|
||||
#pragma MIME image/x-icon
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma MIME audio/mpeg
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
namespace v1 {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
*/
|
||||
#pragma endian big
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
enum FileType: u16 {
|
||||
Data = 0x3030,
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma endian big
|
||||
|
||||
#include <std/sys.pat>
|
||||
#include <std/io.pat>
|
||||
import std.sys;
|
||||
import std.io;
|
||||
|
||||
struct MAC {
|
||||
u8 octets[6];
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma endian big
|
||||
|
||||
#include <std/mem.pat>
|
||||
#include <std/string.pat>
|
||||
import std.mem;
|
||||
import std.string;
|
||||
|
||||
struct Hunk {
|
||||
u24 offset;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#pragma endian little
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
enum VolumeDescriptorTypes : u8 {
|
||||
BootRecord,
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
#pragma pattern_limit 100000000
|
||||
#pragma MIME application/x-java-applet
|
||||
|
||||
#include <std/string.pat>
|
||||
#include <std/math.pat>
|
||||
#include <std/core.pat>
|
||||
#include <std/io.pat>
|
||||
#include <std/sys.pat>
|
||||
import std.string;
|
||||
import std.math;
|
||||
import std.core;
|
||||
import std.io;
|
||||
import std.sys;
|
||||
|
||||
using BitfieldOrder = std::core::BitfieldOrder;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description JPEG Image Format
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <type/magic.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
import type.magic;
|
||||
#pragma endian big
|
||||
|
||||
#pragma MIME image/jpeg
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#pragma MIME application/x-ms-shortcut
|
||||
|
||||
#include <std/core.pat>
|
||||
#include <type/guid.pat>
|
||||
#include <type/size.pat>
|
||||
import std.core;
|
||||
import type.guid;
|
||||
import type.size;
|
||||
|
||||
using BitfieldOrder = std::core::BitfieldOrder;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma description Lua 5.4 bytecode
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
|
||||
namespace impl {
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma MIME application/x-mach-binary
|
||||
|
||||
#include <type/size.pat>
|
||||
import type.size;
|
||||
|
||||
enum Magic : u32 {
|
||||
_32BitMagic = 0xFEEDFACE,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma description Mechanized Assault and Exploration v1.04 (strategy game) save file format
|
||||
|
||||
#include <std/sys.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.sys;
|
||||
import std.mem;
|
||||
|
||||
#pragma array_limit 12544
|
||||
#pragma pattern_limit 2000000
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma description MIDI header, event fields provided
|
||||
|
||||
#include <std/core.pat>
|
||||
import std.core;
|
||||
|
||||
#pragma MIME audio/midi
|
||||
#pragma endian big
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
#pragma MIME application/x-dmp
|
||||
|
||||
#include <type/time.pat>
|
||||
#include <type/types/win32.pat>
|
||||
#include <type/size.pat>
|
||||
import type.time;
|
||||
import type.types.win32;
|
||||
import type.size;
|
||||
|
||||
using RVA = ULONG32;
|
||||
using RVA64 = ULONG64;
|
||||
|
||||
@@ -6,9 +6,9 @@
|
||||
#pragma MIME video/mp4
|
||||
#pragma MIME application/mp4
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/mem.pat>
|
||||
#include <std/string.pat>
|
||||
import std.io;
|
||||
import std.mem;
|
||||
import std.string;
|
||||
|
||||
fn to_string(auto var) {
|
||||
return str(var);
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma endian little
|
||||
|
||||
#include <std/sys.pat>
|
||||
#include <std/io.pat>
|
||||
import std.sys;
|
||||
import std.io;
|
||||
|
||||
struct ApplicationTitle {
|
||||
char name[0x200];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Minecraft NBT format
|
||||
|
||||
#include <std/sys.pat>
|
||||
import std.sys;
|
||||
|
||||
#pragma endian big
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma description NE header and Standard NE fields
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
struct DOSHeader {
|
||||
char signature[2];
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma author gmestanley
|
||||
#pragma description .nes file format
|
||||
|
||||
#include <std/mem.pat>
|
||||
#include <std/string.pat>
|
||||
import std.mem;
|
||||
import std.string;
|
||||
|
||||
bitfield iNES07Flags {
|
||||
mirroringIsVertical : 1;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Nintendo Switch NRO files
|
||||
|
||||
#include <std/io.pat>
|
||||
#include <std/sys.pat>
|
||||
import std.io;
|
||||
import std.sys;
|
||||
|
||||
struct MOD0 {
|
||||
char magic[4];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description NTAG213/NTAG215/NTAG216, NFC Forum Type 2 Tag compliant IC
|
||||
|
||||
#include <std/core.pat>
|
||||
import std.core;
|
||||
|
||||
using BitfieldOrder = std::core::BitfieldOrder;
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#pragma MIME audio/ogg
|
||||
|
||||
#include <std/core.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.core;
|
||||
import std.mem;
|
||||
|
||||
bitfield HeaderType {
|
||||
Continuation : 1;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
//
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include <std/mem.pat>
|
||||
#include <type/magic.pat>
|
||||
import std.mem;
|
||||
import type.magic;
|
||||
|
||||
#pragma endian big
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#pragma description pcap header and packets
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
#pragma MIME application/vnd.tcpdump.pcap
|
||||
|
||||
enum network_type : u32 {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#pragma MIME application/x-pcx
|
||||
|
||||
#include <std/io.pat>
|
||||
import std.io;
|
||||
|
||||
enum Encoding : u8 {
|
||||
NoEncoding = 0x00,
|
||||
|
||||
@@ -3,11 +3,12 @@
|
||||
|
||||
#pragma MIME application/x-dosexec
|
||||
#pragma MIME application/x-msdownload
|
||||
#pragma MIME application/vnd.microsoft.portable-executable
|
||||
|
||||
#include <std/core.pat>
|
||||
#include <std/string.pat>
|
||||
#include <type/guid.pat>
|
||||
#include <type/time.pat>
|
||||
import std.core;
|
||||
import std.string;
|
||||
import type.guid;
|
||||
import type.time;
|
||||
|
||||
struct DOSHeader {
|
||||
char signature[2] [[hex::spec_name("e_magic")]];
|
||||
@@ -921,7 +922,7 @@ bitfield BaseRelocationWord {
|
||||
struct BaseRelocationBlock {
|
||||
u32 pageRVA;
|
||||
u32 blockSize;
|
||||
BaseRelocationWord word;
|
||||
BaseRelocationWord word[while($ < addressof(this) + this.blockSize)] [[inline]];
|
||||
};
|
||||
|
||||
struct BaseRelocationTable {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Nintendo Switch PFS0 archive (NSP files)
|
||||
|
||||
#include <type/magic.pat>
|
||||
#include <type/size.pat>
|
||||
import type.magic;
|
||||
import type.size;
|
||||
|
||||
#include <std/core.pat>
|
||||
import std.core;
|
||||
|
||||
struct FileEntry {
|
||||
u64 dataOffset;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#pragma MIME image/png
|
||||
#pragma endian big
|
||||
|
||||
#include <std/mem.pat>
|
||||
import std.mem;
|
||||
|
||||
struct header_t {
|
||||
u8 highBitByte;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
#pragma author WerWolv
|
||||
#pragma description Google Protobuf encoding
|
||||
|
||||
#include <std/core.pat>
|
||||
#include <std/mem.pat>
|
||||
import std.core;
|
||||
import std.mem;
|
||||
|
||||
#include <type/leb128.pat>
|
||||
import type.leb128;
|
||||
|
||||
struct ZigZag32 {
|
||||
u32 value;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#pragma description Python bytecode files
|
||||
|
||||
#include <type/time.pat>
|
||||
#include <std/mem.pat>
|
||||
import type.time;
|
||||
import std.mem;
|
||||
|
||||
#define FLAG_REF 0x80
|
||||
#define TYPE_NULL '0'
|
||||
@@ -48,10 +48,6 @@ fn below(u8 major, u8 minor) {
|
||||
return _major <=major && _minor < minor;
|
||||
};
|
||||
|
||||
fn is(u8 major, u8 minor) {
|
||||
return _major == major && _minor == minor;
|
||||
};
|
||||
|
||||
fn between(u8 major, u8 minor, u8 otherMajor, u8 otherMinor) {
|
||||
return above(major, minor) && below(otherMajor, otherMinor);
|
||||
};
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user