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

+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());
}