chore: spell the product name CrackProof

Match the capitalization the research documentation uses, in comments,
messages, tests, and the web app. Lowercase identifiers and URLs are
unchanged.
This commit is contained in:
Momoko-Ayase committed 2026-11-07 17:02:48 +08:00
1 parent 7fde1809c7
commit 4d211166bf
21 files changed
+69 -69

No files matched your search

+1 -1
View File
@@ -6,7 +6,7 @@ body:
- type: markdown
attributes:
value: |
For a new Crackproof layout, attaching a sample protected file helps
For a new CrackProof layout, attaching a sample protected file helps
us better understand the request. Please only attach files you are
authorized to share.
- type: textarea
+1 -1
View File
@@ -146,7 +146,7 @@ target/
.ionide
### senbei test corpus ###
# The samples folder holds local-only Crackproof binaries; only its README is
# The samples folder holds local-only CrackProof binaries; only its README is
# tracked. Ignore the folder's contents (not the folder itself, or git won't
# descend into it to find the re-included README). See senbei/samples/README.md.
/samples/*
+2 -2
View File
@@ -2,7 +2,7 @@
A static unpacker for CrackProof-protected Windows PE files and Android AArch64 shared libraries.
> _"Crackproof"? It's senbei (煎餅 — rice cracker). Cracks itself._
> _"CrackProof"? It's senbei (煎餅 — rice cracker). Cracks itself._
## Usage
@@ -26,7 +26,7 @@ Full documentation: <https://xn--ri8h.gitbook.io/crackproof-research/senbei>
- Senbei does not bypass any access control for you: it performs a purely static transformation of a file already on your disk. It derives everything it needs from the input file itself, contains no vendor code, and distributes no cracks or copyrighted content. (One Android packaging variant's embedded metadata layer is unwrapped with an XOR keystream recovered from a ciphertext/plaintext pair during analysis of a single build; that keystream is research output shipped with the unpacker, not a vendor-distributed key, and builds it doesn't match are left alone.)
- Senbei does not enable online play, license fraud, or cheating, and must not be used to redistribute decrypted binaries. Do not upload outputs anywhere.
- The authors provide this software "as is", without warranty of any kind, and accept no liability for misuse. See [LICENSE](LICENSE) (AGPL-3.0).
- "Crackproof" is a trademark of its respective owner; this project is not affiliated with or endorsed by the protection vendor or any software publisher. Names are used for identification only.
- "CrackProof" is a trademark of its respective owner; this project is not affiliated with or endorsed by the protection vendor or any software publisher. Names are used for identification only.
## License
+1 -1
View File
@@ -1,6 +1,6 @@
#![no_main]
//! Crackproof PE detection over bounded, attacker-shaped bytes.
//! CrackProof PE detection over bounded, attacker-shaped bytes.
//!
//! Ceilings: input is capped by the harness (`-max_len`, see run.sh) and the
//! detector itself reads only fixed header offsets. This target asserts the
+1 -1
View File
@@ -433,7 +433,7 @@ fn print_help() {
);
println!(
" <file|folder>\n\
\x20 a Crackproof PE (.exe/.dll), an il2cpp global-metadata.dat,\n\
\x20 a CrackProof PE (.exe/.dll), an il2cpp global-metadata.dat,\n\
\x20 a protected Android AArch64 library (.so), an Android app\n\
\x20 package (.apk/.apks/.xapk), or a folder containing any of\n\
\x20 these. The bare form is the same as 'unpack'."
+1 -1
View File
@@ -1,7 +1,7 @@
//! Integration tests for the manifest-driven corpus harness.
//!
//! These exercise the harness itself with generated fixtures only: a
//! Crackproof-shaped PE, synthetic v31 metadata, an ELF probe, and a small app
//! CrackProof-shaped PE, synthetic v31 metadata, an ELF probe, and a small app
//! tree. No real corpus, product name, or golden binary is involved.
//!
//! Run just this file with:
+1 -1
View File
@@ -56,7 +56,7 @@ fn classifier_detects_direct_and_nested_internal_panics() {
fn classifier_leaves_ordinary_restore_errors_alone() {
assert!(!harness::surfaced_internal_panic(&stage5_not_found()));
let ordinary_fallback = senbei_engine::UnpackError::PipelineFallbackFailed {
dll: Box::new(senbei_engine::UnpackError::NotCrackproof),
dll: Box::new(senbei_engine::UnpackError::NotCrackProof),
exe: Box::new(stage5_not_found()),
};
assert!(!harness::surfaced_internal_panic(&ordinary_fallback));
+1 -1
View File
@@ -1,6 +1,6 @@
//! Corpus test over the user-managed `senbei/samples` folder.
//!
//! Drop real Crackproof `*.exe` / `*.dll` inputs in there (and/or il2cpp
//! Drop real CrackProof `*.exe` / `*.dll` inputs in there (and/or il2cpp
//! `*.dat` metadata blobs), optionally alongside a byte-exact golden named
//! `<base>.golden.<ext>`. Each input is processed and classified:
//!
+1 -1
View File
@@ -140,7 +140,7 @@ fn types_offset() -> usize {
0x100 + 2 * IMAGE_STRIDE
}
/// Build a PE that the Crackproof detector classifies.
/// Build a PE that the CrackProof detector classifies.
///
/// Only the fields the detector reads are populated: the DOS/PE headers, the
/// COFF characteristics word, the optional-header magic, the CLR directory,
+2 -2
View File
@@ -128,8 +128,8 @@ pub enum UnpackError {
#[error("stage5 marker not found — this build's layout is not supported by this unpacker")]
Stage5MarkerNotFound,
#[error("not a Crackproof-protected file")]
NotCrackproof,
#[error("not a CrackProof-protected file")]
NotCrackProof,
#[error("invalid PE header offset {offset} for {input_len}-byte input")]
InvalidPeOffset { offset: i64, input_len: usize },
+7 -7
View File
@@ -432,7 +432,7 @@ impl<'a> Unpacker<'a> {
return u.run_pe32(pe_off, table, verbose);
}
// The config block layout in the decrypted region varies between Crackproof
// The config block layout in the decrypted region varies between CrackProof
// versions. Find the anchor field — a dword equal to info[3], immediately
// followed by 0x28 and then info[6]-0x200 — and derive every other field
// offset relative to it. Observed anchor positions: +6728 (older EXE
@@ -565,7 +565,7 @@ impl<'a> Unpacker<'a> {
println!(" stage1 key = xor 0x{xor_acc:08X} ^ chk 0x{chk1:08X} ^ val 0x{v:08X}");
}
// Field offsets inside stage1 vary between Crackproof versions. Locate
// Field offsets inside stage1 vary between CrackProof versions. Locate
// stage2 (the only 16-byte entry where dword[0]==dword[2], dword[1] is the
// large encrypted size and dword[3] is a smaller decompressed size), then
// derive every other field as fixed offsets from there. Observed
@@ -660,7 +660,7 @@ impl<'a> Unpacker<'a> {
println!(" stage2 key = 0x{key2:08X}");
}
// The stage2 head/walk2 tables shift between Crackproof versions. The 4-entry
// The stage2 head/walk2 tables shift between CrackProof versions. The 4-entry
// table starts with a `kind=1, 0, info[3], 0` 16-byte entry; head is two
// entries (32 bytes) past that, walk2 sits 88 bytes before head. Observed
// table_start: 9136 (older EXE builds) and 9216 (another old-layout build
@@ -1599,7 +1599,7 @@ impl<'a> Unpacker<'a> {
}
}
}
// EP/DD layout in info[3] varies between Crackproof versions. Old
// EP/DD layout in info[3] varies between CrackProof versions. Old
// layout: EP at info[3]+64, ImageBase at info[3]+68, DD[0..15] at
// info[3]+80..info[3]+208 — total 144 bytes encrypted starting at +64.
// New layout: everything shifts 32 bytes earlier — EP at info[3]+32,
@@ -1791,7 +1791,7 @@ impl<'a> Unpacker<'a> {
// Old-layout managed (CLR) restore: same verbatim regions as the
// new-layout restore above (COR20 header + BSJB MetaData stream) plus
// the COR20 resources blob. Crackproof preserves only these regions
// the COR20 resources blob. CrackProof preserves only these regions
// verbatim in the protected file — the IL method bodies between the
// COR20 header and the resources ARE packer-encrypted and arrive via
// the section-block pass, so copying the whole section's raw data (as
@@ -1844,7 +1844,7 @@ impl<'a> Unpacker<'a> {
}
}
// The payload's TLS directory (DD[9]) arrives blanked: Crackproof strips
// The payload's TLS directory (DD[9]) arrives blanked: CrackProof strips
// the struct and re-installs TLS itself when it maps the module. Prefer
// recovering the real one from the stub's plaintext `.rdata` — dropping
// DD[9] leaves `_tls_index` unwritten, so every `thread_local` access
@@ -2176,7 +2176,7 @@ impl<'a> Unpacker<'a> {
/// Restore the genuine `IMAGE_TLS_DIRECTORY32` — and the raw-data template
/// it points at — from the loader stub.
///
/// Crackproof zeroes the TLS directory struct inside the encrypted payload
/// CrackProof zeroes the TLS directory struct inside the encrypted payload
/// and re-installs TLS itself when it maps the module, so a statically
/// unpacked image reaches the ordinary Windows loader with a blank struct.
/// Synthesizing a placeholder (empty template, index/callbacks aimed at
@@ -372,7 +372,7 @@ pub struct EighthSlots {
/// Marker-independent eighthStage slot discovery (PE32+ branch).
///
/// Newer Crackproof builds (e.g. some native/managed DLLs) omit the
/// Newer CrackProof builds (e.g. some native/managed DLLs) omit the
/// `pm\0\0cm\0\0` and `00 00 00 40 01 00 00 00` markers that the older layout's
/// walk3/walk4/walk5 slot derivation relies on. Instead this discovers the
/// slots structurally:
+11 -11
View File
@@ -78,10 +78,10 @@ where
}
}
/// Crackproof header magic stored in `keys[1]`/`info[1]`.
/// CrackProof header magic stored in `keys[1]`/`info[1]`.
pub(crate) const MAGIC_KONN: u32 = 0x4E4E4F4B; // b"KONN" little-endian (= 1313754955)
/// True if `magic` is the Crackproof magic this unpacker supports.
/// True if `magic` is the CrackProof magic this unpacker supports.
pub(crate) fn is_supported_magic(magic: u32) -> bool {
magic == MAGIC_KONN
}
@@ -105,7 +105,7 @@ pub struct Detected {
// Content-based detection
// ---------------------------------------------------------------------------
/// Derive the 8-element Crackproof key table from the header at offset 4096.
/// Derive the 8-element CrackProof key table from the header at offset 4096.
/// Returns `None` if the input is too short or doesn't have a valid PE signature.
fn key_table(input: &[u8]) -> Option<[u32; 8]> {
// Need at least 4128 bytes: the key-table loop below reads dwords up to
@@ -124,7 +124,7 @@ fn key_table(input: &[u8]) -> Option<[u32; 8]> {
if &input[pe_start..pe_start + 4] != b"PE\0\0" {
return None;
}
// Derive 8 keys per the Crackproof header-key formula.
// Derive 8 keys per the CrackProof header-key formula.
let mut keys = [0u32; 8];
keys[0] = primitives::get_u32(input, 4096);
let mut k = keys[0];
@@ -136,10 +136,10 @@ fn key_table(input: &[u8]) -> Option<[u32; 8]> {
Some(keys)
}
/// Detect whether `input` is a Crackproof-protected binary and classify it.
/// Detect whether `input` is a CrackProof-protected binary and classify it.
/// Returns `None` if the magic doesn't match.
///
/// Routing: `keys[1]` must be the Crackproof magic (`KONN`).
/// Routing: `keys[1]` must be the CrackProof magic (`KONN`).
/// The PE IMAGE_FILE_DLL characteristic distinguishes EXE vs DLL;
/// the CLR data-directory RVA distinguishes managed from native for both.
pub fn detect(input: &[u8]) -> Option<Detected> {
@@ -209,7 +209,7 @@ pub fn unpack_auto(input: &[u8]) -> Result<(Kind, Vec<u8>), UnpackError> {
/// Like [`unpack_auto`], but prints detailed `[N/9]` unpack-step progress to
/// stdout when `verbose` is true. Output bytes are identical regardless.
pub fn unpack_auto_v(input: &[u8], verbose: bool) -> Result<(Kind, Vec<u8>), UnpackError> {
let detected = detect(input).ok_or(UnpackError::NotCrackproof)?;
let detected = detect(input).ok_or(UnpackError::NotCrackProof)?;
let out = match detected.kind {
Kind::NativeExe | Kind::ManagedExe => unpack_exe_v(input, verbose)?,
Kind::NativeDll | Kind::ManagedDll => select_dll_layout(
@@ -308,7 +308,7 @@ pub fn unpack_auto_profiled_v(
let detected = detect(input);
let mut profile = inspect_detected(input, detected);
let Some(detected) = detected else {
let error = UnpackError::NotCrackproof;
let error = UnpackError::NotCrackProof;
profile.push_error(error.to_string());
return (profile, Err(error));
};
@@ -342,7 +342,7 @@ pub fn unpack_exe_profiled_v(
let detected = detect(input);
let mut profile = inspect_detected(input, detected);
if detected.is_none() {
let error = UnpackError::NotCrackproof;
let error = UnpackError::NotCrackProof;
profile.push_error(error.to_string());
return (profile, Err(error));
}
@@ -1165,13 +1165,13 @@ mod dll_layout_selection {
fn profiled_entrypoints_reject_unknown_input_with_evidence() {
let sample = vec![0_u8; 64];
let (profile, result) = unpack_auto_profiled(&sample);
assert!(matches!(result, Err(UnpackError::NotCrackproof)));
assert!(matches!(result, Err(UnpackError::NotCrackProof)));
assert_eq!(profile.recognition, RecognitionStatus::NotRecognized);
assert!(profile.candidates.is_empty());
assert!(!profile.errors.is_empty());
let (profile, result) = unpack_exe_profiled(&sample);
assert!(matches!(result, Err(UnpackError::NotCrackproof)));
assert!(matches!(result, Err(UnpackError::NotCrackProof)));
assert_eq!(profile.recognition, RecognitionStatus::NotRecognized);
assert!(!profile.errors.is_empty());
}
+3 -3
View File
@@ -76,7 +76,7 @@ pub fn default_out_root_for_file(input: &Path) -> PathBuf {
parent.join("unpack")
}
/// Unpack all Crackproof-protected files under `root`, writing results into
/// Unpack all CrackProof-protected files under `root`, writing results into
/// a mirrored subtree under `out_dir` (or `root/unpack` if None).
///
/// Each file is processed independently: a panic or error in one file is
@@ -215,7 +215,7 @@ fn run_folder_inner(
log.step(&format!("out {}", out_root.display()));
Some(log)
};
// Single merged directory walk: returns Crackproof unpack candidates, il2cpp
// Single merged directory walk: returns CrackProof unpack candidates, il2cpp
// metadata blobs, and Android targets from one traversal (see
// [`crate::scan::find_targets_opts`]). Files the free directory metadata
// already rules out are never opened — on asset-heavy trees the per-file
@@ -1264,7 +1264,7 @@ fn unsupported_version(e: &anyhow::Error) -> Option<u32> {
/// De-obfuscate an il2cpp `global-metadata.dat` to `dest`.
///
/// Crackproof's `-GMD` option scrambles each `Il2CppMethodDefinition`'s token
/// CrackProof's `-GMD` option scrambles each `Il2CppMethodDefinition`'s token
/// into a sparse, original-metadata-style value; il2cpp expects the contiguous
/// per-module index it indexes its codegen tables with, so a statically-unpacked
/// il2cpp game assembly reads garbage and crashes during init. This rewrites
+12 -12
View File
@@ -4,7 +4,7 @@ use std::path::{Path, PathBuf};
use walkdir::WalkDir;
/// Bytes read per file for content detection. `detect` inspects the DOS/PE
/// header and the Crackproof key table at offset 4096; its deepest read is the
/// header and the CrackProof key table at offset 4096; its deepest read is the
/// key-table dword at 4124 (so a candidate must be ≥ 4128 bytes) or the PE
/// data-directory field at `e_lfanew + 252`, which is far below 8 KiB for any
/// real PE (`e_lfanew` is a few hundred bytes). `is_metadata` needs only the
@@ -16,7 +16,7 @@ const DETECT_PREFIX: u64 = 8 * 1024;
/// Smallest file that can possibly be a target, so anything shorter is skipped
/// without ever being opened.
///
/// A Crackproof module needs ≥ 4128 bytes for [`senbei_engine::detect`]'s key
/// A CrackProof module needs ≥ 4128 bytes for [`senbei_engine::detect`]'s key
/// table (it reads the dword at 4124), so the bound is exact for the unpack
/// path. An il2cpp `global-metadata.dat` only needs 4 bytes to match its magic,
/// but its header alone runs to offset 0xB0 and the images/types/methods tables
@@ -34,10 +34,10 @@ fn is_metadata_name(path: &Path) -> bool {
/// Content classification of a single file.
#[derive(Clone, Copy, PartialEq, Eq)]
enum Class {
/// Neither a Crackproof module nor il2cpp metadata — left untouched.
/// Neither a CrackProof module nor il2cpp metadata — left untouched.
None,
/// A Crackproof-protected PE (unpack target).
Crackproof,
/// A CrackProof-protected PE (unpack target).
CrackProof,
/// An il2cpp `global-metadata.dat` (de-obfuscation target).
Metadata,
/// A protected AArch64 shared library (Android restore target).
@@ -50,7 +50,7 @@ enum Class {
/// Everything one [`find_targets_opts`] walk found, plus non-target tallies.
#[derive(Default)]
pub struct ScanResult {
/// Crackproof-protected PE files.
/// CrackProof-protected PE files.
pub crackproof: Vec<PathBuf>,
/// il2cpp `global-metadata.dat` blobs.
pub metadata: Vec<PathBuf>,
@@ -62,7 +62,7 @@ pub struct ScanResult {
}
/// Walk `root` recursively (skipping any directory literally named `"unpack"`)
/// and return, **in walk order**, the Crackproof candidates and the il2cpp
/// and return, **in walk order**, the CrackProof candidates and the il2cpp
/// metadata blobs found — from a *single* traversal that opens each file at
/// most once.
///
@@ -213,7 +213,7 @@ pub fn find_targets_with_limits(
};
for (p, c) in paths.into_iter().zip(class) {
match c {
Some(Class::Crackproof) => result.crackproof.push(p),
Some(Class::CrackProof) => result.crackproof.push(p),
Some(Class::Metadata) => result.metadata.push(p),
Some(Class::AndroidSo) => result.android_so.push(p),
Some(Class::AndroidPackage) => result.android_packages.push(p),
@@ -247,7 +247,7 @@ pub fn scan_all_env() -> bool {
/// re-raises on join, before any per-file isolation exists). The default panic
/// hook still prints the message, keeping the bug diagnosable.
///
/// A Crackproof PE never matches the metadata magic (it is a PE, not a
/// A CrackProof PE never matches the metadata magic (it is a PE, not a
/// metadata blob) and vice versa, so the order is immaterial.
///
/// The Android library probe needs more than the prefix: the protection
@@ -264,7 +264,7 @@ fn classify(path: &Path, limits: &senbei_engine::android::ResourceLimits) -> Opt
return Class::Metadata;
}
if crate::windows::is_pe_extension(path) && detect(&head).is_some() {
return Class::Crackproof;
return Class::CrackProof;
}
if crate::android::is_so_name(path)
&& crate::android::is_elf64_aarch64(&head)
@@ -337,7 +337,7 @@ mod tests {
assert!(exhaustive.metadata.is_empty());
}
/// A selected file below the Crackproof key-table bound is skipped without
/// A selected file below the CrackProof key-table bound is skipped without
/// being opened, while `scan_all` probes it.
#[test]
fn prefilter_skips_small_selected_files_only() {
@@ -347,7 +347,7 @@ mod tests {
std::fs::write(root.join("assets.ab"), vec![0u8; 100_000]).unwrap();
std::fs::write(root.join("plain.dll"), vec![0u8; 100_000]).unwrap();
// None of them are Crackproof, so both modes find nothing; the point is
// None of them are CrackProof, so both modes find nothing; the point is
// that only the selected names are considered and `scan_all` controls
// the size floor.
let scan = find_targets_opts(root, false);
+11 -11
View File
@@ -44,7 +44,7 @@ pub(crate) fn is_reparse_point(_entry: &walkdir::DirEntry) -> bool {
false
}
/// Crackproof header key table lives at this fixed file offset. For the
/// CrackProof header key table lives at this fixed file offset. For the
/// external-companion layout, the companion payload aligns to the stub here.
const HEADER_OFF: usize = 4096;
@@ -54,10 +54,10 @@ const HEADER_OFF: usize = 4096;
/// In that layout a protected module is split into a thin on-disk loader stub
/// (`Foo.dll`, whose code sections are stripped to one page) plus an encrypted
/// `Foo.dll._` companion holding the real payload. The companion is byte-for-byte
/// the stub's payload region starting at the Crackproof header (offset 4096), so
/// the stub's payload region starting at the CrackProof header (offset 4096), so
/// `stub[..4096] ++ companion` reconstructs the ordinary embedded-payload file
/// the existing pipelines already unpack. The runtime loader does exactly this:
/// it maps `Foo.dll._` and feeds it through the standard Crackproof unpack.
/// it maps `Foo.dll._` and feeds it through the standard CrackProof unpack.
///
/// The splice fires only when a sibling `<input>._` exists *and* its first 32
/// bytes equal the stub's header at offset 4096 — a precise signal that the
@@ -107,7 +107,7 @@ pub(crate) fn read_unpacker_input(input: &Path) -> anyhow::Result<UnpackerInput>
/// The bytes fed to the unpacker, plus the original loader stub when the input
/// was reconstructed from an external companion. The stub is retained because
/// the crackproof loader rebuilds the PE export table at runtime from data kept
/// the CrackProof loader rebuilds the PE export table at runtime from data kept
/// in the stub — that table is *not* present in the encrypted companion, so the
/// unpacked image needs it overlaid from the stub afterwards
/// (see [`overlay_exports_from_stub`]).
@@ -120,7 +120,7 @@ pub(crate) struct UnpackerInput {
/// `out`, for the external-companion layout.
///
/// In that layout the encrypted companion carries the real `.text`/`il2cpp`
/// payload but **not** a usable export directory: the crackproof loader rebuilds
/// payload but **not** a usable export directory: the CrackProof loader rebuilds
/// exports at runtime from the plaintext copy retained in the stub's `.rdata`.
/// Statically, the spliced input therefore decrypts to a garbage export
/// directory (`NumberOfFunctions` etc. are ciphertext), which makes downstream
@@ -245,7 +245,7 @@ fn restore_managed_from_stub(out: &mut [u8], stub: &[u8]) -> Result<(), unpacker
/// Restore the TLS directory from the loader `stub` onto the unpacked image
/// `out`, for the external-companion layout.
///
/// Crackproof strips the whole `IMAGE_TLS_DIRECTORY` from the encrypted payload
/// CrackProof strips the whole `IMAGE_TLS_DIRECTORY` from the encrypted payload
/// — the data-directory entry, the directory struct, the raw-data template, and
/// the base relocations for the struct's four 64-bit pointer fields — and
/// re-installs TLS itself from data kept in the stub when it loads the module.
@@ -419,7 +419,7 @@ fn write_u32_at(buf: &mut [u8], off: usize, val: u32) {
/// Splice a stub and its external-companion payload into the embedded-payload
/// form the pipelines expect, or `None` if `comp` is not this stub's payload.
///
/// The companion is byte-for-byte the stub's payload region from the Crackproof
/// The companion is byte-for-byte the stub's payload region from the CrackProof
/// header (offset 4096) onward, so the result is `stub[..4096] ++ comp`. The
/// splice fires only when the first 32 bytes of `comp` equal the stub's header
/// at offset 4096 — a 32-byte match on the key-table/magic region that confirms
@@ -450,7 +450,7 @@ pub(crate) fn unpack_spliced_or_auto(
verbose: bool,
) -> Result<(unpacker::Kind, Vec<u8>), unpacker::UnpackError> {
if spliced || force_exe {
let detected = unpacker::detect(bytes).ok_or(unpacker::UnpackError::NotCrackproof)?;
let detected = unpacker::detect(bytes).ok_or(unpacker::UnpackError::NotCrackProof)?;
let out = unpacker::unpack_exe_v(bytes, verbose)?;
return Ok((detected.kind, out));
}
@@ -631,7 +631,7 @@ fn unpack_bytes_profiled_impl(
let kind = match profile.observed.kind {
Some(kind) => kind,
None => {
let error = unpacker::UnpackError::NotCrackproof;
let error = unpacker::UnpackError::NotCrackProof;
profile.push_error(error.to_string());
return (profile, Err(error));
}
@@ -660,7 +660,7 @@ pub fn unpack_one_v(
// the encrypted companion does not carry (the loader rebuilds it at runtime).
if let Some(stub) = stub {
overlay_exports_from_stub(&mut out, &stub);
// ...and the TLS directory, which Crackproof strips from the payload and
// ...and the TLS directory, which CrackProof strips from the payload and
// re-installs at runtime; the ordinary loader needs it or thread_local
// access crashes (see [`restore_tls_from_stub`]).
restore_tls_from_stub(&mut out, &stub);
@@ -947,7 +947,7 @@ mod tests {
#[test]
fn profiled_unknown_input_is_not_recognized() {
let (profile, result) = unpack_bytes_profiled(&[], None);
assert!(matches!(result, Err(unpacker::UnpackError::NotCrackproof)));
assert!(matches!(result, Err(unpacker::UnpackError::NotCrackProof)));
assert_eq!(
profile.recognition,
unpacker::RecognitionStatus::NotRecognized
+3 -3
View File
@@ -1,6 +1,6 @@
//! il2cpp `global-metadata.dat` de-obfuscation.
//!
//! Crackproof's `-GMD` option obfuscates the **method-token** field of every
//! CrackProof's `-GMD` option obfuscates the **method-token** field of every
//! `Il2CppMethodDefinition` in `global-metadata.dat`. il2cpp resolves a method's
//! compiled function/invoker by indexing the per-module
//! `Il2CppCodeGenModule.methodPointers` / `invokerIndices` tables — which are
@@ -8,9 +8,9 @@
//! only works when each module's method tokens are the **contiguous** range
//! `1..=methodPointerCount`. `-GMD` replaces them with sparse, original-metadata-style
//! tokens (e.g. mscorlib rows reach ~55k for only ~14k compiled methods) and the
//! running game's Crackproof loader remaps them back at load time.
//! running game's CrackProof loader remaps them back at load time.
//!
//! A statically-unpacked il2cpp game assembly run without Crackproof reads the
//! A statically-unpacked il2cpp game assembly run without CrackProof reads the
//! tokens raw, so `(token_row - 1)` runs off the end of those tables — an
//! out-of-bounds read that crashes deep in il2cpp init (first hit:
//! `System.Array`'s interface method setup). See the project notes for the full
+1 -1
View File
@@ -223,7 +223,7 @@ pub fn inspect_profile_json(input: &[u8]) -> String {
/// `input` is the protected `.exe`/`.dll`; `companion` is the optional
/// `<input>._` external-companion payload (pass `null`/`undefined` when there
/// is none). Throws a string error when the input is not a supported
/// Crackproof file or is corrupt.
/// CrackProof file or is corrupt.
#[wasm_bindgen]
pub fn unpack_file(input: &[u8], companion: Option<Vec<u8>>) -> Result<UnpackResult, JsError> {
let r = senbei_io::job::unpack_bytes(input, companion.as_deref())
+2 -2
View File
@@ -544,7 +544,7 @@ function applyReply(entry, r) {
entry.error = r.message ?? r.error ?? 'unpack failed';
entry.findings = [];
entry.note = r.trap
? 'unpack failed (internal trap) — this Crackproof layout may be unsupported'
? 'unpack failed (internal trap) — this CrackProof layout may be unsupported'
: entry.error;
return false;
}
@@ -630,7 +630,7 @@ unpackBtn.addEventListener('click', async () => {
if (entry.kind === undefined) {
entry.state = 'err';
entry.error = 'not recognized as Crackproof-protected — skipped';
entry.error = 'not recognized as CrackProof-protected — skipped';
entry.note = entry.error;
render();
continue;
+3 -3
View File
@@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Senbei — static Crackproof unpacker</title>
<title>Senbei — static CrackProof unpacker</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
@@ -28,7 +28,7 @@
code, and uploads nothing — everything runs locally in your browser.
Do not redistribute decrypted outputs. This software is provided
“as is”, without warranty of any kind; the authors accept no liability
for misuse. “Crackproof” is a trademark of its owner; this project is
for misuse. “CrackProof” is a trademark of its owner; this project is
not affiliated with or endorsed by the vendor or any publisher.
</p>
<button id="legal-accept" type="button">I understand and accept</button>
@@ -46,7 +46,7 @@
</a>
</header>
<p class="lede">
Static unpacker for Crackproof-protected PE files, running entirely in
Static unpacker for CrackProof-protected PE files, running entirely in
your browser. <strong>No file ever leaves your device.</strong>
</p>
+3 -3
View File
@@ -289,12 +289,12 @@ test('buildFileReport prefers the profile verdict over row findings', () => {
test('buildFileReport keeps the failure profile and error for a failed row', () => {
const report = buildFileReport('bad.dll', {
state: 'err',
error: 'not a Crackproof-protected file',
error: 'not a CrackProof-protected file',
findings: [{ severity: 'fatal', message: 'unmapped entry point' }],
profile: { format_version: 1, recovery: 'failed', errors: ['boom'] },
});
assert.equal(report.status, 'failed');
assert.equal(report.error, 'not a Crackproof-protected file');
assert.equal(report.error, 'not a CrackProof-protected file');
assert.equal(report.integrity.status, 'not_run');
assert.equal(report.integrity.findings[0].severity, 'fatal');
assert.equal(report.profile.recovery, 'failed');
@@ -369,7 +369,7 @@ test('describeObserved never claims protection from a metadata magic match', ()
recognition: 'recognized',
});
assert.equal(text, 'v31 · format only, not a protection verdict');
assert.doesNotMatch(text, /protected|recognized|Crackproof|CrackProof/);
assert.doesNotMatch(text, /protected|recognized|CrackProof/);
});
test('describeObserved lists PE target facts and evidence', () => {