mirror of
https://github.com/Momoko-Ayase/Senbei.git
synced 2026-11-24 02:52:47 +08:00
feat(i18n): add the senbei-i18n message catalog
Every piece of user-facing text becomes a variant of Msg (engine and driver messages), Step (verbose pipeline steps), Term (report values), or Cli (command-line wording). Each language module renders every variant, so a missing translation, an unknown placeholder, or a dropped argument is a compile error. English is the wording Senbei already prints, copied verbatim. Simplified Chinese, Traditional Chinese, Japanese, and Korean translate it. A Message keeps the recorded English next to its optional code, so reports, logs, and JSON stay English while a front end shows the translation.
This commit is contained in:
1 parent
4d211166bf
commit
9481b0ccf9
12 files changed
+2842
No files matched your search
Generated
+8
@@ -465,6 +465,14 @@ dependencies = [
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "senbei-i18n"
|
||||
version = "1.3.4"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "senbei-io"
|
||||
version = "1.3.4"
|
||||
|
||||
@@ -4,6 +4,7 @@ members = [
|
||||
"senbei-crypto",
|
||||
"senbei-elf",
|
||||
"senbei-engine",
|
||||
"senbei-i18n",
|
||||
"senbei-io",
|
||||
"senbei-metadata",
|
||||
"senbei-pe",
|
||||
@@ -44,6 +45,7 @@ zip = { version = "9.3", default-features = false, features = ["deflate"] }
|
||||
senbei-crypto = { path = "senbei-crypto" }
|
||||
senbei-elf = { path = "senbei-elf" }
|
||||
senbei-engine = { path = "senbei-engine" }
|
||||
senbei-i18n = { path = "senbei-i18n" }
|
||||
senbei-io = { path = "senbei-io" }
|
||||
senbei-metadata = { path = "senbei-metadata" }
|
||||
senbei-pe = { path = "senbei-pe" }
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "senbei-i18n"
|
||||
version.workspace = true
|
||||
edition.workspace = true
|
||||
rust-version.workspace = true
|
||||
license.workspace = true
|
||||
description = "User-facing text for Senbei in English, Simplified Chinese, Traditional Chinese, Japanese, and Korean"
|
||||
|
||||
[dependencies]
|
||||
serde.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
serde_json.workspace = true
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
@@ -0,0 +1,561 @@
|
||||
//! Every localizable string Senbei shows, as typed values.
|
||||
//!
|
||||
//! The English rendering of each variant (in `en.rs`) is the wording the
|
||||
//! engine and the command line have always used; the other language modules
|
||||
//! translate it. Adding a variant fails to compile until every language
|
||||
//! renders it.
|
||||
|
||||
/// A message recorded in a report: an error, a warning, a stage detail, or a
|
||||
/// static validation finding.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
pub enum Msg {
|
||||
// -- Windows recovery -------------------------------------------------
|
||||
CompanionMissing,
|
||||
CompanionMismatch,
|
||||
InputTooShort {
|
||||
actual: usize,
|
||||
required: usize,
|
||||
},
|
||||
NotProtected,
|
||||
InvalidPeOffset {
|
||||
offset: i64,
|
||||
input_len: usize,
|
||||
},
|
||||
DllNeedsPe32Plus {
|
||||
found: u16,
|
||||
},
|
||||
LayoutUnsupported,
|
||||
InternalPanic {
|
||||
file: String,
|
||||
line: u32,
|
||||
column: u32,
|
||||
message: String,
|
||||
},
|
||||
/// An internal decode failure. The recorded English names the specific
|
||||
/// table or stage; other languages show this summary with that English
|
||||
/// as technical detail.
|
||||
DecodeFailed,
|
||||
|
||||
// -- Input formats ----------------------------------------------------
|
||||
NotPe,
|
||||
NotElf64,
|
||||
NotAarch64,
|
||||
/// Structural metadata transform wording (`il2cpp`).
|
||||
NotMetadata,
|
||||
/// Android metadata wording (`IL2CPP`).
|
||||
NotIl2cppMetadata,
|
||||
UnsupportedMetadataVersion {
|
||||
version: u32,
|
||||
},
|
||||
/// A metadata transform failure. The recorded English names the check.
|
||||
MetadataTransformFailed,
|
||||
|
||||
// -- Android resource limits ------------------------------------------
|
||||
LimitEntry {
|
||||
requested: u64,
|
||||
limit: u64,
|
||||
},
|
||||
LimitTotal {
|
||||
requested: u64,
|
||||
adding: u64,
|
||||
limit: u64,
|
||||
},
|
||||
LimitEntries {
|
||||
requested: usize,
|
||||
limit: usize,
|
||||
},
|
||||
LimitDepth {
|
||||
requested: usize,
|
||||
limit: usize,
|
||||
},
|
||||
|
||||
// -- Driver outcomes --------------------------------------------------
|
||||
OutputNotRetained,
|
||||
DryRunDiscarded,
|
||||
TransformNoop,
|
||||
CompanionUnmatched,
|
||||
CompanionUnreadable {
|
||||
reason: String,
|
||||
},
|
||||
CompanionUnreadableUnknown,
|
||||
MetadataLeftUntouched {
|
||||
version: u32,
|
||||
},
|
||||
UnexpectedPanic {
|
||||
message: String,
|
||||
},
|
||||
InputNotExamined,
|
||||
NoCandidateValidated,
|
||||
NoModule0c,
|
||||
AmbiguousModule0c,
|
||||
UnsafePackageEntry {
|
||||
package: String,
|
||||
},
|
||||
UnsafeNestedEntry {
|
||||
path: String,
|
||||
},
|
||||
|
||||
// -- Static validation of a restored PE --------------------------------
|
||||
EntryStubTargetOutsideCode {
|
||||
branch: &'static str,
|
||||
target: i64,
|
||||
},
|
||||
MissingMz,
|
||||
TruncatedDosHeader,
|
||||
MissingPeSignature {
|
||||
offset: u32,
|
||||
},
|
||||
TruncatedCoffHeader,
|
||||
TruncatedOptionalHeader,
|
||||
BadOptionalMagic {
|
||||
magic: u16,
|
||||
},
|
||||
ImplausibleSectionCount {
|
||||
count: u32,
|
||||
},
|
||||
ZeroSizeOfImage,
|
||||
SectionTablePastEof,
|
||||
SectionRawPastEof {
|
||||
index: usize,
|
||||
start: u32,
|
||||
end: usize,
|
||||
file_len: usize,
|
||||
},
|
||||
NoBaseRelocations,
|
||||
ZeroEntryPoint,
|
||||
EntryUnmapped {
|
||||
rva: u32,
|
||||
},
|
||||
EntryAllZeros {
|
||||
rva: u32,
|
||||
},
|
||||
EntryAllInt3 {
|
||||
rva: u32,
|
||||
},
|
||||
EntryNotExecutable {
|
||||
rva: u32,
|
||||
},
|
||||
ImportDirectoryUnmapped {
|
||||
rva: u32,
|
||||
},
|
||||
ImportNameUnmapped {
|
||||
index: u32,
|
||||
rva: u32,
|
||||
},
|
||||
ImportNameUnreadable {
|
||||
index: u32,
|
||||
rva: u32,
|
||||
},
|
||||
ClrDirectoryUnmapped {
|
||||
rva: u32,
|
||||
},
|
||||
ClrHeaderBadSize {
|
||||
rva: u32,
|
||||
size: u32,
|
||||
},
|
||||
ClrMetadataUnmapped {
|
||||
rva: u32,
|
||||
},
|
||||
ClrMetadataNoBsjb {
|
||||
rva: u32,
|
||||
},
|
||||
}
|
||||
|
||||
/// One verbose progress line from a recovery pipeline.
|
||||
///
|
||||
/// The English wording, trailing dots included, is what `--verbose` has
|
||||
/// always printed after the `[n/9]` counter.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
pub enum Step {
|
||||
// PE32+ EXE-style loader
|
||||
DecryptHeader,
|
||||
DecryptPayload,
|
||||
LocateConfig,
|
||||
DecryptStage2,
|
||||
DecryptStages3To5,
|
||||
DecryptSections,
|
||||
DecryptSectionsNewLayout,
|
||||
LoadSections,
|
||||
DecryptImports,
|
||||
RebuildHeaders,
|
||||
// PE32 loader
|
||||
Pe32LocateConfig,
|
||||
Pe32Stages,
|
||||
Pe32EighthStage,
|
||||
Pe32Load,
|
||||
Pe32Text { formula: &'static str },
|
||||
Pe32TextSkip,
|
||||
Pe32Imports,
|
||||
Pe32Rebuild,
|
||||
// DLL loader
|
||||
InitKeys,
|
||||
DecryptKeyTable,
|
||||
DecryptPrimary,
|
||||
RelocsParams,
|
||||
DecryptBlock1,
|
||||
DecryptBlocks2To3,
|
||||
DecryptBlock4,
|
||||
DllSections,
|
||||
FixHeaders,
|
||||
// Android staged loader
|
||||
AndroidPrimary,
|
||||
AndroidAuxiliary,
|
||||
AndroidTables,
|
||||
// Output
|
||||
WriteTo { dest: String },
|
||||
}
|
||||
|
||||
/// A report value as the command line shows it: a status, stage, route,
|
||||
/// platform, kind, or piece of evidence.
|
||||
///
|
||||
/// Each variant is one wire value of a report enum; [`Term::from_value`]
|
||||
/// maps the JSON spelling to it. English is that spelling with spaces.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[non_exhaustive]
|
||||
pub enum Term {
|
||||
// statuses
|
||||
Ok,
|
||||
Suspect,
|
||||
Recognized,
|
||||
NotRecognized,
|
||||
Skipped,
|
||||
Error,
|
||||
Restored,
|
||||
Duplicate,
|
||||
NotTarget,
|
||||
Unchanged,
|
||||
Inventoried,
|
||||
Failed,
|
||||
Blocked,
|
||||
NotAttempted,
|
||||
Succeeded,
|
||||
Rejected,
|
||||
Clean,
|
||||
Warnings,
|
||||
NotRun,
|
||||
// companion states
|
||||
Absent,
|
||||
Spliced,
|
||||
Unmatched,
|
||||
Unreadable,
|
||||
// stages
|
||||
Detection,
|
||||
ManifestInventory,
|
||||
EntryProbe,
|
||||
Recovery,
|
||||
StaticValidation,
|
||||
OutputWrite,
|
||||
// entry kinds
|
||||
SharedLibrary,
|
||||
Metadata,
|
||||
// routes
|
||||
ExeStyle,
|
||||
Dll,
|
||||
AndroidStaged,
|
||||
MetadataSeeded,
|
||||
MetadataStructural,
|
||||
MetadataMethodIndices,
|
||||
// platforms
|
||||
WindowsPe,
|
||||
AndroidElf,
|
||||
Il2cppMetadata,
|
||||
// kinds
|
||||
NativeExe,
|
||||
ManagedExe,
|
||||
NativeDll,
|
||||
ManagedDll,
|
||||
// evidence
|
||||
HeaderMagic,
|
||||
ExternalCompanionDeclaration,
|
||||
CompanionSpliced,
|
||||
PrivateSection,
|
||||
AesSchedule,
|
||||
ValidatedMetadataTransform,
|
||||
// metadata layout definitions
|
||||
Known,
|
||||
ContextRequired,
|
||||
Unverified,
|
||||
// research input views
|
||||
Original,
|
||||
SplicedCompanion,
|
||||
}
|
||||
|
||||
impl Term {
|
||||
/// The term for a report enum's JSON spelling, such as `not_attempted`.
|
||||
pub fn from_value(value: &str) -> Option<Term> {
|
||||
Some(match value {
|
||||
"ok" => Term::Ok,
|
||||
"suspect" => Term::Suspect,
|
||||
"recognized" => Term::Recognized,
|
||||
"not_recognized" => Term::NotRecognized,
|
||||
"skipped" => Term::Skipped,
|
||||
"error" => Term::Error,
|
||||
"restored" => Term::Restored,
|
||||
"duplicate" => Term::Duplicate,
|
||||
"not_target" => Term::NotTarget,
|
||||
"unchanged" => Term::Unchanged,
|
||||
"inventoried" => Term::Inventoried,
|
||||
"failed" => Term::Failed,
|
||||
"blocked" => Term::Blocked,
|
||||
"not_attempted" => Term::NotAttempted,
|
||||
"succeeded" => Term::Succeeded,
|
||||
"rejected" => Term::Rejected,
|
||||
"clean" => Term::Clean,
|
||||
"warnings" => Term::Warnings,
|
||||
"not_run" => Term::NotRun,
|
||||
"absent" => Term::Absent,
|
||||
"spliced" => Term::Spliced,
|
||||
"unmatched" => Term::Unmatched,
|
||||
"unreadable" => Term::Unreadable,
|
||||
"detection" => Term::Detection,
|
||||
"manifest_inventory" => Term::ManifestInventory,
|
||||
"entry_probe" => Term::EntryProbe,
|
||||
"recovery" => Term::Recovery,
|
||||
"static_validation" => Term::StaticValidation,
|
||||
"output_write" => Term::OutputWrite,
|
||||
"shared_library" => Term::SharedLibrary,
|
||||
"metadata" => Term::Metadata,
|
||||
"exe_style" => Term::ExeStyle,
|
||||
"dll" => Term::Dll,
|
||||
"android_staged" => Term::AndroidStaged,
|
||||
"metadata_seeded" => Term::MetadataSeeded,
|
||||
"metadata_structural" => Term::MetadataStructural,
|
||||
"metadata_method_indices" => Term::MetadataMethodIndices,
|
||||
"windows_pe" => Term::WindowsPe,
|
||||
"android_elf" => Term::AndroidElf,
|
||||
"il2cpp_metadata" => Term::Il2cppMetadata,
|
||||
"native_exe" => Term::NativeExe,
|
||||
"managed_exe" => Term::ManagedExe,
|
||||
"native_dll" => Term::NativeDll,
|
||||
"managed_dll" => Term::ManagedDll,
|
||||
"header_magic" => Term::HeaderMagic,
|
||||
"external_companion_declaration" => Term::ExternalCompanionDeclaration,
|
||||
"companion_spliced" => Term::CompanionSpliced,
|
||||
"private_section" => Term::PrivateSection,
|
||||
"aes_schedule" => Term::AesSchedule,
|
||||
"validated_metadata_transform" => Term::ValidatedMetadataTransform,
|
||||
"known" => Term::Known,
|
||||
"context_required" => Term::ContextRequired,
|
||||
"unverified" => Term::Unverified,
|
||||
"original" => Term::Original,
|
||||
"spliced_companion" => Term::SplicedCompanion,
|
||||
_ => return None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/// Command-line wording: help, usage errors, per-file lines, summaries, and
|
||||
/// the labels of the text report.
|
||||
///
|
||||
/// Arguments that arrive already colored (counts, paths) are strings, so a
|
||||
/// translation can move them without losing the color.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[non_exhaustive]
|
||||
pub enum Cli {
|
||||
// -- severity labels and run chrome -----------------------------------
|
||||
Error,
|
||||
Warning,
|
||||
DoneIn {
|
||||
ms: u128,
|
||||
},
|
||||
PressEnter,
|
||||
ScanUnreadable {
|
||||
count: usize,
|
||||
},
|
||||
Summary {
|
||||
unpacked: String,
|
||||
skipped: String,
|
||||
errors: String,
|
||||
suspect: String,
|
||||
metadata: String,
|
||||
},
|
||||
SummaryPackages {
|
||||
packages: String,
|
||||
},
|
||||
IntegrityFailed,
|
||||
IntegrityFailedLikelyCrash,
|
||||
// -- per-file lines ---------------------------------------------------
|
||||
MetadataLine {
|
||||
rel: String,
|
||||
dest: String,
|
||||
remapped: String,
|
||||
},
|
||||
MetadataVersionLine {
|
||||
version: String,
|
||||
dest: String,
|
||||
remapped: String,
|
||||
},
|
||||
MetadataAlreadyClean {
|
||||
version: String,
|
||||
},
|
||||
MetadataNothingToDo,
|
||||
EmbeddedMetadataLine {
|
||||
input: String,
|
||||
dest: String,
|
||||
},
|
||||
EmbeddedMetadataFailed,
|
||||
MetadataUnsupportedLine {
|
||||
version: u32,
|
||||
},
|
||||
// -- usage errors -----------------------------------------------------
|
||||
OutRequiresDirectory,
|
||||
UnknownOption {
|
||||
option: String,
|
||||
},
|
||||
MultipleInputs {
|
||||
first: String,
|
||||
second: String,
|
||||
},
|
||||
SubcommandNeedsPath {
|
||||
subcommand: String,
|
||||
},
|
||||
InspectNoDryRun,
|
||||
InspectNoOut,
|
||||
DryRunNoOut,
|
||||
ColorRequiresMode,
|
||||
ThreadsRequiresInteger,
|
||||
LimitRequiresInteger {
|
||||
flag: String,
|
||||
},
|
||||
LimitMustBePositive {
|
||||
flag: String,
|
||||
},
|
||||
LimitTooLarge {
|
||||
flag: String,
|
||||
},
|
||||
UnknownLimit {
|
||||
flag: String,
|
||||
},
|
||||
// -- help -------------------------------------------------------------
|
||||
HelpPath,
|
||||
HelpInspect,
|
||||
HelpUnpack,
|
||||
HelpJson,
|
||||
HelpDryRun,
|
||||
HelpThreads,
|
||||
HelpColor,
|
||||
HelpScanAll,
|
||||
HelpStrictIntegrity,
|
||||
HelpLimits {
|
||||
entry_mib: u64,
|
||||
total_mib: u64,
|
||||
entries: usize,
|
||||
depth: usize,
|
||||
},
|
||||
HelpExitCodes,
|
||||
// -- text report ------------------------------------------------------
|
||||
ReportScanHeading,
|
||||
ReportScan {
|
||||
skipped: usize,
|
||||
walk_errors: usize,
|
||||
probe_errors: usize,
|
||||
},
|
||||
ReportScanIncomplete,
|
||||
AnalysisIncomplete,
|
||||
AnalysisIncompleteInput,
|
||||
AnalysisIncompleteEntry,
|
||||
Source {
|
||||
size: u64,
|
||||
},
|
||||
Target {
|
||||
platform: String,
|
||||
format: String,
|
||||
kind: String,
|
||||
},
|
||||
FormatUnavailable,
|
||||
KindUnavailable,
|
||||
ProtectionRecognition {
|
||||
status: String,
|
||||
},
|
||||
Evidence {
|
||||
evidence: String,
|
||||
},
|
||||
Route {
|
||||
route: String,
|
||||
outcome: String,
|
||||
},
|
||||
SelectedRoute {
|
||||
route: String,
|
||||
},
|
||||
StaticRecovery {
|
||||
status: String,
|
||||
},
|
||||
OutputValidation {
|
||||
status: String,
|
||||
},
|
||||
Companion {
|
||||
state: String,
|
||||
},
|
||||
CompanionIdentity {
|
||||
size: u64,
|
||||
sha256: String,
|
||||
},
|
||||
InputView {
|
||||
view: String,
|
||||
},
|
||||
InputViewSplicedNote,
|
||||
MetadataIdentity {
|
||||
version: u32,
|
||||
layout: String,
|
||||
},
|
||||
SeededTokens {
|
||||
value: bool,
|
||||
},
|
||||
StructuralTokens {
|
||||
value: bool,
|
||||
},
|
||||
MethodIndexRestore {
|
||||
value: bool,
|
||||
context: bool,
|
||||
},
|
||||
Container {
|
||||
kind: String,
|
||||
entries: usize,
|
||||
manifests: usize,
|
||||
},
|
||||
Manifest {
|
||||
source: String,
|
||||
package: String,
|
||||
version: String,
|
||||
},
|
||||
Unnamed,
|
||||
Candidate {
|
||||
entry: String,
|
||||
},
|
||||
MetadataEvidence,
|
||||
Entry {
|
||||
name: String,
|
||||
status: String,
|
||||
},
|
||||
EntryRoute {
|
||||
route: String,
|
||||
},
|
||||
EntryMetadataVersion {
|
||||
version: u32,
|
||||
},
|
||||
EntryRemapped {
|
||||
remapped: usize,
|
||||
},
|
||||
ModuleContextSource {
|
||||
source: String,
|
||||
},
|
||||
StageLine {
|
||||
stage: String,
|
||||
status: String,
|
||||
},
|
||||
Recovered {
|
||||
size: u64,
|
||||
sha256: String,
|
||||
},
|
||||
InspectionStatus {
|
||||
status: String,
|
||||
ms: u64,
|
||||
},
|
||||
DiagnosticWarning,
|
||||
DiagnosticError,
|
||||
DiagnosticReason,
|
||||
DiagnosticDetail,
|
||||
DiagnosticEnglish,
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
//! English: the wording Senbei has always produced. Every other language
|
||||
//! translates these strings; reports, logs, and JSON keep them verbatim.
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{Cli, Msg, Step, Term};
|
||||
|
||||
pub(crate) fn msg(msg: &Msg) -> Cow<'static, str> {
|
||||
match msg {
|
||||
Msg::CompanionMissing => "Companion missing? This loader expects a matching <input>._ payload. Keep it beside the input file (or add both files in the browser) and try again.".into(),
|
||||
Msg::CompanionMismatch => "Companion doesn't match: the supplied ._ payload is too short or its header differs from the loader's. Use the companion from the same build; either file may be damaged.".into(),
|
||||
Msg::InputTooShort { actual, required } => format!("input too short (need at least {required} bytes, got {actual})").into(),
|
||||
Msg::NotProtected => "not a CrackProof-protected file".into(),
|
||||
Msg::InvalidPeOffset { offset, input_len } => format!("invalid PE header offset {offset} for {input_len}-byte input").into(),
|
||||
Msg::DllNeedsPe32Plus { found } => format!("DLL pipeline requires PE32+ optional-header magic, got 0x{found:04X}").into(),
|
||||
Msg::LayoutUnsupported => "stage5 marker not found — this build's layout is not supported by this unpacker".into(),
|
||||
Msg::InternalPanic { file, line, column, message } => format!("internal panic at {file}:{line}:{column}: {message}").into(),
|
||||
Msg::DecodeFailed => "the protected data did not decode as expected; the file may be damaged, or this build's layout is not supported".into(),
|
||||
Msg::NotPe => "input is not a PE image".into(),
|
||||
Msg::NotElf64 => "input is not an ELF64 little-endian image".into(),
|
||||
Msg::NotAarch64 => "input is not an AArch64 image".into(),
|
||||
Msg::NotMetadata => "not an il2cpp global-metadata.dat".into(),
|
||||
Msg::NotIl2cppMetadata => "not an IL2CPP global-metadata.dat".into(),
|
||||
Msg::UnsupportedMetadataVersion { version } => format!("unsupported metadata version {version}").into(),
|
||||
Msg::MetadataTransformFailed => "the metadata transform did not validate".into(),
|
||||
Msg::LimitEntry { requested, limit } => format!("resource limit: entry of {requested} bytes exceeds the {limit}-byte ceiling").into(),
|
||||
Msg::LimitTotal { requested, adding, limit } => format!("resource limit: task total of {requested} bytes exceeds the {limit}-byte ceiling (adding {adding} bytes)").into(),
|
||||
Msg::LimitEntries { requested, limit } => format!("resource limit: {requested} entries exceed the ceiling of {limit}").into(),
|
||||
Msg::LimitDepth { requested, limit } => format!("resource limit: nesting depth {requested} exceeds the ceiling of {limit}").into(),
|
||||
Msg::OutputNotRetained => "research inspection: no output file was retained".into(),
|
||||
Msg::DryRunDiscarded => "dry run: the produced output was discarded".into(),
|
||||
Msg::TransformNoop => "the transform ran and validated; nothing needed rewriting".into(),
|
||||
Msg::CompanionUnmatched => "a sibling `._` exists but is not this stub's payload".into(),
|
||||
Msg::CompanionUnreadable { reason } => format!("the sibling `._` could not be read: {reason}").into(),
|
||||
Msg::CompanionUnreadableUnknown => "the sibling `._` could not be read".into(),
|
||||
Msg::MetadataLeftUntouched { version } => format!("unsupported metadata version {version}, left untouched").into(),
|
||||
Msg::UnexpectedPanic { message } => format!("unexpected panic: {message}").into(),
|
||||
Msg::InputNotExamined => "input could not be examined".into(),
|
||||
Msg::NoCandidateValidated => "no candidate validated".into(),
|
||||
Msg::NoModule0c => "no module 0x0C for v24.1 metadata".into(),
|
||||
Msg::AmbiguousModule0c => "ambiguous module 0x0C binding".into(),
|
||||
Msg::UnsafePackageEntry { package } => format!("unsafe entry path in package `{package}`").into(),
|
||||
Msg::UnsafeNestedEntry { path } => format!("unsafe entry path in `{path}`").into(),
|
||||
Msg::EntryStubTargetOutsideCode { branch, target } => format!("entry point {branch} target 0x{target:X} is outside executable sections (DD8 selection is likely wrong)").into(),
|
||||
Msg::MissingMz => "missing 'MZ' DOS signature".into(),
|
||||
Msg::TruncatedDosHeader => "truncated DOS header (no e_lfanew)".into(),
|
||||
Msg::MissingPeSignature { offset } => format!("missing 'PE\\0\\0' signature at 0x{offset:X}").into(),
|
||||
Msg::TruncatedCoffHeader => "truncated COFF header".into(),
|
||||
Msg::TruncatedOptionalHeader => "truncated optional header".into(),
|
||||
Msg::BadOptionalMagic { magic } => format!("bad optional-header magic 0x{magic:X}").into(),
|
||||
Msg::ImplausibleSectionCount { count } => format!("implausible section count {count}").into(),
|
||||
Msg::ZeroSizeOfImage => "SizeOfImage is zero".into(),
|
||||
Msg::SectionTablePastEof => "section table extends past end of file".into(),
|
||||
Msg::SectionRawPastEof { index, start, end, file_len } => format!("section #{index} raw data [0x{start:X}..0x{end:X}] exceeds file size 0x{file_len:X}").into(),
|
||||
Msg::NoBaseRelocations => "native DLL has no base relocation table (DD[5] is zero) — will crash when loaded at a non-preferred base".into(),
|
||||
Msg::ZeroEntryPoint => "entry point RVA is zero".into(),
|
||||
Msg::EntryUnmapped { rva } => format!("entry point RVA 0x{rva:X} does not map into any section").into(),
|
||||
Msg::EntryAllZeros { rva } => format!("entry point at RVA 0x{rva:X} is all zeros (stub not recovered)").into(),
|
||||
Msg::EntryAllInt3 { rva } => format!("entry point at RVA 0x{rva:X} is all int3 padding (stub not recovered)").into(),
|
||||
Msg::EntryNotExecutable { rva } => format!("entry point RVA 0x{rva:X} is not in an executable section").into(),
|
||||
Msg::ImportDirectoryUnmapped { rva } => format!("import directory RVA 0x{rva:X} does not map into any section").into(),
|
||||
Msg::ImportNameUnmapped { index, rva } => format!("import descriptor {index} DLL name RVA 0x{rva:X} does not map into any section").into(),
|
||||
Msg::ImportNameUnreadable { index, rva } => format!("import descriptor {index} DLL name at RVA 0x{rva:X} is not readable ASCII (imports left encrypted?)").into(),
|
||||
Msg::ClrDirectoryUnmapped { rva } => format!("CLR (COR20) directory RVA 0x{rva:X} does not map into any section").into(),
|
||||
Msg::ClrHeaderBadSize { rva, size } => format!("COR20 header at RVA 0x{rva:X} has cb 0x{size:X} (expected 0x48) — CLR header corrupt").into(),
|
||||
Msg::ClrMetadataUnmapped { rva } => format!("CLR MetaData RVA 0x{rva:X} does not map into any section").into(),
|
||||
Msg::ClrMetadataNoBsjb { rva } => format!("CLR MetaData at RVA 0x{rva:X} lacks 'BSJB' signature (metadata corrupt — managed image will not load)").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn step(step: &Step) -> Cow<'static, str> {
|
||||
match step {
|
||||
Step::DecryptHeader => "Decrypting file header...".into(),
|
||||
Step::DecryptPayload => "Decrypting payload...".into(),
|
||||
Step::LocateConfig => "Locating config layout...".into(),
|
||||
Step::DecryptStage2 => "Decrypting stage2...".into(),
|
||||
Step::DecryptStages3To5 => "Decrypting stages 3-5...".into(),
|
||||
Step::DecryptSections => "Decrypting section data...".into(),
|
||||
Step::DecryptSectionsNewLayout => "Decrypting section data (new layout)...".into(),
|
||||
Step::LoadSections => "Loading and decompressing sections...".into(),
|
||||
Step::DecryptImports => "Decrypting import strings...".into(),
|
||||
Step::RebuildHeaders => "Reconstructing PE headers...".into(),
|
||||
Step::Pe32LocateConfig => "Locating config layout (PE32)...".into(),
|
||||
Step::Pe32Stages => "Decrypting stages (PE32)...".into(),
|
||||
Step::Pe32EighthStage => "Decrypting eighthStage (PE32)...".into(),
|
||||
Step::Pe32Load => "Loading and decompressing file data (PE32)...".into(),
|
||||
Step::Pe32Text { formula } => {
|
||||
format!("Decrypting .text (PE32 dd8, formula={formula})...").into()
|
||||
}
|
||||
Step::Pe32TextSkip => "Skipping .text dd8 (already plaintext)...".into(),
|
||||
Step::Pe32Imports => "Decrypting import strings (PE32)...".into(),
|
||||
Step::Pe32Rebuild => "Rebuilding PE file layout (PE32)...".into(),
|
||||
Step::InitKeys => "Initializing keys...".into(),
|
||||
Step::DecryptKeyTable => "Decrypting key table...".into(),
|
||||
Step::DecryptPrimary => "Decrypting primary descriptor...".into(),
|
||||
Step::RelocsParams => "Processing relocations & decomp params...".into(),
|
||||
Step::DecryptBlock1 => "Decrypting code block 1 (addr3)...".into(),
|
||||
Step::DecryptBlocks2To3 => "Decrypting code blocks 2-3 (addr3b, addr4)...".into(),
|
||||
Step::DecryptBlock4 => "Decrypting code block 4 (addr5)...".into(),
|
||||
Step::DllSections => "Decrypting & decompressing sections...".into(),
|
||||
Step::FixHeaders => "Fixing up PE header & section table...".into(),
|
||||
Step::AndroidPrimary => "Decoding primary 0x9D target-image container...".into(),
|
||||
Step::AndroidAuxiliary => "Decoding auxiliary 0x9D ELF materialization container...".into(),
|
||||
Step::AndroidTables => "Rebuilding static ELF dynamic-linker tables...".into(),
|
||||
Step::WriteTo { dest } => format!("Write to {dest}").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn term(term: &Term) -> Cow<'static, str> {
|
||||
match term {
|
||||
Term::Ok => "ok",
|
||||
Term::Suspect => "suspect",
|
||||
Term::Recognized => "recognized",
|
||||
Term::NotRecognized => "not recognized",
|
||||
Term::Skipped => "skipped",
|
||||
Term::Error => "error",
|
||||
Term::Restored => "restored",
|
||||
Term::Duplicate => "duplicate",
|
||||
Term::NotTarget => "not target",
|
||||
Term::Unchanged => "unchanged",
|
||||
Term::Inventoried => "inventoried",
|
||||
Term::Failed => "failed",
|
||||
Term::Blocked => "blocked",
|
||||
Term::NotAttempted => "not attempted",
|
||||
Term::Succeeded => "succeeded",
|
||||
Term::Rejected => "rejected",
|
||||
Term::Clean => "clean",
|
||||
Term::Warnings => "warnings",
|
||||
Term::NotRun => "not run",
|
||||
Term::Absent => "absent",
|
||||
Term::Spliced => "spliced",
|
||||
Term::Unmatched => "unmatched",
|
||||
Term::Unreadable => "unreadable",
|
||||
Term::Detection => "detection",
|
||||
Term::ManifestInventory => "manifest inventory",
|
||||
Term::EntryProbe => "entry probe",
|
||||
Term::Recovery => "recovery",
|
||||
Term::StaticValidation => "static validation",
|
||||
Term::OutputWrite => "output write",
|
||||
Term::SharedLibrary => "shared library",
|
||||
Term::Metadata => "metadata",
|
||||
Term::ExeStyle => "exe style",
|
||||
Term::Dll => "dll",
|
||||
Term::AndroidStaged => "android staged",
|
||||
Term::MetadataSeeded => "metadata seeded",
|
||||
Term::MetadataStructural => "metadata structural",
|
||||
Term::MetadataMethodIndices => "metadata method indices",
|
||||
Term::WindowsPe => "windows pe",
|
||||
Term::AndroidElf => "android elf",
|
||||
Term::Il2cppMetadata => "il2cpp metadata",
|
||||
Term::NativeExe => "native exe",
|
||||
Term::ManagedExe => "managed exe",
|
||||
Term::NativeDll => "native dll",
|
||||
Term::ManagedDll => "managed dll",
|
||||
Term::HeaderMagic => "header magic",
|
||||
Term::ExternalCompanionDeclaration => "external companion declaration",
|
||||
Term::CompanionSpliced => "companion spliced",
|
||||
Term::PrivateSection => "private section",
|
||||
Term::AesSchedule => "aes schedule",
|
||||
Term::ValidatedMetadataTransform => "validated metadata transform",
|
||||
Term::Known => "known",
|
||||
Term::ContextRequired => "context required",
|
||||
Term::Unverified => "unverified",
|
||||
Term::Original => "original",
|
||||
Term::SplicedCompanion => "spliced companion",
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
pub(crate) fn cli(cli: &Cli) -> Cow<'static, str> {
|
||||
match cli {
|
||||
Cli::Error => "error".into(),
|
||||
Cli::Warning => "warning".into(),
|
||||
Cli::DoneIn { ms } => format!("done in {ms} ms").into(),
|
||||
Cli::PressEnter => "\nPress Enter to exit…".into(),
|
||||
Cli::ScanUnreadable { count } => format!("{count} file(s) could not be read during the scan and may be missed targets").into(),
|
||||
Cli::Summary { unpacked, skipped, errors, suspect, metadata } => format!("{unpacked} unpacked · {skipped} skipped · {errors} errors · {suspect} suspect · {metadata} metadata").into(),
|
||||
Cli::SummaryPackages { packages } => format!(" · {packages} packages").into(),
|
||||
Cli::IntegrityFailed => "integrity check failed".into(),
|
||||
Cli::IntegrityFailedLikelyCrash => "! integrity check failed (likely to crash at runtime)".into(),
|
||||
Cli::MetadataLine { rel, dest, remapped } => format!("metadata {rel} -> {dest} ({remapped} method fields remapped)").into(),
|
||||
Cli::MetadataVersionLine { version, dest, remapped } => format!("metadata v{version} -> {dest} ({remapped} method fields remapped)").into(),
|
||||
Cli::MetadataAlreadyClean { version } => format!("metadata v{version}:").into(),
|
||||
Cli::MetadataNothingToDo => "already de-obfuscated, nothing to do".into(),
|
||||
Cli::EmbeddedMetadataLine { input, dest } => format!("metadata {input} (embedded) -> {dest}").into(),
|
||||
Cli::EmbeddedMetadataFailed => "embedded metadata".into(),
|
||||
Cli::MetadataUnsupportedLine { version } => format!("unsupported metadata version {version}, left untouched").into(),
|
||||
Cli::OutRequiresDirectory => "--out requires a directory argument".into(),
|
||||
Cli::UnknownOption { option } => format!("unknown option '{option}'").into(),
|
||||
Cli::MultipleInputs { first, second } => format!("multiple input paths given ('{first}' and '{second}')").into(),
|
||||
Cli::SubcommandNeedsPath { subcommand } => format!("'{subcommand}' requires an input path").into(),
|
||||
Cli::InspectNoDryRun => "'inspect' writes nothing; drop --dry-run".into(),
|
||||
Cli::InspectNoOut => "'inspect' writes nothing; --out is not allowed".into(),
|
||||
Cli::DryRunNoOut => "--dry-run writes no output; --out is not allowed".into(),
|
||||
Cli::ColorRequiresMode => "--color requires auto, always, or never".into(),
|
||||
Cli::ThreadsRequiresInteger => "--threads requires a positive integer argument".into(),
|
||||
Cli::LimitRequiresInteger { flag } => format!("{flag} requires an unsigned integer argument").into(),
|
||||
Cli::LimitMustBePositive { flag } => format!("{flag} must be greater than zero").into(),
|
||||
Cli::LimitTooLarge { flag } => format!("{flag} exceeds the supported byte range").into(),
|
||||
Cli::UnknownLimit { flag } => format!("unknown resource option '{flag}'").into(),
|
||||
Cli::HelpPath => " <file|folder>\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'."
|
||||
.into(),
|
||||
Cli::HelpInspect => " inspect PATH\n\
|
||||
\x20 run the real static recovery for research, and report\n\
|
||||
\x20 everything observed: recognition evidence, each route\n\
|
||||
\x20 tried and why it was rejected, the route selected, the\n\
|
||||
\x20 static check's verdict, and the engines' own structural\n\
|
||||
\x20 evidence (protected-header fields, seeds, module records,\n\
|
||||
\x20 restored-image facts). Nothing is kept: no output file,\n\
|
||||
\x20 no log, no temporary tree, and the input is never run."
|
||||
.into(),
|
||||
Cli::HelpUnpack => " unpack PATH detection and recovery; writes outputs (the default).".into(),
|
||||
Cli::HelpJson => " --json write one versioned machine-readable report to stdout and\n\
|
||||
\x20 nothing else. Implies quiet and --no-log."
|
||||
.into(),
|
||||
Cli::HelpDryRun => " --dry-run run the real recovery but keep nothing: no output tree and\n\
|
||||
\x20 no log. Android extraction still uses its own temporary\n\
|
||||
\x20 workspace, which is discarded."
|
||||
.into(),
|
||||
Cli::HelpThreads => " --threads N positive worker cap for this run. Overrides SENBEI_THREADS;\n\
|
||||
\x20 1 selects the sequential path. The environment is unchanged."
|
||||
.into(),
|
||||
Cli::HelpColor => " --color MODE auto (default), always, or never; --color=MODE also works.\n\
|
||||
\x20 Auto colors terminal stdout/stderr separately, unless\n\
|
||||
\x20 NO_COLOR is nonempty or TERM=dumb. Explicit always/never\n\
|
||||
\x20 override these variables. JSON and saved logs stay plain."
|
||||
.into(),
|
||||
Cli::HelpScanAll => " --scan-all probe selected .exe/.dll/.so/metadata names below the\n\
|
||||
\x20 size floor; other filenames remain excluded."
|
||||
.into(),
|
||||
Cli::HelpStrictIntegrity => " --strict-integrity\n\
|
||||
\x20 exit non-zero when any output fails the static integrity\n\
|
||||
\x20 check (a suspect) or a file errors. Off by default: a\n\
|
||||
\x20 suspect is still written and the process exits 0 unless\n\
|
||||
\x20 a file errors. Quiet levels are unchanged.\n\
|
||||
\x20 With 'inspect', the check applies to the image actually\n\
|
||||
\x20 recovered for research; no output file is retained."
|
||||
.into(),
|
||||
Cli::HelpLimits { entry_mib, total_mib, entries, depth } => format!(
|
||||
" Android resource limits (MiB = 1048576 bytes):\n\
|
||||
\x20 --max-entry-mib N single archive entry/decoded buffer/output (default {entry_mib})\n\
|
||||
\x20 --max-total-mib N cumulative archive bytes and per-engine task budget (default {total_mib})\n\
|
||||
\x20 --max-entries N archive entries/stage-2 records (default {entries})\n\
|
||||
\x20 --max-depth N nesting depth, root = 0 (default {depth})\n\
|
||||
\x20 Limits are checked before extraction/allocation; they are not a peak-RSS cap."
|
||||
)
|
||||
.into(),
|
||||
Cli::HelpExitCodes => " Exit codes: 0 success, 1 a target failed (or a suspect with\n\
|
||||
\x20 --strict-integrity), 2 the command line was rejected."
|
||||
.into(),
|
||||
Cli::ReportScanHeading => "scan".into(),
|
||||
Cli::ReportScan { skipped, walk_errors, probe_errors } => format!("{skipped} probed non-targets · {walk_errors} walk errors · {probe_errors} probe errors").into(),
|
||||
Cli::ReportScanIncomplete => "analysis is incomplete; some directory entries or selected files could not be examined".into(),
|
||||
Cli::AnalysisIncomplete => "analysis incomplete".into(),
|
||||
Cli::AnalysisIncompleteInput => "I/O, resource limits or infrastructure prevented the requested work".into(),
|
||||
Cli::AnalysisIncompleteEntry => "requested entry analysis could not finish".into(),
|
||||
Cli::Source { size } => format!("source: {size} bytes (0x{size:X})").into(),
|
||||
Cli::Target { platform, format, kind } => format!("target: {platform} · {format} · {kind}").into(),
|
||||
Cli::FormatUnavailable => "format unavailable".into(),
|
||||
Cli::KindUnavailable => "kind not applicable or unavailable".into(),
|
||||
Cli::ProtectionRecognition { status } => format!("protection recognition: {status}").into(),
|
||||
Cli::Evidence { evidence } => format!("evidence: {evidence}").into(),
|
||||
Cli::Route { route, outcome } => format!("route {route}: {outcome}").into(),
|
||||
Cli::SelectedRoute { route } => format!("selected route: {route}").into(),
|
||||
Cli::StaticRecovery { status } => format!("static recovery: {status}").into(),
|
||||
Cli::OutputValidation { status } => format!("output static validation: {status}").into(),
|
||||
Cli::Companion { state } => format!("companion: {state}").into(),
|
||||
Cli::CompanionIdentity { size, sha256 } => format!("{size} bytes · SHA-256 {sha256}").into(),
|
||||
Cli::InputView { view } => format!("analysis input view: {view}").into(),
|
||||
Cli::InputViewSplicedNote => "file offsets below 0x1000 address the stub; offsets at/above 0x1000 address companion offset (file offset - 0x1000)".into(),
|
||||
Cli::MetadataIdentity { version, layout } => format!("IL2CPP metadata version: {version} · layout definition {layout}").into(),
|
||||
Cli::SeededTokens { value } => format!("seeded method tokens: {value}").into(),
|
||||
Cli::StructuralTokens { value } => format!("structural method tokens: {value}").into(),
|
||||
Cli::MethodIndexRestore { value, context } => format!("method-index restoration: {value} · application context required: {context}").into(),
|
||||
Cli::Container { kind, entries, manifests } => format!("container: {kind} · {entries} entries · {manifests} manifests").into(),
|
||||
Cli::Manifest { source, package, version } => format!("manifest {source} → {package} {version}").into(),
|
||||
Cli::Unnamed => "<unnamed>".into(),
|
||||
Cli::Candidate { entry } => format!("candidate: {entry}").into(),
|
||||
Cli::MetadataEvidence => "metadata transform evidence".into(),
|
||||
Cli::Entry { name, status } => format!("entry {name}: {status}").into(),
|
||||
Cli::EntryRoute { route } => format!("route: {route}").into(),
|
||||
Cli::EntryMetadataVersion { version } => format!("metadata version: {version}").into(),
|
||||
Cli::EntryRemapped { remapped } => format!("remapped method fields: {remapped}").into(),
|
||||
Cli::ModuleContextSource { source } => format!("module context source: {source}").into(),
|
||||
Cli::StageLine { stage, status } => format!("stage {stage}: {status}").into(),
|
||||
Cli::Recovered { size, sha256 } => format!("recovered: {size} bytes · SHA-256 {sha256}").into(),
|
||||
Cli::InspectionStatus { status, ms } => format!("inspection status: {status} · {ms} ms").into(),
|
||||
Cli::DiagnosticWarning => "warning".into(),
|
||||
Cli::DiagnosticError => "error".into(),
|
||||
Cli::DiagnosticReason => "reason".into(),
|
||||
Cli::DiagnosticDetail => "detail".into(),
|
||||
Cli::DiagnosticEnglish => "in English".into(),
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,302 @@
|
||||
//! Japanese (`ja`): console and report wording for Senbei.
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{Cli, Msg, Step, Term};
|
||||
|
||||
pub(crate) fn msg(msg: &Msg) -> Cow<'static, str> {
|
||||
match msg {
|
||||
Msg::CompanionMissing => "コンパニオンが見つからない可能性があります。このローダーには対応する<input>._ペイロードが必要です。入力ファイルの隣に配置して再試行してください。".into(),
|
||||
Msg::CompanionMismatch => "コンパニオンが一致しません。指定された._ペイロードが短すぎるか、ヘッダーがローダーと異なります。同じビルドのコンパニオンを使用してください (いずれかのファイルが破損している可能性があります)。".into(),
|
||||
Msg::InputTooShort { actual, required } => format!("入力が短すぎます (最低{required}バイト必要ですが、{actual}バイトです)").into(),
|
||||
Msg::NotProtected => "CrackProofで保護されたファイルではありません".into(),
|
||||
Msg::InvalidPeOffset { offset, input_len } => format!("{input_len}バイトの入力に対する無効なPEヘッダーオフセット{offset}").into(),
|
||||
Msg::DllNeedsPe32Plus { found } => format!("DLLパイプラインにはPE32+のオプショナルヘッダーマジックが必要ですが、0x{found:04X}が検出されました").into(),
|
||||
Msg::LayoutUnsupported => "stage5マーカーが見つかりません — このビルドのレイアウトはこのアンパッカーでは非対応です".into(),
|
||||
Msg::InternalPanic { file, line, column, message } => format!("{file}:{line}:{column}で内部パニックが発生しました: {message}").into(),
|
||||
Msg::DecodeFailed => "保護データが想定どおりにデコードされませんでした。ファイルが破損しているか、このビルドのレイアウトに非対応です".into(),
|
||||
Msg::NotPe => "入力はPEイメージではありません".into(),
|
||||
Msg::NotElf64 => "入力はELF64リトルエンディアンイメージではありません".into(),
|
||||
Msg::NotAarch64 => "入力はAArch64イメージではありません".into(),
|
||||
Msg::NotMetadata => "il2cppのglobal-metadata.datではありません".into(),
|
||||
Msg::NotIl2cppMetadata => "IL2CPPのglobal-metadata.datではありません".into(),
|
||||
Msg::UnsupportedMetadataVersion { version } => format!("非対応のメタデータバージョン{version}").into(),
|
||||
Msg::MetadataTransformFailed => "メタデータ変換の検証に失敗しました".into(),
|
||||
Msg::LimitEntry { requested, limit } => format!("リソース上限: {requested}バイトのエントリが{limit}バイトの上限を超えています").into(),
|
||||
Msg::LimitTotal { requested, adding, limit } => format!("リソース上限: タスク合計{requested}バイトが{limit}バイトの上限を超えています ({adding}バイトの追加時)").into(),
|
||||
Msg::LimitEntries { requested, limit } => format!("リソース上限: エントリ数{requested}が上限の{limit}を超えています").into(),
|
||||
Msg::LimitDepth { requested, limit } => format!("リソース上限: ネスト深さ{requested}が上限の{limit}を超えています").into(),
|
||||
Msg::OutputNotRetained => "調査用の検査: 出力ファイルは保存されませんでした".into(),
|
||||
Msg::DryRunDiscarded => "ドライラン: 生成された出力は破棄されました".into(),
|
||||
Msg::TransformNoop => "変換を実行・検証しましたが、書き換えが必要な箇所はありませんでした".into(),
|
||||
Msg::CompanionUnmatched => "同じフォルダーに`._`ファイルがありますが、このスタブのペイロードではありません".into(),
|
||||
Msg::CompanionUnreadable { reason } => format!("同じフォルダーの`._`ファイルを読み取れませんでした: {reason}").into(),
|
||||
Msg::CompanionUnreadableUnknown => "同じフォルダーの`._`ファイルを読み取れませんでした".into(),
|
||||
Msg::MetadataLeftUntouched { version } => format!("非対応のメタデータバージョン{version}のため、変更せずにそのまま残しました").into(),
|
||||
Msg::UnexpectedPanic { message } => format!("予期しないパニック: {message}").into(),
|
||||
Msg::InputNotExamined => "入力を調査できませんでした".into(),
|
||||
Msg::NoCandidateValidated => "検証を通過した候補がありません".into(),
|
||||
Msg::NoModule0c => "v24.1メタデータ用のモジュール0x0Cがありません".into(),
|
||||
Msg::AmbiguousModule0c => "モジュール0x0Cの対応付けが曖昧です".into(),
|
||||
Msg::UnsafePackageEntry { package } => format!("パッケージ`{package}`内に安全でないエントリパスがあります").into(),
|
||||
Msg::UnsafeNestedEntry { path } => format!("`{path}`内に安全でないエントリパスがあります").into(),
|
||||
Msg::EntryStubTargetOutsideCode { branch, target } => format!("エントリポイントの{branch}先0x{target:X}が実行可能セクション外にあります (DD8の選択が誤っている可能性があります)").into(),
|
||||
Msg::MissingMz => "'MZ' DOSシグネチャがありません".into(),
|
||||
Msg::TruncatedDosHeader => "DOSヘッダーが切り詰められています (e_lfanewがありません)".into(),
|
||||
Msg::MissingPeSignature { offset } => format!("0x{offset:X}に'PE\\0\\0'シグネチャがありません").into(),
|
||||
Msg::TruncatedCoffHeader => "COFFヘッダーが切り詰められています".into(),
|
||||
Msg::TruncatedOptionalHeader => "オプショナルヘッダーが切り詰められています".into(),
|
||||
Msg::BadOptionalMagic { magic } => format!("不正なオプショナルヘッダーマジック0x{magic:X}").into(),
|
||||
Msg::ImplausibleSectionCount { count } => format!("セクション数{count}が不自然です").into(),
|
||||
Msg::ZeroSizeOfImage => "SizeOfImageがゼロです".into(),
|
||||
Msg::SectionTablePastEof => "セクションテーブルがファイル終端を超えています".into(),
|
||||
Msg::SectionRawPastEof { index, start, end, file_len } => format!("セクション#{index}のファイル内データ[0x{start:X}..0x{end:X}]がファイルサイズ0x{file_len:X}を超えています").into(),
|
||||
Msg::NoBaseRelocations => "ネイティブDLLにベース再配置テーブルがありません (DD[5]がゼロです) — 推奨ベース以外にロードされるとクラッシュします".into(),
|
||||
Msg::ZeroEntryPoint => "エントリポイントRVAがゼロです".into(),
|
||||
Msg::EntryUnmapped { rva } => format!("エントリポイントRVA 0x{rva:X}がどのセクションにもマップされていません").into(),
|
||||
Msg::EntryAllZeros { rva } => format!("RVA 0x{rva:X}のエントリポイントがすべてゼロです (スタブが復元されていません)").into(),
|
||||
Msg::EntryAllInt3 { rva } => format!("RVA 0x{rva:X}のエントリポイントがすべてint3パディングです (スタブが復元されていません)").into(),
|
||||
Msg::EntryNotExecutable { rva } => format!("エントリポイントRVA 0x{rva:X}が実行可能セクション内にありません").into(),
|
||||
Msg::ImportDirectoryUnmapped { rva } => format!("インポートディレクトリRVA 0x{rva:X}がどのセクションにもマップされていません").into(),
|
||||
Msg::ImportNameUnmapped { index, rva } => format!("インポート記述子{index}のDLL名RVA 0x{rva:X}がどのセクションにもマップされていません").into(),
|
||||
Msg::ImportNameUnreadable { index, rva } => format!("インポート記述子{index}のRVA 0x{rva:X}にあるDLL名が読み取り可能なASCIIではありません (インポートが暗号化されたままの可能性があります)").into(),
|
||||
Msg::ClrDirectoryUnmapped { rva } => format!("CLR (COR20) ディレクトリRVA 0x{rva:X}がどのセクションにもマップされていません").into(),
|
||||
Msg::ClrHeaderBadSize { rva, size } => format!("RVA 0x{rva:X}のCOR20ヘッダーのcbが0x{size:X}です (期待値は0x48) — CLRヘッダーが破損しています").into(),
|
||||
Msg::ClrMetadataUnmapped { rva } => format!("CLR MetaData RVA 0x{rva:X}がどのセクションにもマップされていません").into(),
|
||||
Msg::ClrMetadataNoBsjb { rva } => format!("RVA 0x{rva:X}のCLR MetaDataに'BSJB'シグネチャがありません (メタデータが破損しています — マネージドイメージはロードされません)").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn step(step: &Step) -> Cow<'static, str> {
|
||||
match step {
|
||||
Step::DecryptHeader => "ファイルヘッダーを復号中...".into(),
|
||||
Step::DecryptPayload => "ペイロードを復号中...".into(),
|
||||
Step::LocateConfig => "構成レイアウトを特定中...".into(),
|
||||
Step::DecryptStage2 => "stage2を復号中...".into(),
|
||||
Step::DecryptStages3To5 => "ステージ3-5を復号中...".into(),
|
||||
Step::DecryptSections => "セクションデータを復号中...".into(),
|
||||
Step::DecryptSectionsNewLayout => "セクションデータを復号中 (新レイアウト)...".into(),
|
||||
Step::LoadSections => "セクションを読み込み・展開中...".into(),
|
||||
Step::DecryptImports => "インポート文字列を復号中...".into(),
|
||||
Step::RebuildHeaders => "PEヘッダーを再構築中...".into(),
|
||||
Step::Pe32LocateConfig => "構成レイアウトを特定中 (PE32)...".into(),
|
||||
Step::Pe32Stages => "ステージを復号中 (PE32)...".into(),
|
||||
Step::Pe32EighthStage => "eighthStageを復号中 (PE32)...".into(),
|
||||
Step::Pe32Load => "ファイルデータを読み込み・展開中 (PE32)...".into(),
|
||||
Step::Pe32Text { formula } => {
|
||||
format!(".textを復号中 (PE32 dd8, formula={formula})...").into()
|
||||
}
|
||||
Step::Pe32TextSkip => ".text dd8をスキップ中 (すでに平文)...".into(),
|
||||
Step::Pe32Imports => "インポート文字列を復号中 (PE32)...".into(),
|
||||
Step::Pe32Rebuild => "PEファイルレイアウトを再構築中 (PE32)...".into(),
|
||||
Step::InitKeys => "鍵を初期化中...".into(),
|
||||
Step::DecryptKeyTable => "鍵テーブルを復号中...".into(),
|
||||
Step::DecryptPrimary => "プライマリ記述子を復号中...".into(),
|
||||
Step::RelocsParams => "再配置と展開パラメーターを処理中...".into(),
|
||||
Step::DecryptBlock1 => "コードブロック1 (addr3) を復号中...".into(),
|
||||
Step::DecryptBlocks2To3 => "コードブロック2-3 (addr3b, addr4) を復号中...".into(),
|
||||
Step::DecryptBlock4 => "コードブロック4 (addr5) を復号中...".into(),
|
||||
Step::DllSections => "セクションを復号・展開中...".into(),
|
||||
Step::FixHeaders => "PEヘッダーとセクションテーブルを修正中...".into(),
|
||||
Step::AndroidPrimary => "プライマリ0x9D対象イメージコンテナーをデコード中...".into(),
|
||||
Step::AndroidAuxiliary => "補助0x9D ELF実体化コンテナーをデコード中...".into(),
|
||||
Step::AndroidTables => "静的ELF動的リンカーテーブルを再構築中...".into(),
|
||||
Step::WriteTo { dest } => format!("{dest}に書き込み").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn term(term: &Term) -> Cow<'static, str> {
|
||||
match term {
|
||||
Term::Ok => "正常",
|
||||
Term::Suspect => "要注意",
|
||||
Term::Recognized => "認識済み",
|
||||
Term::NotRecognized => "未認識",
|
||||
Term::Skipped => "スキップ",
|
||||
Term::Error => "エラー",
|
||||
Term::Restored => "復元済み",
|
||||
Term::Duplicate => "重複",
|
||||
Term::NotTarget => "対象外",
|
||||
Term::Unchanged => "変更なし",
|
||||
Term::Inventoried => "記載のみ",
|
||||
Term::Failed => "失敗",
|
||||
Term::Blocked => "ブロック",
|
||||
Term::NotAttempted => "未試行",
|
||||
Term::Succeeded => "成功",
|
||||
Term::Rejected => "却下",
|
||||
Term::Clean => "問題なし",
|
||||
Term::Warnings => "警告あり",
|
||||
Term::NotRun => "未実行",
|
||||
Term::Absent => "なし",
|
||||
Term::Spliced => "連結済み",
|
||||
Term::Unmatched => "不一致",
|
||||
Term::Unreadable => "読み取り不能",
|
||||
Term::Detection => "検出",
|
||||
Term::ManifestInventory => "マニフェスト一覧化",
|
||||
Term::EntryProbe => "エントリプローブ",
|
||||
Term::Recovery => "復元",
|
||||
Term::StaticValidation => "静的検証",
|
||||
Term::OutputWrite => "出力書き込み",
|
||||
Term::SharedLibrary => "共有ライブラリ",
|
||||
Term::Metadata => "メタデータ",
|
||||
Term::ExeStyle => "EXE形式",
|
||||
Term::Dll => "DLL",
|
||||
Term::AndroidStaged => "Android段階型",
|
||||
Term::MetadataSeeded => "シード方式メタデータ",
|
||||
Term::MetadataStructural => "構造方式メタデータ",
|
||||
Term::MetadataMethodIndices => "メタデータメソッドインデックス",
|
||||
Term::WindowsPe => "Windows PE",
|
||||
Term::AndroidElf => "Android ELF",
|
||||
Term::Il2cppMetadata => "il2cppメタデータ",
|
||||
Term::NativeExe => "ネイティブEXE",
|
||||
Term::ManagedExe => "マネージドEXE",
|
||||
Term::NativeDll => "ネイティブDLL",
|
||||
Term::ManagedDll => "マネージドDLL",
|
||||
Term::HeaderMagic => "ヘッダーマジック",
|
||||
Term::ExternalCompanionDeclaration => "外部コンパニオン宣言",
|
||||
Term::CompanionSpliced => "コンパニオン連結",
|
||||
Term::PrivateSection => "専用セクション",
|
||||
Term::AesSchedule => "AES鍵スケジュール",
|
||||
Term::ValidatedMetadataTransform => "検証済みメタデータ変換",
|
||||
Term::Known => "既知",
|
||||
Term::ContextRequired => "コンテキストが必要",
|
||||
Term::Unverified => "未検証",
|
||||
Term::Original => "元ファイル",
|
||||
Term::SplicedCompanion => "連結コンパニオン",
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
pub(crate) fn cli(cli: &Cli) -> Cow<'static, str> {
|
||||
match cli {
|
||||
Cli::Error => "エラー".into(),
|
||||
Cli::Warning => "警告".into(),
|
||||
Cli::DoneIn { ms } => format!("{ms} msで完了").into(),
|
||||
Cli::PressEnter => "\nEnterキーを押して終了…".into(),
|
||||
Cli::ScanUnreadable { count } => format!("スキャン中に{count}個のファイルを読み取れませんでした。対象が見落とされた可能性があります").into(),
|
||||
Cli::Summary { unpacked, skipped, errors, suspect, metadata } => format!("アンパック済み {unpacked} · スキップ {skipped} · エラー {errors} · 要注意 {suspect} · メタデータ {metadata}").into(),
|
||||
Cli::SummaryPackages { packages } => format!(" · パッケージ {packages}").into(),
|
||||
Cli::IntegrityFailed => "整合性検査に失敗しました".into(),
|
||||
Cli::IntegrityFailedLikelyCrash => "! 整合性検査に失敗しました (実行時にクラッシュする可能性が高いです)".into(),
|
||||
Cli::MetadataLine { rel, dest, remapped } => format!("メタデータ {rel} -> {dest} (再マップされたメソッドフィールド: {remapped})").into(),
|
||||
Cli::MetadataVersionLine { version, dest, remapped } => format!("メタデータ v{version} -> {dest} (再マップされたメソッドフィールド: {remapped})").into(),
|
||||
Cli::MetadataAlreadyClean { version } => format!("メタデータ v{version}:").into(),
|
||||
Cli::MetadataNothingToDo => "難読化解除済みのため、処理は不要です".into(),
|
||||
Cli::EmbeddedMetadataLine { input, dest } => format!("メタデータ {input} (埋め込み) -> {dest}").into(),
|
||||
Cli::EmbeddedMetadataFailed => "埋め込みメタデータ".into(),
|
||||
Cli::MetadataUnsupportedLine { version } => format!("非対応のメタデータバージョン{version}のため、変更せずにそのまま残しました").into(),
|
||||
Cli::OutRequiresDirectory => "--outにはディレクトリ引数が必要です".into(),
|
||||
Cli::UnknownOption { option } => format!("不明なオプション '{option}'").into(),
|
||||
Cli::MultipleInputs { first, second } => format!("複数の入力パスが指定されています ('{first}' と '{second}')").into(),
|
||||
Cli::SubcommandNeedsPath { subcommand } => format!("'{subcommand}' には入力パスが必要です").into(),
|
||||
Cli::InspectNoDryRun => "'inspect' は何も書き込まないため、--dry-runは不要です".into(),
|
||||
Cli::InspectNoOut => "'inspect' は何も書き込まないため、--outは指定できません".into(),
|
||||
Cli::DryRunNoOut => "--dry-runは何も出力しないため、--outは指定できません".into(),
|
||||
Cli::ColorRequiresMode => "--colorにはauto、always、またはneverが必要です".into(),
|
||||
Cli::ThreadsRequiresInteger => "--threadsには正の整数引数が必要です".into(),
|
||||
Cli::LimitRequiresInteger { flag } => format!("{flag}には符号なし整数引数が必要です").into(),
|
||||
Cli::LimitMustBePositive { flag } => format!("{flag}は0より大きい必要があります").into(),
|
||||
Cli::LimitTooLarge { flag } => format!("{flag}が対応バイト範囲を超えています").into(),
|
||||
Cli::UnknownLimit { flag } => format!("不明なリソースオプション '{flag}'").into(),
|
||||
Cli::HelpPath => " <file|folder>\n\
|
||||
\x20 CrackProof PE (.exe/.dll)、il2cpp global-metadata.dat、\n\
|
||||
\x20 保護されたAndroid AArch64ライブラリ (.so)、Androidアプリ\n\
|
||||
\x20 パッケージ (.apk/.apks/.xapk)、またはそれらを含むフォルダー。\n\
|
||||
\x20 サブコマンド省略時は 'unpack' と同じです。"
|
||||
.into(),
|
||||
Cli::HelpInspect => " inspect PATH\n\
|
||||
\x20 調査用に実際の静的復元を実行し、観測されたすべての内容を\n\
|
||||
\x20 報告します: 認識の根拠、試行した各ルートと却下理由、選択された\n\
|
||||
\x20 ルート、静的検証の判定、およびエンジン自身の構造的根拠\n\
|
||||
\x20 (保護ヘッダーフィールド、シード、モジュールレコード、復元\n\
|
||||
\x20 イメージの情報)。出力ファイル、ログ、一時ツリーは一切保存されず、\n\
|
||||
\x20 入力が実行されることもありません。"
|
||||
.into(),
|
||||
Cli::HelpUnpack => " unpack PATH 検出と復元を行い、出力を書き込みます (既定)。".into(),
|
||||
Cli::HelpJson => " --json バージョン付きの機械可読レポート1件のみを標準出力に書き込みます。\n\
|
||||
\x20 quietおよび--no-logが暗黙に有効になります。"
|
||||
.into(),
|
||||
Cli::HelpDryRun => " --dry-run 実際の復元を実行しますが、出力ツリーもログも保存しません。\n\
|
||||
\x20 Androidの抽出では専用の一時ワークスペースを使用しますが、\n\
|
||||
\x20 処理後に破棄されます。"
|
||||
.into(),
|
||||
Cli::HelpThreads => " --threads N この実行での正のワーカースレッド数上限。SENBEI_THREADSを\n\
|
||||
\x20 上書きし、1で逐次処理を選択します。環境変数は変更されません。"
|
||||
.into(),
|
||||
Cli::HelpColor => " --color MODE auto (既定)、always、またはnever (--color=MODEも可)。\n\
|
||||
\x20 autoは、NO_COLORが空でない場合やTERM=dumbの場合を除き、\n\
|
||||
\x20 端末の標準出力と標準エラーを個別に色付けします。明示的な\n\
|
||||
\x20 always/neverはこれらの変数を上書きします。JSONと保存される\n\
|
||||
\x20 ログは常にプレーンテキストのままです。"
|
||||
.into(),
|
||||
Cli::HelpScanAll => " --scan-all サイズ下限未満の対象名 (.exe/.dll/.so/メタデータ) も\n\
|
||||
\x20 プローブします。それ以外のファイル名は引き続き除外されます。"
|
||||
.into(),
|
||||
Cli::HelpStrictIntegrity => " --strict-integrity\n\
|
||||
\x20 いずれかの出力が静的整合性検査に失敗した場合 (要注意) または\n\
|
||||
\x20 ファイルエラー時に非ゼロで終了します。既定ではオフです:\n\
|
||||
\x20 要注意でもファイルは書き込まれ、エラーがない限り終了コード0で\n\
|
||||
\x20 終了します。quietレベルは変更されません。\n\
|
||||
\x20 'inspect' 時は調査用に復元されたイメージに対して検査を行い、\n\
|
||||
\x20 出力ファイルは保存されません。"
|
||||
.into(),
|
||||
Cli::HelpLimits { entry_mib, total_mib, entries, depth } => format!(
|
||||
" Androidのリソース上限 (MiB = 1048576バイト):\n\
|
||||
\x20 --max-entry-mib N 単一アーカイブエントリ/デコード済みバッファー/出力 (既定 {entry_mib})\n\
|
||||
\x20 --max-total-mib N 累積アーカイブバイト数・エンジン別タスクバジェット (既定 {total_mib})\n\
|
||||
\x20 --max-entries N アーカイブエントリ/ステージ2レコード数 (既定 {entries})\n\
|
||||
\x20 --max-depth N ネスト深さ、ルート = 0 (既定 {depth})\n\
|
||||
\x20 上限は展開・割り当て前に検査されます。ピークRSSの上限ではありません。"
|
||||
)
|
||||
.into(),
|
||||
Cli::HelpExitCodes => " 終了コード: 0 成功、1 対象の失敗 (--strict-integrity時の要注意を含む)、\n\
|
||||
\x20 2 コマンドライン引数の却下。"
|
||||
.into(),
|
||||
Cli::ReportScanHeading => "スキャン".into(),
|
||||
Cli::ReportScan { skipped, walk_errors, probe_errors } => format!("プローブした対象外 {skipped} · 走査エラー {walk_errors} · プローブエラー {probe_errors}").into(),
|
||||
Cli::ReportScanIncomplete => "解析が不完全です。一部のディレクトリ項目または選択したファイルを調査できませんでした".into(),
|
||||
Cli::AnalysisIncomplete => "解析不完全".into(),
|
||||
Cli::AnalysisIncompleteInput => "I/O、リソース上限、または基盤の問題により要求された処理を完了できませんでした".into(),
|
||||
Cli::AnalysisIncompleteEntry => "要求されたエントリの解析を完了できませんでした".into(),
|
||||
Cli::Source { size } => format!("入力: {size}バイト (0x{size:X})").into(),
|
||||
Cli::Target { platform, format, kind } => format!("対象: {platform} · {format} · {kind}").into(),
|
||||
Cli::FormatUnavailable => "フォーマット不明".into(),
|
||||
Cli::KindUnavailable => "種類は該当なしまたは不明".into(),
|
||||
Cli::ProtectionRecognition { status } => format!("保護認識: {status}").into(),
|
||||
Cli::Evidence { evidence } => format!("根拠: {evidence}").into(),
|
||||
Cli::Route { route, outcome } => format!("ルート {route}: {outcome}").into(),
|
||||
Cli::SelectedRoute { route } => format!("選択ルート: {route}").into(),
|
||||
Cli::StaticRecovery { status } => format!("静的復元: {status}").into(),
|
||||
Cli::OutputValidation { status } => format!("出力の静的検証: {status}").into(),
|
||||
Cli::Companion { state } => format!("コンパニオン: {state}").into(),
|
||||
Cli::CompanionIdentity { size, sha256 } => format!("{size}バイト · SHA-256 {sha256}").into(),
|
||||
Cli::InputView { view } => format!("解析入力ビュー: {view}").into(),
|
||||
Cli::InputViewSplicedNote => "0x1000未満のファイルオフセットはスタブを、0x1000以上のオフセットはコンパニオンのオフセット (ファイルオフセット - 0x1000) を指します".into(),
|
||||
Cli::MetadataIdentity { version, layout } => format!("IL2CPPメタデータバージョン: {version} · レイアウト定義 {layout}").into(),
|
||||
Cli::SeededTokens { value } => format!("シード方式のメソッドトークン: {}", yes_no(*value)).into(),
|
||||
Cli::StructuralTokens { value } => format!("構造方式のメソッドトークン: {}", yes_no(*value)).into(),
|
||||
Cli::MethodIndexRestore { value, context } => format!("メソッドインデックス復元: {} · アプリケーションコンテキストが必要: {}", yes_no(*value), yes_no(*context)).into(),
|
||||
Cli::Container { kind, entries, manifests } => format!("コンテナー: {kind} · エントリ {entries} · マニフェスト {manifests}").into(),
|
||||
Cli::Manifest { source, package, version } => format!("マニフェスト {source} → {package} {version}").into(),
|
||||
Cli::Unnamed => "<unnamed>".into(),
|
||||
Cli::Candidate { entry } => format!("候補: {entry}").into(),
|
||||
Cli::MetadataEvidence => "メタデータ変換の根拠".into(),
|
||||
Cli::Entry { name, status } => format!("エントリ {name}: {status}").into(),
|
||||
Cli::EntryRoute { route } => format!("ルート: {route}").into(),
|
||||
Cli::EntryMetadataVersion { version } => format!("メタデータバージョン: {version}").into(),
|
||||
Cli::EntryRemapped { remapped } => format!("再マップされたメソッドフィールド: {remapped}").into(),
|
||||
Cli::ModuleContextSource { source } => format!("モジュールコンテキストの取得元: {source}").into(),
|
||||
Cli::StageLine { stage, status } => format!("ステージ {stage}: {status}").into(),
|
||||
Cli::Recovered { size, sha256 } => format!("復元イメージ: {size}バイト · SHA-256 {sha256}").into(),
|
||||
Cli::InspectionStatus { status, ms } => format!("検査状態: {status} · {ms} ms").into(),
|
||||
Cli::DiagnosticWarning => "警告".into(),
|
||||
Cli::DiagnosticError => "エラー".into(),
|
||||
Cli::DiagnosticReason => "理由".into(),
|
||||
Cli::DiagnosticDetail => "詳細".into(),
|
||||
Cli::DiagnosticEnglish => "英語原文".into(),
|
||||
}
|
||||
}
|
||||
|
||||
/// A capability flag as a word of this language.
|
||||
fn yes_no(value: bool) -> &'static str {
|
||||
if value { "はい" } else { "いいえ" }
|
||||
}
|
||||
@@ -0,0 +1,459 @@
|
||||
//! Korean (`ko`) translations of Senbei console and report text.
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{Cli, Msg, Step, Term};
|
||||
|
||||
pub(crate) fn msg(msg: &Msg) -> Cow<'static, str> {
|
||||
match msg {
|
||||
Msg::CompanionMissing => "컴패니언 파일이 누락되었습니까? 이 로더는 일치하는 <input>._ 페이로드를 필요로 합니다. 입력 파일 옆에 두고 다시 시도하십시오.".into(),
|
||||
Msg::CompanionMismatch => "컴패니언 파일이 일치하지 않습니다: 제공된 ._ 페이로드가 너무 짧거나 헤더가 로더의 헤더와 다릅니다. 동일한 빌드의 컴패니언 파일을 사용하십시오. 두 파일 중 하나가 손상되었을 수 있습니다.".into(),
|
||||
Msg::InputTooShort { actual, required } => format!(
|
||||
"입력이 너무 짧습니다 (최소 {required}바이트 필요, 실제 {actual}바이트)"
|
||||
)
|
||||
.into(),
|
||||
Msg::NotProtected => "CrackProof로 보호된 파일이 아닙니다".into(),
|
||||
Msg::InvalidPeOffset { offset, input_len } => format!(
|
||||
"{input_len}바이트 입력에 대해 잘못된 PE 헤더 오프셋 {offset}입니다"
|
||||
)
|
||||
.into(),
|
||||
Msg::DllNeedsPe32Plus { found } => format!(
|
||||
"DLL 파이프라인에는 PE32+ 선택적 헤더 매직이 필요하지만 0x{found:04X}이(가) 확인되었습니다"
|
||||
)
|
||||
.into(),
|
||||
Msg::LayoutUnsupported => {
|
||||
"stage5 마커를 찾을 수 없습니다 — 이 빌드의 레이아웃은 이 언패커에서 지원되지 않습니다"
|
||||
.into()
|
||||
}
|
||||
Msg::InternalPanic {
|
||||
file,
|
||||
line,
|
||||
column,
|
||||
message,
|
||||
} => format!("{file}:{line}:{column}에서 내부 패닉 발생: {message}").into(),
|
||||
Msg::DecodeFailed => "보호된 데이터가 예상대로 디코딩되지 않았습니다. 파일이 손상되었거나 이 빌드의 레이아웃이 지원되지 않습니다".into(),
|
||||
Msg::NotPe => "입력이 PE 이미지가 아닙니다".into(),
|
||||
Msg::NotElf64 => "입력이 ELF64 리틀 엔디안 이미지가 아닙니다".into(),
|
||||
Msg::NotAarch64 => "입력이 AArch64 이미지가 아닙니다".into(),
|
||||
Msg::NotMetadata => "il2cpp global-metadata.dat가 아닙니다".into(),
|
||||
Msg::NotIl2cppMetadata => "IL2CPP global-metadata.dat가 아닙니다".into(),
|
||||
Msg::UnsupportedMetadataVersion { version } => {
|
||||
format!("지원되지 않는 메타데이터 버전 {version}").into()
|
||||
}
|
||||
Msg::MetadataTransformFailed => "메타데이터 변환이 검증되지 않았습니다".into(),
|
||||
Msg::LimitEntry { requested, limit } => format!(
|
||||
"리소스 제한: {requested}바이트 항목이 {limit}바이트 상한을 초과합니다"
|
||||
)
|
||||
.into(),
|
||||
Msg::LimitTotal {
|
||||
requested,
|
||||
adding,
|
||||
limit,
|
||||
} => format!(
|
||||
"리소스 제한: 작업 합계 {requested}바이트가 {limit}바이트 상한을 초과합니다 ({adding}바이트 추가 시)"
|
||||
)
|
||||
.into(),
|
||||
Msg::LimitEntries { requested, limit } => {
|
||||
format!("리소스 제한: 항목 {requested}개가 상한 {limit}개를 초과합니다").into()
|
||||
}
|
||||
Msg::LimitDepth { requested, limit } => format!(
|
||||
"리소스 제한: 중첩 깊이 {requested}이(가) 상한 {limit}을(를) 초과합니다"
|
||||
)
|
||||
.into(),
|
||||
Msg::OutputNotRetained => "연구용 검사: 출력 파일이 유지되지 않았습니다".into(),
|
||||
Msg::DryRunDiscarded => "시험 실행: 생성된 출력이 폐기되었습니다".into(),
|
||||
Msg::TransformNoop => "변환이 실행되고 검증되었으며, 다시 기록할 필요가 없었습니다".into(),
|
||||
Msg::CompanionUnmatched => {
|
||||
"같은 위치에 `._` 파일이 존재하지만 이 스텁의 페이로드가 아닙니다".into()
|
||||
}
|
||||
Msg::CompanionUnreadable { reason } => {
|
||||
format!("같은 위치의 `._` 파일을 읽을 수 없습니다: {reason}").into()
|
||||
}
|
||||
Msg::CompanionUnreadableUnknown => "같은 위치의 `._` 파일을 읽을 수 없습니다".into(),
|
||||
Msg::MetadataLeftUntouched { version } => {
|
||||
format!("지원되지 않는 메타데이터 버전 {version}, 변경하지 않고 유지함").into()
|
||||
}
|
||||
Msg::UnexpectedPanic { message } => format!("예기치 않은 패닉: {message}").into(),
|
||||
Msg::InputNotExamined => "입력을 조사할 수 없었습니다".into(),
|
||||
Msg::NoCandidateValidated => "검증된 후보가 없습니다".into(),
|
||||
Msg::NoModule0c => "v24.1 메타데이터에 대한 모듈 0x0C가 없습니다".into(),
|
||||
Msg::AmbiguousModule0c => "모호한 모듈 0x0C 바인딩".into(),
|
||||
Msg::UnsafePackageEntry { package } => {
|
||||
format!("패키지 `{package}`에 안전하지 않은 항목 경로가 있습니다").into()
|
||||
}
|
||||
Msg::UnsafeNestedEntry { path } => {
|
||||
format!("`{path}`에 안전하지 않은 항목 경로가 있습니다").into()
|
||||
}
|
||||
Msg::EntryStubTargetOutsideCode { branch, target } => format!(
|
||||
"엔트리 포인트 {branch} 대상 0x{target:X}이(가) 실행 가능 섹션 외부에 있습니다 (DD8 선택이 잘못되었을 가능성이 높음)"
|
||||
)
|
||||
.into(),
|
||||
Msg::MissingMz => "'MZ' DOS 서명이 누락되었습니다".into(),
|
||||
Msg::TruncatedDosHeader => "잘린 DOS 헤더 (e_lfanew 없음)".into(),
|
||||
Msg::MissingPeSignature { offset } => {
|
||||
format!("0x{offset:X}에 'PE\\0\\0' 서명이 누락되었습니다").into()
|
||||
}
|
||||
Msg::TruncatedCoffHeader => "잘린 COFF 헤더".into(),
|
||||
Msg::TruncatedOptionalHeader => "잘린 선택적 헤더".into(),
|
||||
Msg::BadOptionalMagic { magic } => {
|
||||
format!("잘못된 선택적 헤더 매직 0x{magic:X}").into()
|
||||
}
|
||||
Msg::ImplausibleSectionCount { count } => format!("비정상적인 섹션 수 {count}").into(),
|
||||
Msg::ZeroSizeOfImage => "SizeOfImage가 0입니다".into(),
|
||||
Msg::SectionTablePastEof => "섹션 테이블이 파일 끝을 넘어 확장됩니다".into(),
|
||||
Msg::SectionRawPastEof {
|
||||
index,
|
||||
start,
|
||||
end,
|
||||
file_len,
|
||||
} => format!(
|
||||
"섹션 #{index} 원시 데이터 [0x{start:X}..0x{end:X}]이(가) 파일 크기 0x{file_len:X}을(를) 초과합니다"
|
||||
)
|
||||
.into(),
|
||||
Msg::NoBaseRelocations => "네이티브 DLL에 기준 재배치 테이블이 없습니다 (DD[5]가 0임) — 기본 주소가 아닌 위치에 로드될 때 충돌합니다".into(),
|
||||
Msg::ZeroEntryPoint => "엔트리 포인트 RVA가 0입니다".into(),
|
||||
Msg::EntryUnmapped { rva } => {
|
||||
format!("엔트리 포인트 RVA 0x{rva:X}이(가) 어느 섹션에도 매핑되지 않습니다").into()
|
||||
}
|
||||
Msg::EntryAllZeros { rva } => {
|
||||
format!("RVA 0x{rva:X}의 엔트리 포인트가 모두 0입니다 (스텁이 복원되지 않음)").into()
|
||||
}
|
||||
Msg::EntryAllInt3 { rva } => {
|
||||
format!("RVA 0x{rva:X}의 엔트리 포인트가 모두 int3 패딩입니다 (스텁이 복원되지 않음)").into()
|
||||
}
|
||||
Msg::EntryNotExecutable { rva } => {
|
||||
format!("엔트리 포인트 RVA 0x{rva:X}이(가) 실행 가능 섹션에 있지 않습니다").into()
|
||||
}
|
||||
Msg::ImportDirectoryUnmapped { rva } => {
|
||||
format!("임포트 디렉터리 RVA 0x{rva:X}이(가) 어느 섹션에도 매핑되지 않습니다").into()
|
||||
}
|
||||
Msg::ImportNameUnmapped { index, rva } => format!(
|
||||
"임포트 디스크립터 {index}의 DLL 이름 RVA 0x{rva:X}이(가) 어느 섹션에도 매핑되지 않습니다"
|
||||
)
|
||||
.into(),
|
||||
Msg::ImportNameUnreadable { index, rva } => format!(
|
||||
"RVA 0x{rva:X}에 있는 임포트 디스크립터 {index}의 DLL 이름이 읽을 수 있는 ASCII가 아닙니다 (임포트가 암호화된 채로 남았습니까?)"
|
||||
)
|
||||
.into(),
|
||||
Msg::ClrDirectoryUnmapped { rva } => {
|
||||
format!("CLR (COR20) 디렉터리 RVA 0x{rva:X}이(가) 어느 섹션에도 매핑되지 않습니다").into()
|
||||
}
|
||||
Msg::ClrHeaderBadSize { rva, size } => format!(
|
||||
"RVA 0x{rva:X}의 COR20 헤더 cb가 0x{size:X}입니다 (예상값 0x48) — CLR 헤더가 손상되었습니다"
|
||||
)
|
||||
.into(),
|
||||
Msg::ClrMetadataUnmapped { rva } => {
|
||||
format!("CLR MetaData RVA 0x{rva:X}이(가) 어느 섹션에도 매핑되지 않습니다").into()
|
||||
}
|
||||
Msg::ClrMetadataNoBsjb { rva } => format!(
|
||||
"RVA 0x{rva:X}의 CLR MetaData에 'BSJB' 서명이 없습니다 (메타데이터 손상 — 관리되는 이미지가 로드되지 않습니다)"
|
||||
)
|
||||
.into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn step(step: &Step) -> Cow<'static, str> {
|
||||
match step {
|
||||
Step::DecryptHeader => "파일 헤더 복호화 중...".into(),
|
||||
Step::DecryptPayload => "페이로드 복호화 중...".into(),
|
||||
Step::LocateConfig => "구성 레이아웃 탐색 중...".into(),
|
||||
Step::DecryptStage2 => "stage2 복호화 중...".into(),
|
||||
Step::DecryptStages3To5 => "단계 3-5 복호화 중...".into(),
|
||||
Step::DecryptSections => "섹션 데이터 복호화 중...".into(),
|
||||
Step::DecryptSectionsNewLayout => "섹션 데이터 복호화 중 (새 레이아웃)...".into(),
|
||||
Step::LoadSections => "섹션 로드 및 압축 해제 중...".into(),
|
||||
Step::DecryptImports => "임포트 문자열 복호화 중...".into(),
|
||||
Step::RebuildHeaders => "PE 헤더 재구성 중...".into(),
|
||||
Step::Pe32LocateConfig => "구성 레이아웃 탐색 중 (PE32)...".into(),
|
||||
Step::Pe32Stages => "단계 복호화 중 (PE32)...".into(),
|
||||
Step::Pe32EighthStage => "eighthStage 복호화 중 (PE32)...".into(),
|
||||
Step::Pe32Load => "파일 데이터 로드 및 압축 해제 중 (PE32)...".into(),
|
||||
Step::Pe32Text { formula } => {
|
||||
format!(".text 복호화 중 (PE32 dd8, formula={formula})...").into()
|
||||
}
|
||||
Step::Pe32TextSkip => ".text dd8 건너뛰는 중 (이미 평문)...".into(),
|
||||
Step::Pe32Imports => "임포트 문자열 복호화 중 (PE32)...".into(),
|
||||
Step::Pe32Rebuild => "PE 파일 레이아웃 재구성 중 (PE32)...".into(),
|
||||
Step::InitKeys => "키 초기화 중...".into(),
|
||||
Step::DecryptKeyTable => "키 테이블 복호화 중...".into(),
|
||||
Step::DecryptPrimary => "기본 디스크립터 복호화 중...".into(),
|
||||
Step::RelocsParams => "재배치 및 압축 해제 매개변수 처리 중...".into(),
|
||||
Step::DecryptBlock1 => "코드 블록 1 (addr3) 복호화 중...".into(),
|
||||
Step::DecryptBlocks2To3 => "코드 블록 2-3 (addr3b, addr4) 복호화 중...".into(),
|
||||
Step::DecryptBlock4 => "코드 블록 4 (addr5) 복호화 중...".into(),
|
||||
Step::DllSections => "섹션 복호화 및 압축 해제 중...".into(),
|
||||
Step::FixHeaders => "PE 헤더 및 섹션 테이블 보정 중...".into(),
|
||||
Step::AndroidPrimary => "기본 0x9D 대상 이미지 컨테이너 디코딩 중...".into(),
|
||||
Step::AndroidAuxiliary => "보조 0x9D ELF 구체화 컨테이너 디코딩 중...".into(),
|
||||
Step::AndroidTables => "정적 ELF 동적 링커 테이블 재구성 중...".into(),
|
||||
Step::WriteTo { dest } => format!("{dest}(으)로 기록").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn term(term: &Term) -> Cow<'static, str> {
|
||||
match term {
|
||||
Term::Ok => "정상",
|
||||
Term::Suspect => "의심됨",
|
||||
Term::Recognized => "인식됨",
|
||||
Term::NotRecognized => "인식되지 않음",
|
||||
Term::Skipped => "건너뜀",
|
||||
Term::Error => "오류",
|
||||
Term::Restored => "복원됨",
|
||||
Term::Duplicate => "중복",
|
||||
Term::NotTarget => "비대상",
|
||||
Term::Unchanged => "변경 없음",
|
||||
Term::Inventoried => "목록화됨",
|
||||
Term::Failed => "실패함",
|
||||
Term::Blocked => "차단됨",
|
||||
Term::NotAttempted => "시도 안 함",
|
||||
Term::Succeeded => "성공함",
|
||||
Term::Rejected => "거부됨",
|
||||
Term::Clean => "정상",
|
||||
Term::Warnings => "경고",
|
||||
Term::NotRun => "미실행",
|
||||
Term::Absent => "없음",
|
||||
Term::Spliced => "결합됨",
|
||||
Term::Unmatched => "일치하지 않음",
|
||||
Term::Unreadable => "읽을 수 없음",
|
||||
Term::Detection => "탐지",
|
||||
Term::ManifestInventory => "매니페스트 목록화",
|
||||
Term::EntryProbe => "항목 프로브",
|
||||
Term::Recovery => "복원",
|
||||
Term::StaticValidation => "정적 검증",
|
||||
Term::OutputWrite => "출력 기록",
|
||||
Term::SharedLibrary => "공유 라이브러리",
|
||||
Term::Metadata => "메타데이터",
|
||||
Term::ExeStyle => "EXE 스타일",
|
||||
Term::Dll => "DLL",
|
||||
Term::AndroidStaged => "Android 단계별",
|
||||
Term::MetadataSeeded => "메타데이터 시드 기반",
|
||||
Term::MetadataStructural => "메타데이터 구조적",
|
||||
Term::MetadataMethodIndices => "메타데이터 메서드 인덱스",
|
||||
Term::WindowsPe => "Windows PE",
|
||||
Term::AndroidElf => "Android ELF",
|
||||
Term::Il2cppMetadata => "il2cpp 메타데이터",
|
||||
Term::NativeExe => "네이티브 EXE",
|
||||
Term::ManagedExe => ".NET EXE",
|
||||
Term::NativeDll => "네이티브 DLL",
|
||||
Term::ManagedDll => ".NET DLL",
|
||||
Term::HeaderMagic => "헤더 매직",
|
||||
Term::ExternalCompanionDeclaration => "외부 컴패니언 파일 선언",
|
||||
Term::CompanionSpliced => "컴패니언 파일 결합됨",
|
||||
Term::PrivateSection => "전용 섹션",
|
||||
Term::AesSchedule => "AES 키 스케줄",
|
||||
Term::ValidatedMetadataTransform => "검증된 메타데이터 변환",
|
||||
Term::Known => "알려짐",
|
||||
Term::ContextRequired => "애플리케이션 컨텍스트 필요",
|
||||
Term::Unverified => "미검증",
|
||||
Term::Original => "원본",
|
||||
Term::SplicedCompanion => "결합된 컴패니언 파일",
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
pub(crate) fn cli(cli: &Cli) -> Cow<'static, str> {
|
||||
match cli {
|
||||
Cli::Error => "오류".into(),
|
||||
Cli::Warning => "경고".into(),
|
||||
Cli::DoneIn { ms } => format!("{ms} ms 만에 완료").into(),
|
||||
Cli::PressEnter => "\n종료하려면 Enter 키를 누르십시오…".into(),
|
||||
Cli::ScanUnreadable { count } => {
|
||||
format!("스캔 중 {count}개의 파일을 읽을 수 없어 대상이 누락되었을 수 있습니다").into()
|
||||
}
|
||||
Cli::Summary {
|
||||
unpacked,
|
||||
skipped,
|
||||
errors,
|
||||
suspect,
|
||||
metadata,
|
||||
} => format!(
|
||||
"언패킹 {unpacked} · 건너뜀 {skipped} · 오류 {errors} · 의심됨 {suspect} · 메타데이터 {metadata}"
|
||||
)
|
||||
.into(),
|
||||
Cli::SummaryPackages { packages } => format!(" · 패키지 {packages}").into(),
|
||||
Cli::IntegrityFailed => "무결성 검사 실패".into(),
|
||||
Cli::IntegrityFailedLikelyCrash => "! 무결성 검사 실패 (런타임에 충돌할 가능성이 높음)".into(),
|
||||
Cli::MetadataLine {
|
||||
rel,
|
||||
dest,
|
||||
remapped,
|
||||
} => format!("메타데이터 {rel} -> {dest} (재매핑된 메서드 필드: {remapped})").into(),
|
||||
Cli::MetadataVersionLine {
|
||||
version,
|
||||
dest,
|
||||
remapped,
|
||||
} => format!("메타데이터 v{version} -> {dest} (재매핑된 메서드 필드: {remapped})").into(),
|
||||
Cli::MetadataAlreadyClean { version } => format!("메타데이터 v{version}:").into(),
|
||||
Cli::MetadataNothingToDo => "이미 난독화 해제됨, 수행할 작업 없음".into(),
|
||||
Cli::EmbeddedMetadataLine { input, dest } => {
|
||||
format!("메타데이터 {input} (내장됨) -> {dest}").into()
|
||||
}
|
||||
Cli::EmbeddedMetadataFailed => "내장 메타데이터".into(),
|
||||
Cli::MetadataUnsupportedLine { version } => {
|
||||
format!("지원되지 않는 메타데이터 버전 {version}, 변경하지 않고 유지함").into()
|
||||
}
|
||||
Cli::OutRequiresDirectory => "--out에는 디렉터리 인수가 필요합니다".into(),
|
||||
Cli::UnknownOption { option } => format!("알 수 없는 옵션 '{option}'").into(),
|
||||
Cli::MultipleInputs { first, second } => {
|
||||
format!("여러 입력 경로가 지정되었습니다 ('{first}' 및 '{second}')").into()
|
||||
}
|
||||
Cli::SubcommandNeedsPath { subcommand } => {
|
||||
format!("'{subcommand}'에는 입력 경로가 필요합니다").into()
|
||||
}
|
||||
Cli::InspectNoDryRun => {
|
||||
"'inspect'는 아무것도 기록하지 않습니다. --dry-run을 제거하십시오".into()
|
||||
}
|
||||
Cli::InspectNoOut => {
|
||||
"'inspect'는 아무것도 기록하지 않습니다. --out은 허용되지 않습니다".into()
|
||||
}
|
||||
Cli::DryRunNoOut => "--dry-run은 출력을 기록하지 않습니다. --out은 허용되지 않습니다".into(),
|
||||
Cli::ColorRequiresMode => "--color에는 auto, always 또는 never가 필요합니다".into(),
|
||||
Cli::ThreadsRequiresInteger => "--threads에는 양의 정수 인수가 필요합니다".into(),
|
||||
Cli::LimitRequiresInteger { flag } => {
|
||||
format!("{flag}에는 부호 없는 정수 인수가 필요합니다").into()
|
||||
}
|
||||
Cli::LimitMustBePositive { flag } => format!("{flag}은(는) 0보다 커야 합니다").into(),
|
||||
Cli::LimitTooLarge { flag } => {
|
||||
format!("{flag}이(가) 지원되는 바이트 범위를 초과합니다").into()
|
||||
}
|
||||
Cli::UnknownLimit { flag } => format!("알 수 없는 리소스 옵션 '{flag}'").into(),
|
||||
Cli::HelpPath => " <file|folder>\n\
|
||||
\x20 CrackProof PE (.exe/.dll), il2cpp global-metadata.dat, 보호된\n\
|
||||
\x20 Android AArch64 라이브러리 (.so), Android 앱 패키지\n\
|
||||
\x20 (.apk/.apks/.xapk) 또는 이를 포함하는 폴더입니다. 하위 명령을\n\
|
||||
\x20 생략하면 'unpack'과 동일합니다."
|
||||
.into(),
|
||||
Cli::HelpInspect => " inspect PATH\n\
|
||||
\x20 연구를 위해 실제 정적 복원을 실행하고 관측된 모든 내용을\n\
|
||||
\x20 보고합니다: 인식 근거, 시도된 각 경로와 거부 이유, 선택된\n\
|
||||
\x20 경로, 정적 검사 판정, 엔진 자체의 구조적 근거 (보호 헤더\n\
|
||||
\x20 필드, 시드, 모듈 레코드, 복원된 이미지 정보). 출력 파일,\n\
|
||||
\x20 로그, 임시 트리는 일절 유지되지 않으며 입력은 절대 실행되지\n\
|
||||
\x20 않습니다."
|
||||
.into(),
|
||||
Cli::HelpUnpack => " unpack PATH 탐지 및 복원을 수행하고 출력을 기록합니다 (기본값).".into(),
|
||||
Cli::HelpJson => " --json 버전이 지정된 기계 판독 가능 보고서 하나를 stdout에 기록하고\n\
|
||||
\x20 다른 내용은 출력하지 않습니다. quiet 및 --no-log를 암시합니다."
|
||||
.into(),
|
||||
Cli::HelpDryRun => " --dry-run 실제 복원을 실행하되 출력 트리와 로그를 일절 유지하지\n\
|
||||
\x20 않습니다. Android 추출은 여전히 자체 임시 작업 공간을\n\
|
||||
\x20 사용하며 작업 후 폐기됩니다."
|
||||
.into(),
|
||||
Cli::HelpThreads => " --threads N 이번 실행의 양수 작업자 스레드 상한입니다. SENBEI_THREADS보다\n\
|
||||
\x20 우선하며, 1은 순차 경로를 선택합니다. 환경 변수는 변경되지\n\
|
||||
\x20 않습니다."
|
||||
.into(),
|
||||
Cli::HelpColor => " --color MODE auto (기본값), always 또는 never. --color=MODE도 작동합니다.\n\
|
||||
\x20 auto는 NO_COLOR가 비어 있지 않거나 TERM=dumb가 아닌 한 터미널\n\
|
||||
\x20 stdout/stderr에 개별적으로 색상을 적용합니다. 명시적\n\
|
||||
\x20 always/never는 이 변수들보다 우선합니다. JSON 및 저장된 로그는\n\
|
||||
\x20 일반 텍스트로 유지됩니다."
|
||||
.into(),
|
||||
Cli::HelpScanAll => " --scan-all 최소 크기 기준 미만인 지정된 .exe/.dll/.so/메타데이터 이름을\n\
|
||||
\x20 프로브합니다. 다른 파일 이름은 계속 제외됩니다."
|
||||
.into(),
|
||||
Cli::HelpStrictIntegrity => " --strict-integrity\n\
|
||||
\x20 출력이 정적 무결성 검사에 실패하거나 (의심됨) 파일에 오류가\n\
|
||||
\x20 발생하면 0이 아닌 코드로 종료합니다. 기본값은 해제 상태이며,\n\
|
||||
\x20 의심됨 항목도 파일로 기록되고 파일 오류가 없는 한 프로세스는\n\
|
||||
\x20 0으로 종료합니다. quiet 수준은 변경되지 않습니다.\n\
|
||||
\x20 'inspect'와 함께 사용하면 연구를 위해 실제로 복원된 이미지에\n\
|
||||
\x20 검사가 적용되며 출력 파일은 유지되지 않습니다."
|
||||
.into(),
|
||||
Cli::HelpLimits {
|
||||
entry_mib,
|
||||
total_mib,
|
||||
entries,
|
||||
depth,
|
||||
} => format!(
|
||||
" Android 리소스 제한 (MiB = 1048576바이트):\n\
|
||||
\x20 --max-entry-mib N 단일 아카이브 항목/디코딩된 버퍼/출력 (기본값 {entry_mib})\n\
|
||||
\x20 --max-total-mib N 누적 아카이브 바이트 및 엔진당 작업 한도 (기본값 {total_mib})\n\
|
||||
\x20 --max-entries N 아카이브 항목/단계 2 레코드 (기본값 {entries})\n\
|
||||
\x20 --max-depth N 중첩 깊이, 루트 = 0 (기본값 {depth})\n\
|
||||
\x20 제한은 추출/할당 전에 확인되며 최대 RSS 상한선이 아닙니다."
|
||||
)
|
||||
.into(),
|
||||
Cli::HelpExitCodes => " 종료 코드: 0 성공, 1 대상 실패 (--strict-integrity 사용 시 의심됨 포함),\n\
|
||||
\x20 2 명령줄이 거부됨."
|
||||
.into(),
|
||||
Cli::ReportScanHeading => "스캔".into(),
|
||||
Cli::ReportScan {
|
||||
skipped,
|
||||
walk_errors,
|
||||
probe_errors,
|
||||
} => format!("프로브한 비대상 {skipped} · 탐색 오류 {walk_errors} · 프로브 오류 {probe_errors}").into(),
|
||||
Cli::ReportScanIncomplete => {
|
||||
"분석이 불완전합니다: 일부 디렉터리 항목 또는 선택한 파일을 조사할 수 없었습니다".into()
|
||||
}
|
||||
Cli::AnalysisIncomplete => "분석 미완료".into(),
|
||||
Cli::AnalysisIncompleteInput => {
|
||||
"I/O, 리소스 제한 또는 인프라 문제로 인해 요청된 작업을 수행하지 못했습니다".into()
|
||||
}
|
||||
Cli::AnalysisIncompleteEntry => "요청된 항목 분석을 완료할 수 없었습니다".into(),
|
||||
Cli::Source { size } => format!("소스: {size}바이트 (0x{size:X})").into(),
|
||||
Cli::Target {
|
||||
platform,
|
||||
format,
|
||||
kind,
|
||||
} => format!("대상: {platform} · {format} · {kind}").into(),
|
||||
Cli::FormatUnavailable => "형식 사용 불가".into(),
|
||||
Cli::KindUnavailable => "종류 해당 없음 또는 사용 불가".into(),
|
||||
Cli::ProtectionRecognition { status } => format!("보호 인식: {status}").into(),
|
||||
Cli::Evidence { evidence } => format!("근거: {evidence}").into(),
|
||||
Cli::Route { route, outcome } => format!("경로 {route}: {outcome}").into(),
|
||||
Cli::SelectedRoute { route } => format!("선택된 경로: {route}").into(),
|
||||
Cli::StaticRecovery { status } => format!("정적 복원: {status}").into(),
|
||||
Cli::OutputValidation { status } => format!("출력 정적 검증: {status}").into(),
|
||||
Cli::Companion { state } => format!("컴패니언 파일: {state}").into(),
|
||||
Cli::CompanionIdentity { size, sha256 } => {
|
||||
format!("{size}바이트 · SHA-256 {sha256}").into()
|
||||
}
|
||||
Cli::InputView { view } => format!("분석 입력 보기: {view}").into(),
|
||||
Cli::InputViewSplicedNote => "0x1000 미만의 파일 오프셋은 스텁을 가리키며, 0x1000 이상의 오프셋은 컴패니언 파일 오프셋 (파일 오프셋 - 0x1000)을 가리킵니다".into(),
|
||||
Cli::MetadataIdentity { version, layout } => {
|
||||
format!("IL2CPP 메타데이터 버전: {version} · 레이아웃 정의 {layout}").into()
|
||||
}
|
||||
Cli::SeededTokens { value } => format!("시드 기반 메서드 토큰: {}", yes_no(*value)).into(),
|
||||
Cli::StructuralTokens { value } => format!("구조적 메서드 토큰: {}", yes_no(*value)).into(),
|
||||
Cli::MethodIndexRestore { value, context } => format!(
|
||||
"메서드 인덱스 복원: {} · 애플리케이션 컨텍스트 필요: {}",
|
||||
yes_no(*value),
|
||||
yes_no(*context)
|
||||
)
|
||||
.into(),
|
||||
Cli::Container {
|
||||
kind,
|
||||
entries,
|
||||
manifests,
|
||||
} => format!("컨테이너: {kind} · 항목 {entries} · 매니페스트 {manifests}").into(),
|
||||
Cli::Manifest {
|
||||
source,
|
||||
package,
|
||||
version,
|
||||
} => format!("매니페스트 {source} → {package} {version}").into(),
|
||||
Cli::Unnamed => "<unnamed>".into(),
|
||||
Cli::Candidate { entry } => format!("후보: {entry}").into(),
|
||||
Cli::MetadataEvidence => "메타데이터 변환 근거".into(),
|
||||
Cli::Entry { name, status } => format!("항목 {name}: {status}").into(),
|
||||
Cli::EntryRoute { route } => format!("경로: {route}").into(),
|
||||
Cli::EntryMetadataVersion { version } => format!("메타데이터 버전: {version}").into(),
|
||||
Cli::EntryRemapped { remapped } => format!("재매핑된 메서드 필드: {remapped}").into(),
|
||||
Cli::ModuleContextSource { source } => format!("모듈 컨텍스트 출처: {source}").into(),
|
||||
Cli::StageLine { stage, status } => format!("단계 {stage}: {status}").into(),
|
||||
Cli::Recovered { size, sha256 } => {
|
||||
format!("복원됨: {size}바이트 · SHA-256 {sha256}").into()
|
||||
}
|
||||
Cli::InspectionStatus { status, ms } => format!("검사 상태: {status} · {ms} ms").into(),
|
||||
Cli::DiagnosticWarning => "경고".into(),
|
||||
Cli::DiagnosticError => "오류".into(),
|
||||
Cli::DiagnosticReason => "원인".into(),
|
||||
Cli::DiagnosticDetail => "세부 정보".into(),
|
||||
Cli::DiagnosticEnglish => "영어 원문".into(),
|
||||
}
|
||||
}
|
||||
|
||||
/// A capability flag as a word of this language.
|
||||
fn yes_no(value: bool) -> &'static str {
|
||||
if value { "예" } else { "아니요" }
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
//! User-facing text for Senbei.
|
||||
//!
|
||||
//! Every piece of text a person reads is a variant of [`Msg`] (engine and
|
||||
//! driver messages), [`Step`] (verbose pipeline progress), [`Term`] (report
|
||||
//! values such as statuses and kinds), or [`Cli`] (command-line wording).
|
||||
//! Each language module renders every variant, so the compiler rejects a
|
||||
//! missing translation, a placeholder that is not an argument, and (through
|
||||
//! `deny(unused_variables)`) an argument a translation leaves out.
|
||||
//!
|
||||
//! English is the wording the engine has always produced. Reports, logs, and
|
||||
//! `--json` output stay English; only console and GUI text is localized.
|
||||
#![deny(unused_variables)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::sync::atomic::{AtomicU8, Ordering};
|
||||
|
||||
mod catalog;
|
||||
mod en;
|
||||
mod ja;
|
||||
mod ko;
|
||||
mod message;
|
||||
mod zh_cn;
|
||||
mod zh_tw;
|
||||
|
||||
pub use catalog::{Cli, Msg, Step, Term};
|
||||
pub use message::Message;
|
||||
|
||||
/// A language Senbei can display.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
|
||||
pub enum Lang {
|
||||
#[default]
|
||||
En,
|
||||
ZhCn,
|
||||
ZhTw,
|
||||
Ja,
|
||||
Ko,
|
||||
}
|
||||
|
||||
impl Lang {
|
||||
/// Every supported language, English first.
|
||||
pub const ALL: [Lang; 5] = [Lang::En, Lang::ZhCn, Lang::ZhTw, Lang::Ja, Lang::Ko];
|
||||
|
||||
/// The BCP 47 tag, as accepted by `SENBEI_LANG`.
|
||||
pub const fn tag(self) -> &'static str {
|
||||
match self {
|
||||
Lang::En => "en",
|
||||
Lang::ZhCn => "zh-CN",
|
||||
Lang::ZhTw => "zh-TW",
|
||||
Lang::Ja => "ja",
|
||||
Lang::Ko => "ko",
|
||||
}
|
||||
}
|
||||
|
||||
/// The language's own name, for a language picker.
|
||||
pub const fn native_name(self) -> &'static str {
|
||||
match self {
|
||||
Lang::En => "English",
|
||||
Lang::ZhCn => "简体中文",
|
||||
Lang::ZhTw => "繁體中文",
|
||||
Lang::Ja => "日本語",
|
||||
Lang::Ko => "한국어",
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse a BCP 47 tag (`zh-Hant-HK`), a POSIX locale (`ja_JP.UTF-8`),
|
||||
/// or a Windows locale name (`ko-KR`).
|
||||
///
|
||||
/// Chinese follows the script when one is given, then the region:
|
||||
/// Taiwan, Hong Kong, and Macau read Traditional Chinese; every other
|
||||
/// Chinese locale reads Simplified. `C`, `POSIX`, and unknown languages
|
||||
/// return `None` so the caller can fall back.
|
||||
pub fn from_tag(tag: &str) -> Option<Lang> {
|
||||
let tag = tag.split(['.', '@']).next().unwrap_or_default();
|
||||
let lower = tag.trim().to_ascii_lowercase().replace('_', "-");
|
||||
let mut parts = lower.split('-').filter(|part| !part.is_empty());
|
||||
match parts.next()? {
|
||||
"en" => Some(Lang::En),
|
||||
"ja" => Some(Lang::Ja),
|
||||
"ko" => Some(Lang::Ko),
|
||||
"zh" => {
|
||||
let rest: Vec<&str> = parts.collect();
|
||||
if rest.contains(&"hant") {
|
||||
Some(Lang::ZhTw)
|
||||
} else if rest.contains(&"hans") {
|
||||
Some(Lang::ZhCn)
|
||||
} else if rest.iter().any(|part| matches!(*part, "tw" | "hk" | "mo")) {
|
||||
Some(Lang::ZhTw)
|
||||
} else {
|
||||
Some(Lang::ZhCn)
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static CURRENT: AtomicU8 = AtomicU8::new(0);
|
||||
|
||||
/// The language console text uses in this process. English until a front
|
||||
/// end calls [`set_current`].
|
||||
pub fn current() -> Lang {
|
||||
match CURRENT.load(Ordering::Relaxed) {
|
||||
1 => Lang::ZhCn,
|
||||
2 => Lang::ZhTw,
|
||||
3 => Lang::Ja,
|
||||
4 => Lang::Ko,
|
||||
_ => Lang::En,
|
||||
}
|
||||
}
|
||||
|
||||
/// Choose the language for console text in this process.
|
||||
pub fn set_current(lang: Lang) {
|
||||
let index = match lang {
|
||||
Lang::En => 0,
|
||||
Lang::ZhCn => 1,
|
||||
Lang::ZhTw => 2,
|
||||
Lang::Ja => 3,
|
||||
Lang::Ko => 4,
|
||||
};
|
||||
CURRENT.store(index, Ordering::Relaxed);
|
||||
}
|
||||
|
||||
/// Text that can be shown in any supported language.
|
||||
pub trait Localize {
|
||||
fn localize(&self, lang: Lang) -> Cow<'static, str>;
|
||||
}
|
||||
|
||||
macro_rules! dispatch {
|
||||
($ty:ty, $func:ident) => {
|
||||
impl Localize for $ty {
|
||||
fn localize(&self, lang: Lang) -> Cow<'static, str> {
|
||||
match lang {
|
||||
Lang::En => en::$func(self),
|
||||
Lang::ZhCn => zh_cn::$func(self),
|
||||
Lang::ZhTw => zh_tw::$func(self),
|
||||
Lang::Ja => ja::$func(self),
|
||||
Lang::Ko => ko::$func(self),
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
dispatch!(Msg, msg);
|
||||
dispatch!(Step, step);
|
||||
dispatch!(Term, term);
|
||||
dispatch!(Cli, cli);
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
@@ -0,0 +1,159 @@
|
||||
use std::borrow::{Borrow, Cow};
|
||||
use std::fmt;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::ops::Deref;
|
||||
|
||||
use crate::{Lang, Localize, Msg};
|
||||
|
||||
/// A message as recorded in a report, with the catalog entry it came from.
|
||||
///
|
||||
/// `text` is the English the engine produced, kept byte for byte: reports,
|
||||
/// logs, and `--json` output write it unchanged. `msg`, when present, is the
|
||||
/// same message as a catalog entry, so a front end can show it in another
|
||||
/// language. A message without a catalog entry (a deep error chain, a value
|
||||
/// that is not prose) is shown as recorded in every language.
|
||||
///
|
||||
/// Equality, hashing, ordering of the borrowed form, and serialization all
|
||||
/// use `text` alone.
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Message {
|
||||
text: Cow<'static, str>,
|
||||
msg: Option<Msg>,
|
||||
}
|
||||
|
||||
impl Message {
|
||||
/// A catalog entry recorded in its English wording.
|
||||
pub fn new(msg: Msg) -> Self {
|
||||
Self {
|
||||
text: msg.localize(Lang::En),
|
||||
msg: Some(msg),
|
||||
}
|
||||
}
|
||||
|
||||
/// A catalog entry whose recorded English carries more than the entry,
|
||||
/// such as the context chain around an engine error.
|
||||
pub fn with_text(msg: Msg, text: impl Into<Cow<'static, str>>) -> Self {
|
||||
Self {
|
||||
text: text.into(),
|
||||
msg: Some(msg),
|
||||
}
|
||||
}
|
||||
|
||||
/// Text with no catalog entry. It reads the same in every language.
|
||||
pub fn raw(text: impl Into<Cow<'static, str>>) -> Self {
|
||||
Self {
|
||||
text: text.into(),
|
||||
msg: None,
|
||||
}
|
||||
}
|
||||
|
||||
/// The recorded English.
|
||||
pub fn text(&self) -> &str {
|
||||
&self.text
|
||||
}
|
||||
|
||||
/// The catalog entry, when there is one.
|
||||
pub fn msg(&self) -> Option<&Msg> {
|
||||
self.msg.as_ref()
|
||||
}
|
||||
|
||||
/// The message to show in `lang`.
|
||||
///
|
||||
/// English is the recorded text, so English output never changes. Other
|
||||
/// languages use the catalog entry when there is one.
|
||||
pub fn localized(&self, lang: Lang) -> Cow<'_, str> {
|
||||
match &self.msg {
|
||||
Some(msg) if lang != Lang::En => msg.localize(lang),
|
||||
_ => Cow::Borrowed(self.text()),
|
||||
}
|
||||
}
|
||||
|
||||
/// The recorded English, when the localized message in `lang` leaves
|
||||
/// part of it out (a context chain, an internal error's specifics).
|
||||
pub fn detail(&self, lang: Lang) -> Option<&str> {
|
||||
let msg = self.msg.as_ref()?;
|
||||
(lang != Lang::En && msg.localize(Lang::En) != self.text()).then(|| self.text())
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Msg> for Message {
|
||||
fn from(msg: Msg) -> Self {
|
||||
Self::new(msg)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<String> for Message {
|
||||
fn from(text: String) -> Self {
|
||||
Self::raw(text)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&'static str> for Message {
|
||||
fn from(text: &'static str) -> Self {
|
||||
Self::raw(text)
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Message {
|
||||
type Target = str;
|
||||
|
||||
fn deref(&self) -> &str {
|
||||
self.text()
|
||||
}
|
||||
}
|
||||
|
||||
impl AsRef<str> for Message {
|
||||
fn as_ref(&self) -> &str {
|
||||
self.text()
|
||||
}
|
||||
}
|
||||
|
||||
impl Borrow<str> for Message {
|
||||
fn borrow(&self) -> &str {
|
||||
self.text()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Message {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.write_str(self.text())
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq for Message {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.text() == other.text()
|
||||
}
|
||||
}
|
||||
|
||||
impl Eq for Message {}
|
||||
|
||||
impl Hash for Message {
|
||||
fn hash<H: Hasher>(&self, state: &mut H) {
|
||||
self.text().hash(state);
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq<str> for Message {
|
||||
fn eq(&self, other: &str) -> bool {
|
||||
self.text() == other
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq<&str> for Message {
|
||||
fn eq(&self, other: &&str) -> bool {
|
||||
self.text() == *other
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialEq<String> for Message {
|
||||
fn eq(&self, other: &String) -> bool {
|
||||
self.text() == other
|
||||
}
|
||||
}
|
||||
|
||||
impl serde::Serialize for Message {
|
||||
fn serialize<S: serde::Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
|
||||
serializer.serialize_str(self.text())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,288 @@
|
||||
use crate::{Cli, Lang, Localize, Message, Msg, Step, Term};
|
||||
|
||||
#[test]
|
||||
fn tags_resolve_by_language_script_and_region() {
|
||||
for (tag, lang) in [
|
||||
("en", Lang::En),
|
||||
("en_US.UTF-8", Lang::En),
|
||||
("ja_JP.UTF-8", Lang::Ja),
|
||||
("ko-KR", Lang::Ko),
|
||||
("zh", Lang::ZhCn),
|
||||
("zh-CN", Lang::ZhCn),
|
||||
("zh_SG", Lang::ZhCn),
|
||||
("zh-Hans-HK", Lang::ZhCn),
|
||||
("zh-TW", Lang::ZhTw),
|
||||
("zh_HK.Big5", Lang::ZhTw),
|
||||
("zh-MO", Lang::ZhTw),
|
||||
("zh-Hant", Lang::ZhTw),
|
||||
("zh-Hant-CN", Lang::ZhTw),
|
||||
("ZH-tw", Lang::ZhTw),
|
||||
] {
|
||||
assert_eq!(Lang::from_tag(tag), Some(lang), "{tag}");
|
||||
}
|
||||
for tag in ["", "C", "POSIX", "fr_FR.UTF-8", "-", "C.UTF-8"] {
|
||||
assert_eq!(Lang::from_tag(tag), None, "{tag}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn every_language_round_trips_through_its_own_tag() {
|
||||
for lang in Lang::ALL {
|
||||
assert_eq!(Lang::from_tag(lang.tag()), Some(lang));
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn current_language_can_change() {
|
||||
for lang in Lang::ALL {
|
||||
crate::set_current(lang);
|
||||
assert_eq!(crate::current(), lang);
|
||||
}
|
||||
crate::set_current(Lang::En);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn messages_keep_recorded_english_and_serialize_it() {
|
||||
let coded = Message::new(Msg::NotProtected);
|
||||
assert_eq!(coded.text(), "not a CrackProof-protected file");
|
||||
assert_eq!(coded, "not a CrackProof-protected file");
|
||||
assert_eq!(
|
||||
serde_json::to_string(&coded).unwrap(),
|
||||
"\"not a CrackProof-protected file\""
|
||||
);
|
||||
assert_eq!(coded.detail(Lang::ZhCn), None);
|
||||
|
||||
let chained = Message::with_text(
|
||||
Msg::LimitEntry {
|
||||
requested: 10,
|
||||
limit: 4,
|
||||
},
|
||||
"extract `a.so`: resource limit: entry of 10 bytes exceeds the 4-byte ceiling",
|
||||
);
|
||||
assert_eq!(chained.localized(Lang::En), chained.text());
|
||||
assert_eq!(chained.detail(Lang::En), None);
|
||||
assert_eq!(chained.detail(Lang::Ja), Some(chained.text()));
|
||||
|
||||
let raw = Message::raw("os error 5");
|
||||
for lang in Lang::ALL {
|
||||
assert_eq!(raw.localized(lang), "os error 5");
|
||||
assert_eq!(raw.detail(lang), None);
|
||||
}
|
||||
let joined = [coded, raw].join("; ");
|
||||
assert_eq!(joined, "not a CrackProof-protected file; os error 5");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn terms_map_every_wire_value_back_to_its_english() {
|
||||
let values = [
|
||||
"ok",
|
||||
"suspect",
|
||||
"recognized",
|
||||
"not_recognized",
|
||||
"skipped",
|
||||
"error",
|
||||
"restored",
|
||||
"duplicate",
|
||||
"not_target",
|
||||
"unchanged",
|
||||
"inventoried",
|
||||
"failed",
|
||||
"blocked",
|
||||
"not_attempted",
|
||||
"succeeded",
|
||||
"rejected",
|
||||
"clean",
|
||||
"warnings",
|
||||
"not_run",
|
||||
"absent",
|
||||
"spliced",
|
||||
"unmatched",
|
||||
"unreadable",
|
||||
"detection",
|
||||
"manifest_inventory",
|
||||
"entry_probe",
|
||||
"recovery",
|
||||
"static_validation",
|
||||
"output_write",
|
||||
"shared_library",
|
||||
"metadata",
|
||||
"exe_style",
|
||||
"dll",
|
||||
"android_staged",
|
||||
"metadata_seeded",
|
||||
"metadata_structural",
|
||||
"metadata_method_indices",
|
||||
"windows_pe",
|
||||
"android_elf",
|
||||
"il2cpp_metadata",
|
||||
"native_exe",
|
||||
"managed_exe",
|
||||
"native_dll",
|
||||
"managed_dll",
|
||||
"header_magic",
|
||||
"external_companion_declaration",
|
||||
"companion_spliced",
|
||||
"private_section",
|
||||
"aes_schedule",
|
||||
"validated_metadata_transform",
|
||||
"known",
|
||||
"context_required",
|
||||
"unverified",
|
||||
"original",
|
||||
"spliced_companion",
|
||||
];
|
||||
for value in values {
|
||||
let term = Term::from_value(value).unwrap_or_else(|| panic!("{value}"));
|
||||
assert_eq!(term.localize(Lang::En), value.replace('_', " "));
|
||||
}
|
||||
assert_eq!(Term::from_value("no_such_value"), None);
|
||||
}
|
||||
|
||||
/// The values a rendering carries: numbers, hex values, and marked arguments.
|
||||
fn tokens(text: &str) -> Vec<String> {
|
||||
text.split(|c: char| !(c.is_ascii_alphanumeric() || c == '_' || c == '.'))
|
||||
.filter(|word| word.chars().any(|c| c.is_ascii_digit()) || word.starts_with("ARG"))
|
||||
.map(str::to_owned)
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Every value of the English rendering survives in the translation, as
|
||||
/// often as English shows it. A translation may add digits of its own, such
|
||||
/// as a 0 for "zeros".
|
||||
fn assert_keeps_values(translated: &str, english: &str, context: &str) {
|
||||
let mut left = tokens(translated);
|
||||
for token in tokens(english) {
|
||||
match left.iter().position(|have| *have == token) {
|
||||
Some(index) => {
|
||||
left.swap_remove(index);
|
||||
}
|
||||
None => panic!("{context}: `{token}` is missing from {translated:?}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn sample_msgs() -> Vec<Msg> {
|
||||
vec![
|
||||
Msg::InputTooShort {
|
||||
actual: 1201,
|
||||
required: 4128,
|
||||
},
|
||||
Msg::InvalidPeOffset {
|
||||
offset: -7,
|
||||
input_len: 4097,
|
||||
},
|
||||
Msg::DllNeedsPe32Plus { found: 0x10B },
|
||||
Msg::InternalPanic {
|
||||
file: "ARGfile".into(),
|
||||
line: 1363,
|
||||
column: 59,
|
||||
message: "ARGmessage".into(),
|
||||
},
|
||||
Msg::UnsupportedMetadataVersion { version: 27 },
|
||||
Msg::LimitEntry {
|
||||
requested: 260043504,
|
||||
limit: 67108864,
|
||||
},
|
||||
Msg::LimitTotal {
|
||||
requested: 900,
|
||||
adding: 300,
|
||||
limit: 800,
|
||||
},
|
||||
Msg::LimitEntries {
|
||||
requested: 100001,
|
||||
limit: 100000,
|
||||
},
|
||||
Msg::LimitDepth {
|
||||
requested: 33,
|
||||
limit: 32,
|
||||
},
|
||||
Msg::CompanionUnreadable {
|
||||
reason: "ARGreason".into(),
|
||||
},
|
||||
Msg::MetadataLeftUntouched { version: 27 },
|
||||
Msg::UnexpectedPanic {
|
||||
message: "ARGpanic".into(),
|
||||
},
|
||||
Msg::UnsafePackageEntry {
|
||||
package: "ARGpackage".into(),
|
||||
},
|
||||
Msg::UnsafeNestedEntry {
|
||||
path: "ARGpath".into(),
|
||||
},
|
||||
Msg::EntryStubTargetOutsideCode {
|
||||
branch: "ARGbranch",
|
||||
target: 0x1234,
|
||||
},
|
||||
Msg::MissingPeSignature { offset: 0x80 },
|
||||
Msg::BadOptionalMagic { magic: 0x20C },
|
||||
Msg::ImplausibleSectionCount { count: 97 },
|
||||
Msg::SectionRawPastEof {
|
||||
index: 3,
|
||||
start: 0x400,
|
||||
end: 0x9000,
|
||||
file_len: 0x8000,
|
||||
},
|
||||
Msg::EntryUnmapped { rva: 0x1B5C },
|
||||
Msg::EntryAllZeros { rva: 0x1B5D },
|
||||
Msg::EntryAllInt3 { rva: 0x1B5E },
|
||||
Msg::EntryNotExecutable { rva: 0x1B5F },
|
||||
Msg::ImportDirectoryUnmapped { rva: 0x2000 },
|
||||
Msg::ImportNameUnmapped {
|
||||
index: 4,
|
||||
rva: 0x2100,
|
||||
},
|
||||
Msg::ImportNameUnreadable {
|
||||
index: 5,
|
||||
rva: 0x2200,
|
||||
},
|
||||
Msg::ClrDirectoryUnmapped { rva: 0x3000 },
|
||||
Msg::ClrHeaderBadSize {
|
||||
rva: 0x3100,
|
||||
size: 0x40,
|
||||
},
|
||||
Msg::ClrMetadataUnmapped { rva: 0x3200 },
|
||||
Msg::ClrMetadataNoBsjb { rva: 0x3300 },
|
||||
]
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn translations_keep_every_argument() {
|
||||
for lang in Lang::ALL {
|
||||
for msg in sample_msgs() {
|
||||
assert_keeps_values(
|
||||
&msg.localize(lang),
|
||||
&msg.localize(Lang::En),
|
||||
&format!("{lang:?} {msg:?}"),
|
||||
);
|
||||
}
|
||||
let step = Step::Pe32Text {
|
||||
formula: "ARGformula",
|
||||
};
|
||||
assert!(step.localize(lang).contains("ARGformula"), "{lang:?}");
|
||||
let step = Step::WriteTo {
|
||||
dest: "ARGdest".into(),
|
||||
};
|
||||
assert!(step.localize(lang).contains("ARGdest"), "{lang:?}");
|
||||
let summary = Cli::Summary {
|
||||
unpacked: "ARGa".into(),
|
||||
skipped: "ARGb".into(),
|
||||
errors: "ARGc".into(),
|
||||
suspect: "ARGd".into(),
|
||||
metadata: "ARGe".into(),
|
||||
};
|
||||
assert_keeps_values(
|
||||
&summary.localize(lang),
|
||||
&summary.localize(Lang::En),
|
||||
&format!("{lang:?} summary"),
|
||||
);
|
||||
let limits = Cli::HelpLimits {
|
||||
entry_mib: 2048,
|
||||
total_mib: 8192,
|
||||
entries: 100000,
|
||||
depth: 32,
|
||||
};
|
||||
for value in ["2048", "8192", "100000", "32"] {
|
||||
assert!(limits.localize(lang).contains(value), "{lang:?} {value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
//! Simplified Chinese (zh-CN) console and report text.
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{Cli, Msg, Step, Term};
|
||||
|
||||
pub(crate) fn msg(msg: &Msg) -> Cow<'static, str> {
|
||||
match msg {
|
||||
Msg::CompanionMissing => "缺少伴生文件?此加载器需要匹配的 <input>._ 载荷。请将其放在输入文件旁并重试。".into(),
|
||||
Msg::CompanionMismatch => "伴生文件不匹配:提供的 ._ 载荷过短,或其头部与加载器不一致。请使用来自同一构建版本的伴生文件;其中任一文件都可能已损坏。".into(),
|
||||
Msg::InputTooShort { actual, required } => format!("输入过短(至少需要 {required} 字节,实际为 {actual} 字节)").into(),
|
||||
Msg::NotProtected => "不是受 CrackProof 保护的文件".into(),
|
||||
Msg::InvalidPeOffset { offset, input_len } => format!("对于 {input_len} 字节的输入,PE 头部偏移 {offset} 无效").into(),
|
||||
Msg::DllNeedsPe32Plus { found } => format!("DLL 流水线需要 PE32+ 可选头部魔数,实际为 0x{found:04X}").into(),
|
||||
Msg::LayoutUnsupported => "未找到 stage5 标记 — 此解包工具不支持该构建版本的布局".into(),
|
||||
Msg::InternalPanic { file, line, column, message } => format!("内部错误位于 {file}:{line}:{column}:{message}").into(),
|
||||
Msg::DecodeFailed => "受保护数据未能按预期解码;文件可能已损坏,或该构建版本的布局不受支持".into(),
|
||||
Msg::NotPe => "输入不是 PE 映像".into(),
|
||||
Msg::NotElf64 => "输入不是 ELF64 小端序映像".into(),
|
||||
Msg::NotAarch64 => "输入不是 AArch64 映像".into(),
|
||||
Msg::NotMetadata => "不是 il2cpp global-metadata.dat".into(),
|
||||
Msg::NotIl2cppMetadata => "不是 IL2CPP global-metadata.dat".into(),
|
||||
Msg::UnsupportedMetadataVersion { version } => format!("不受支持的元数据版本 {version}").into(),
|
||||
Msg::MetadataTransformFailed => "元数据变换未通过验证".into(),
|
||||
Msg::LimitEntry { requested, limit } => format!("资源限制:{requested} 字节的条目超出 {limit} 字节的上限").into(),
|
||||
Msg::LimitTotal { requested, adding, limit } => format!("资源限制:{requested} 字节的任务总量超出 {limit} 字节的上限(新增 {adding} 字节)").into(),
|
||||
Msg::LimitEntries { requested, limit } => format!("资源限制:{requested} 个条目超出 {limit} 的上限").into(),
|
||||
Msg::LimitDepth { requested, limit } => format!("资源限制:嵌套深度 {requested} 超出 {limit} 的上限").into(),
|
||||
Msg::OutputNotRetained => "研究检查:未保留输出文件".into(),
|
||||
Msg::DryRunDiscarded => "试运行:生成的输出已丢弃".into(),
|
||||
Msg::TransformNoop => "变换已运行并通过验证;无需改写任何内容".into(),
|
||||
Msg::CompanionUnmatched => "存在同目录 `._` 文件,但不是此存根的载荷".into(),
|
||||
Msg::CompanionUnreadable { reason } => format!("无法读取同目录 `._` 文件:{reason}").into(),
|
||||
Msg::CompanionUnreadableUnknown => "无法读取同目录 `._` 文件".into(),
|
||||
Msg::MetadataLeftUntouched { version } => format!("不受支持的元数据版本 {version},保持原样").into(),
|
||||
Msg::UnexpectedPanic { message } => format!("意外内部错误:{message}").into(),
|
||||
Msg::InputNotExamined => "无法检查输入项".into(),
|
||||
Msg::NoCandidateValidated => "无候选通过验证".into(),
|
||||
Msg::NoModule0c => "没有适用于 v24.1 元数据的模块 0x0C".into(),
|
||||
Msg::AmbiguousModule0c => "模块 0x0C 绑定存在歧义".into(),
|
||||
Msg::UnsafePackageEntry { package } => format!("应用包 `{package}` 中存在不安全的条目路径").into(),
|
||||
Msg::UnsafeNestedEntry { path } => format!("`{path}` 中存在不安全的条目路径").into(),
|
||||
Msg::EntryStubTargetOutsideCode { branch, target } => format!("入口点 {branch} 目标 0x{target:X} 位于可执行节之外(DD8 选择可能错误)").into(),
|
||||
Msg::MissingMz => "缺少 'MZ' DOS 签名".into(),
|
||||
Msg::TruncatedDosHeader => "DOS 头部已截断(无 e_lfanew)".into(),
|
||||
Msg::MissingPeSignature { offset } => format!("0x{offset:X} 处缺少 'PE\\0\\0' 签名").into(),
|
||||
Msg::TruncatedCoffHeader => "COFF 头部已截断".into(),
|
||||
Msg::TruncatedOptionalHeader => "可选头部已截断".into(),
|
||||
Msg::BadOptionalMagic { magic } => format!("可选头部魔数 0x{magic:X} 无效").into(),
|
||||
Msg::ImplausibleSectionCount { count } => format!("节数量 {count} 不合理").into(),
|
||||
Msg::ZeroSizeOfImage => "SizeOfImage 为零".into(),
|
||||
Msg::SectionTablePastEof => "节表超出文件末尾".into(),
|
||||
Msg::SectionRawPastEof { index, start, end, file_len } => format!("节 #{index} 的原始数据 [0x{start:X}..0x{end:X}] 超出文件大小 0x{file_len:X}").into(),
|
||||
Msg::NoBaseRelocations => "原生 DLL 无基址重定位表(DD[5] 为零)— 在非首选基址加载时将崩溃".into(),
|
||||
Msg::ZeroEntryPoint => "入口点 RVA 为零".into(),
|
||||
Msg::EntryUnmapped { rva } => format!("入口点 RVA 0x{rva:X} 未映射到任何节").into(),
|
||||
Msg::EntryAllZeros { rva } => format!("RVA 0x{rva:X} 处的入口点全为零(存根未恢复)").into(),
|
||||
Msg::EntryAllInt3 { rva } => format!("RVA 0x{rva:X} 处的入口点全为 int3 填充(存根未恢复)").into(),
|
||||
Msg::EntryNotExecutable { rva } => format!("入口点 RVA 0x{rva:X} 不在可执行节中").into(),
|
||||
Msg::ImportDirectoryUnmapped { rva } => format!("导入目录 RVA 0x{rva:X} 未映射到任何节").into(),
|
||||
Msg::ImportNameUnmapped { index, rva } => format!("导入描述符 {index} 的 DLL 名称 RVA 0x{rva:X} 未映射到任何节").into(),
|
||||
Msg::ImportNameUnreadable { index, rva } => format!("导入描述符 {index} 在 RVA 0x{rva:X} 处的 DLL 名称不是可读的 ASCII(导入仍处于加密状态?)").into(),
|
||||
Msg::ClrDirectoryUnmapped { rva } => format!("CLR (COR20) 目录 RVA 0x{rva:X} 未映射到任何节").into(),
|
||||
Msg::ClrHeaderBadSize { rva, size } => format!("RVA 0x{rva:X} 处的 COR20 头部 cb 为 0x{size:X}(应为 0x48)— CLR 头部已损坏").into(),
|
||||
Msg::ClrMetadataUnmapped { rva } => format!("CLR MetaData RVA 0x{rva:X} 未映射到任何节").into(),
|
||||
Msg::ClrMetadataNoBsjb { rva } => format!("RVA 0x{rva:X} 处的 CLR MetaData 缺少 'BSJB' 签名(元数据已损坏 — 托管映像将无法加载)").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn step(step: &Step) -> Cow<'static, str> {
|
||||
match step {
|
||||
Step::DecryptHeader => "正在解密文件头部...".into(),
|
||||
Step::DecryptPayload => "正在解密载荷...".into(),
|
||||
Step::LocateConfig => "正在定位配置布局...".into(),
|
||||
Step::DecryptStage2 => "正在解密 stage2...".into(),
|
||||
Step::DecryptStages3To5 => "正在解密阶段 3-5...".into(),
|
||||
Step::DecryptSections => "正在解密节数据...".into(),
|
||||
Step::DecryptSectionsNewLayout => "正在解密节数据(新布局)...".into(),
|
||||
Step::LoadSections => "正在加载并解压各节...".into(),
|
||||
Step::DecryptImports => "正在解密导入字符串...".into(),
|
||||
Step::RebuildHeaders => "正在重建 PE 头部...".into(),
|
||||
Step::Pe32LocateConfig => "正在定位配置布局 (PE32)...".into(),
|
||||
Step::Pe32Stages => "正在解密各阶段 (PE32)...".into(),
|
||||
Step::Pe32EighthStage => "正在解密 eighthStage (PE32)...".into(),
|
||||
Step::Pe32Load => "正在加载并解压文件数据 (PE32)...".into(),
|
||||
Step::Pe32Text { formula } => {
|
||||
format!("正在解密 .text (PE32 dd8, formula={formula})...").into()
|
||||
}
|
||||
Step::Pe32TextSkip => "正在跳过 .text dd8(已是明文)...".into(),
|
||||
Step::Pe32Imports => "正在解密导入字符串 (PE32)...".into(),
|
||||
Step::Pe32Rebuild => "正在重建 PE 文件布局 (PE32)...".into(),
|
||||
Step::InitKeys => "正在初始化密钥...".into(),
|
||||
Step::DecryptKeyTable => "正在解密密钥表...".into(),
|
||||
Step::DecryptPrimary => "正在解密主描述符...".into(),
|
||||
Step::RelocsParams => "正在处理重定位与解压参数...".into(),
|
||||
Step::DecryptBlock1 => "正在解密代码块 1 (addr3)...".into(),
|
||||
Step::DecryptBlocks2To3 => "正在解密代码块 2-3 (addr3b, addr4)...".into(),
|
||||
Step::DecryptBlock4 => "正在解密代码块 4 (addr5)...".into(),
|
||||
Step::DllSections => "正在解密并解压各节...".into(),
|
||||
Step::FixHeaders => "正在修正 PE 头部与节表...".into(),
|
||||
Step::AndroidPrimary => "正在解码主 0x9D 目标映像容器...".into(),
|
||||
Step::AndroidAuxiliary => "正在解码辅助 0x9D ELF 物化容器...".into(),
|
||||
Step::AndroidTables => "正在重建静态 ELF 动态链接器表...".into(),
|
||||
Step::WriteTo { dest } => format!("写入 {dest}").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn term(term: &Term) -> Cow<'static, str> {
|
||||
match term {
|
||||
Term::Ok => "正常",
|
||||
Term::Suspect => "可疑",
|
||||
Term::Recognized => "已识别",
|
||||
Term::NotRecognized => "未识别",
|
||||
Term::Skipped => "已跳过",
|
||||
Term::Error => "错误",
|
||||
Term::Restored => "已恢复",
|
||||
Term::Duplicate => "重复",
|
||||
Term::NotTarget => "非目标",
|
||||
Term::Unchanged => "未更改",
|
||||
Term::Inventoried => "已列出",
|
||||
Term::Failed => "失败",
|
||||
Term::Blocked => "受阻",
|
||||
Term::NotAttempted => "未尝试",
|
||||
Term::Succeeded => "成功",
|
||||
Term::Rejected => "已拒绝",
|
||||
Term::Clean => "干净",
|
||||
Term::Warnings => "警告",
|
||||
Term::NotRun => "未运行",
|
||||
Term::Absent => "无",
|
||||
Term::Spliced => "已拼接",
|
||||
Term::Unmatched => "不匹配",
|
||||
Term::Unreadable => "不可读",
|
||||
Term::Detection => "检测",
|
||||
Term::ManifestInventory => "清单清点",
|
||||
Term::EntryProbe => "条目探测",
|
||||
Term::Recovery => "恢复",
|
||||
Term::StaticValidation => "静态验证",
|
||||
Term::OutputWrite => "输出写入",
|
||||
Term::SharedLibrary => "共享库",
|
||||
Term::Metadata => "元数据",
|
||||
Term::ExeStyle => "EXE 风格加载器",
|
||||
Term::Dll => "DLL 加载器",
|
||||
Term::AndroidStaged => "Android 分阶段加载器",
|
||||
Term::MetadataSeeded => "基于种子的元数据变换",
|
||||
Term::MetadataStructural => "结构化元数据变换",
|
||||
Term::MetadataMethodIndices => "元数据方法索引恢复",
|
||||
Term::WindowsPe => "Windows PE",
|
||||
Term::AndroidElf => "Android ELF",
|
||||
Term::Il2cppMetadata => "il2cpp 元数据",
|
||||
Term::NativeExe => "原生 EXE",
|
||||
Term::ManagedExe => ".NET EXE",
|
||||
Term::NativeDll => "原生 DLL",
|
||||
Term::ManagedDll => ".NET DLL",
|
||||
Term::HeaderMagic => "头部魔数",
|
||||
Term::ExternalCompanionDeclaration => "声明了外部伴生文件",
|
||||
Term::CompanionSpliced => "已拼接伴生文件",
|
||||
Term::PrivateSection => "私有节",
|
||||
Term::AesSchedule => "AES 密钥编排表",
|
||||
Term::ValidatedMetadataTransform => "已验证的元数据变换",
|
||||
Term::Known => "已知",
|
||||
Term::ContextRequired => "需要应用上下文",
|
||||
Term::Unverified => "未验证",
|
||||
Term::Original => "原始文件",
|
||||
Term::SplicedCompanion => "已拼接伴生文件",
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
pub(crate) fn cli(cli: &Cli) -> Cow<'static, str> {
|
||||
match cli {
|
||||
Cli::Error => "错误".into(),
|
||||
Cli::Warning => "警告".into(),
|
||||
Cli::DoneIn { ms } => format!("完成,用时 {ms} ms").into(),
|
||||
Cli::PressEnter => "\n按 Enter 退出…".into(),
|
||||
Cli::ScanUnreadable { count } => format!("扫描期间有 {count} 个文件无法读取,可能遗漏了目标").into(),
|
||||
Cli::Summary { unpacked, skipped, errors, suspect, metadata } => format!("已解包 {unpacked} · 已跳过 {skipped} · 错误 {errors} · 可疑 {suspect} · 元数据 {metadata}").into(),
|
||||
Cli::SummaryPackages { packages } => format!(" · 应用包 {packages}").into(),
|
||||
Cli::IntegrityFailed => "完整性检查失败".into(),
|
||||
Cli::IntegrityFailedLikelyCrash => "! 完整性检查失败(运行时极可能崩溃)".into(),
|
||||
Cli::MetadataLine { rel, dest, remapped } => format!("元数据 {rel} -> {dest} ({remapped} 个方法字段已重映射)").into(),
|
||||
Cli::MetadataVersionLine { version, dest, remapped } => format!("元数据 v{version} -> {dest} ({remapped} 个方法字段已重映射)").into(),
|
||||
Cli::MetadataAlreadyClean { version } => format!("元数据 v{version}:").into(),
|
||||
Cli::MetadataNothingToDo => "已解混淆,无需处理".into(),
|
||||
Cli::EmbeddedMetadataLine { input, dest } => format!("元数据 {input} (内嵌) -> {dest}").into(),
|
||||
Cli::EmbeddedMetadataFailed => "内嵌元数据".into(),
|
||||
Cli::MetadataUnsupportedLine { version } => format!("不受支持的元数据版本 {version},保持原样").into(),
|
||||
Cli::OutRequiresDirectory => "--out 需要目录参数".into(),
|
||||
Cli::UnknownOption { option } => format!("未知选项 '{option}'").into(),
|
||||
Cli::MultipleInputs { first, second } => format!("指定了多个输入路径('{first}' 与 '{second}')").into(),
|
||||
Cli::SubcommandNeedsPath { subcommand } => format!("'{subcommand}' 需要输入路径").into(),
|
||||
Cli::InspectNoDryRun => "'inspect' 不写出任何内容;请移除 --dry-run".into(),
|
||||
Cli::InspectNoOut => "'inspect' 不写出任何内容;不允许使用 --out".into(),
|
||||
Cli::DryRunNoOut => "--dry-run 不写出输出;不允许使用 --out".into(),
|
||||
Cli::ColorRequiresMode => "--color 需要 auto、always 或 never".into(),
|
||||
Cli::ThreadsRequiresInteger => "--threads 需要正整数参数".into(),
|
||||
Cli::LimitRequiresInteger { flag } => format!("{flag} 需要无符号整数参数").into(),
|
||||
Cli::LimitMustBePositive { flag } => format!("{flag} 必须大于零").into(),
|
||||
Cli::LimitTooLarge { flag } => format!("{flag} 超出受支持的字节范围").into(),
|
||||
Cli::UnknownLimit { flag } => format!("未知资源选项 '{flag}'").into(),
|
||||
Cli::HelpPath => " <file|folder>\n\
|
||||
\x20 受 CrackProof 保护的 PE (.exe/.dll)、il2cpp\n\
|
||||
\x20 global-metadata.dat、受保护的 Android AArch64 库 (.so)、\n\
|
||||
\x20 Android 应用包 (.apk/.apks/.xapk),或包含上述任意项的\n\
|
||||
\x20 文件夹。省略子命令时等同于 'unpack'。"
|
||||
.into(),
|
||||
Cli::HelpInspect => " inspect PATH\n\
|
||||
\x20 执行实际的静态恢复以供研究,并报告观察到的全部内容:\n\
|
||||
\x20 识别依据、尝试过的每条路线及其被拒绝的原因、最终选用的\n\
|
||||
\x20 路线、静态检查的结论,以及各引擎自身的结构化依据(保护\n\
|
||||
\x20 头部字段、种子、模块记录、恢复映像信息)。不保留任何\n\
|
||||
\x20 内容:不写输出文件、不写日志、不留临时目录,且绝不执行\n\
|
||||
\x20 输入项。"
|
||||
.into(),
|
||||
Cli::HelpUnpack => " unpack PATH 检测并恢复;写出输出(默认)。".into(),
|
||||
Cli::HelpJson => " --json 向标准输出写出单份带版本号的机器可读报告,不输出其他\n\
|
||||
\x20 内容。隐含静默模式与 --no-log。"
|
||||
.into(),
|
||||
Cli::HelpDryRun => " --dry-run 执行实际的恢复但不保留任何内容:不写输出目录,也不写\n\
|
||||
\x20 日志。Android 提取仍会使用其自身的临时工作区,随后即被\n\
|
||||
\x20 丢弃。"
|
||||
.into(),
|
||||
Cli::HelpThreads => " --threads N 本次运行的工作线程数上限(正整数)。覆盖 SENBEI_THREADS;\n\
|
||||
\x20 设为 1 则使用顺序执行路径。环境变量保持不变。"
|
||||
.into(),
|
||||
Cli::HelpColor => " --color MODE auto(默认)、always 或 never;也支持 --color=MODE。\n\
|
||||
\x20 auto 会分别为终端标准输出与标准错误着色,除非 NO_COLOR\n\
|
||||
\x20 非空或 TERM=dumb。显式指定 always/never 会覆盖这些变量。\n\
|
||||
\x20 JSON 与保存的日志始终为纯文本。"
|
||||
.into(),
|
||||
Cli::HelpScanAll => " --scan-all 同时探测低于大小下限的 .exe/.dll/.so/元数据文件名;其他\n\
|
||||
\x20 文件名仍会被排除。"
|
||||
.into(),
|
||||
Cli::HelpStrictIntegrity => " --strict-integrity\n\
|
||||
\x20 当任一输出未通过静态完整性检查(可疑项)或有文件出错时,\n\
|
||||
\x20 以非零状态码退出。默认关闭:可疑项仍会写出,且除非有文件\n\
|
||||
\x20 出错,否则进程以 0 退出。静默级别保持不变。\n\
|
||||
\x20 配合 'inspect' 使用时,该检查作用于为研究而实际恢复的\n\
|
||||
\x20 映像;不保留输出文件。"
|
||||
.into(),
|
||||
Cli::HelpLimits { entry_mib, total_mib, entries, depth } => format!(
|
||||
" Android 资源限制(MiB = 1048576 字节):\n\
|
||||
\x20 --max-entry-mib N 单个归档条目/解码缓冲区/输出(默认 {entry_mib})\n\
|
||||
\x20 --max-total-mib N 累计归档字节数及单次引擎任务预算(默认 {total_mib})\n\
|
||||
\x20 --max-entries N 归档条目/阶段 2 记录数(默认 {entries})\n\
|
||||
\x20 --max-depth N 嵌套深度,根为 0(默认 {depth})\n\
|
||||
\x20 提取或分配前会检查限制;这些限制不是内存使用峰值的上限。"
|
||||
)
|
||||
.into(),
|
||||
Cli::HelpExitCodes => " 退出代码:0 成功,1 有目标失败(或启用 --strict-integrity 时存在可疑\n\
|
||||
\x20 项),2 命令行参数被拒绝。"
|
||||
.into(),
|
||||
Cli::ReportScanHeading => "扫描".into(),
|
||||
Cli::ReportScan { skipped, walk_errors, probe_errors } => format!("已探测非目标 {skipped} · 遍历错误 {walk_errors} · 探测错误 {probe_errors}").into(),
|
||||
Cli::ReportScanIncomplete => "分析不完整;部分目录项或所选文件无法检查".into(),
|
||||
Cli::AnalysisIncomplete => "分析不完整".into(),
|
||||
Cli::AnalysisIncompleteInput => "I/O、资源限制或基础环境阻碍了所请求的操作".into(),
|
||||
Cli::AnalysisIncompleteEntry => "所请求的条目分析未能完成".into(),
|
||||
Cli::Source { size } => format!("输入项: {size} 字节 (0x{size:X})").into(),
|
||||
Cli::Target { platform, format, kind } => format!("目标: {platform} · {format} · {kind}").into(),
|
||||
Cli::FormatUnavailable => "格式不可用".into(),
|
||||
Cli::KindUnavailable => "种类不适用或不可用".into(),
|
||||
Cli::ProtectionRecognition { status } => format!("保护识别: {status}").into(),
|
||||
Cli::Evidence { evidence } => format!("依据: {evidence}").into(),
|
||||
Cli::Route { route, outcome } => format!("路线 {route}: {outcome}").into(),
|
||||
Cli::SelectedRoute { route } => format!("已选用路线: {route}").into(),
|
||||
Cli::StaticRecovery { status } => format!("静态恢复: {status}").into(),
|
||||
Cli::OutputValidation { status } => format!("输出静态验证: {status}").into(),
|
||||
Cli::Companion { state } => format!("伴生文件: {state}").into(),
|
||||
Cli::CompanionIdentity { size, sha256 } => format!("{size} 字节 · SHA-256 {sha256}").into(),
|
||||
Cli::InputView { view } => format!("分析输入视图: {view}").into(),
|
||||
Cli::InputViewSplicedNote => "低于 0x1000 的文件偏移针对存根寻址;自 0x1000 起的偏移针对伴生文件偏移(文件偏移 - 0x1000)寻址".into(),
|
||||
Cli::MetadataIdentity { version, layout } => format!("IL2CPP 元数据版本: {version} · 布局定义 {layout}").into(),
|
||||
Cli::SeededTokens { value } => format!("基于种子的方法令牌: {}", yes_no(*value)).into(),
|
||||
Cli::StructuralTokens { value } => format!("结构化方法令牌: {}", yes_no(*value)).into(),
|
||||
Cli::MethodIndexRestore { value, context } => format!("方法索引恢复: {} · 需要应用上下文: {}", yes_no(*value), yes_no(*context)).into(),
|
||||
Cli::Container { kind, entries, manifests } => format!("容器: {kind} · 条目 {entries} · 清单 {manifests}").into(),
|
||||
Cli::Manifest { source, package, version } => format!("清单 {source} → {package} {version}").into(),
|
||||
Cli::Unnamed => "<unnamed>".into(),
|
||||
Cli::Candidate { entry } => format!("候选: {entry}").into(),
|
||||
Cli::MetadataEvidence => "元数据变换依据".into(),
|
||||
Cli::Entry { name, status } => format!("条目 {name}: {status}").into(),
|
||||
Cli::EntryRoute { route } => format!("路线: {route}").into(),
|
||||
Cli::EntryMetadataVersion { version } => format!("元数据版本: {version}").into(),
|
||||
Cli::EntryRemapped { remapped } => format!("已重映射方法字段: {remapped}").into(),
|
||||
Cli::ModuleContextSource { source } => format!("模块上下文来源: {source}").into(),
|
||||
Cli::StageLine { stage, status } => format!("阶段 {stage}: {status}").into(),
|
||||
Cli::Recovered { size, sha256 } => format!("已恢复: {size} 字节 · SHA-256 {sha256}").into(),
|
||||
Cli::InspectionStatus { status, ms } => format!("检查状态: {status} · {ms} ms").into(),
|
||||
Cli::DiagnosticWarning => "警告".into(),
|
||||
Cli::DiagnosticError => "错误".into(),
|
||||
Cli::DiagnosticReason => "原因".into(),
|
||||
Cli::DiagnosticDetail => "详情".into(),
|
||||
Cli::DiagnosticEnglish => "英文原文".into(),
|
||||
}
|
||||
}
|
||||
|
||||
/// A capability flag as a word of this language.
|
||||
fn yes_no(value: bool) -> &'static str {
|
||||
if value { "是" } else { "否" }
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
//! Traditional Chinese (Taiwan) localization (`zh-TW`).
|
||||
|
||||
use std::borrow::Cow;
|
||||
|
||||
use crate::{Cli, Msg, Step, Term};
|
||||
|
||||
pub(crate) fn msg(msg: &Msg) -> Cow<'static, str> {
|
||||
match msg {
|
||||
Msg::CompanionMissing => "缺少伴生檔案?此載入器需要相符的 <input>._ 載荷。請將它放在輸入檔案旁並再試一次。".into(),
|
||||
Msg::CompanionMismatch => "伴生檔案不相符:所提供的 ._ 載荷過短,或其標頭與載入器不同。請使用來自同一組建的伴生檔案;兩個檔案其中之一可能已損毀。".into(),
|
||||
Msg::InputTooShort { actual, required } => format!("輸入過短(至少需要 {required} 位元組,實際為 {actual} 位元組)").into(),
|
||||
Msg::NotProtected => "不是受 CrackProof 保護的檔案".into(),
|
||||
Msg::InvalidPeOffset { offset, input_len } => format!("對於 {input_len} 位元組的輸入而言,PE 標頭偏移 {offset} 無效").into(),
|
||||
Msg::DllNeedsPe32Plus { found } => format!("DLL 管線需要 PE32+ 選用標頭魔術數字,但實際為 0x{found:04X}").into(),
|
||||
Msg::LayoutUnsupported => "找不到 stage5 標記——此解包工具不支援此組建的結構配置".into(),
|
||||
Msg::InternalPanic { file, line, column, message } => format!("於 {file}:{line}:{column} 發生內部錯誤:{message}").into(),
|
||||
Msg::DecodeFailed => "受保護資料未能如預期解碼;檔案可能已損毀,或此組建的結構配置不受支援".into(),
|
||||
Msg::NotPe => "輸入不是 PE 映像".into(),
|
||||
Msg::NotElf64 => "輸入不是小端序 ELF64 映像".into(),
|
||||
Msg::NotAarch64 => "輸入不是 AArch64 映像".into(),
|
||||
Msg::NotMetadata => "不是 il2cpp global-metadata.dat".into(),
|
||||
Msg::NotIl2cppMetadata => "不是 IL2CPP global-metadata.dat".into(),
|
||||
Msg::UnsupportedMetadataVersion { version } => format!("不支援的中繼資料版本 {version}").into(),
|
||||
Msg::MetadataTransformFailed => "中繼資料轉換未通過驗證".into(),
|
||||
Msg::LimitEntry { requested, limit } => format!("資源限制:{requested} 位元組的條目超過 {limit} 位元組的上限").into(),
|
||||
Msg::LimitTotal { requested, adding, limit } => format!("資源限制:工作總計 {requested} 位元組超過 {limit} 位元組的上限(新增 {adding} 位元組)").into(),
|
||||
Msg::LimitEntries { requested, limit } => format!("資源限制:{requested} 個條目超過上限 {limit}").into(),
|
||||
Msg::LimitDepth { requested, limit } => format!("資源限制:巢狀深度 {requested} 超過上限 {limit}").into(),
|
||||
Msg::OutputNotRetained => "研究檢查:未保留任何輸出檔案".into(),
|
||||
Msg::DryRunDiscarded => "試執行:已捨棄產生的輸出".into(),
|
||||
Msg::TransformNoop => "轉換已執行並通過驗證;無須改寫任何內容".into(),
|
||||
Msg::CompanionUnmatched => "同目錄下存在 `._` 檔案,但不是此載入器存根的載荷".into(),
|
||||
Msg::CompanionUnreadable { reason } => format!("無法讀取同目錄下的 `._` 檔案:{reason}").into(),
|
||||
Msg::CompanionUnreadableUnknown => "無法讀取同目錄下的 `._` 檔案".into(),
|
||||
Msg::MetadataLeftUntouched { version } => format!("不支援的中繼資料版本 {version},已保持原樣").into(),
|
||||
Msg::UnexpectedPanic { message } => format!("非預期的內部錯誤:{message}").into(),
|
||||
Msg::InputNotExamined => "無法檢驗輸入項".into(),
|
||||
Msg::NoCandidateValidated => "沒有候選項目通過驗證".into(),
|
||||
Msg::NoModule0c => "v24.1 中繼資料缺少模組 0x0C".into(),
|
||||
Msg::AmbiguousModule0c => "模組 0x0C 繫結不明確".into(),
|
||||
Msg::UnsafePackageEntry { package } => format!("應用程式套件 `{package}` 中含有不安全的條目路徑").into(),
|
||||
Msg::UnsafeNestedEntry { path } => format!("`{path}` 中含有不安全的條目路徑").into(),
|
||||
Msg::EntryStubTargetOutsideCode { branch, target } => format!("進入點 {branch} 目標 0x{target:X} 位於可執行節區之外(DD8 選取可能錯誤)").into(),
|
||||
Msg::MissingMz => "缺少 'MZ' DOS 簽章".into(),
|
||||
Msg::TruncatedDosHeader => "DOS 標頭已截斷(無 e_lfanew)".into(),
|
||||
Msg::MissingPeSignature { offset } => format!("於 0x{offset:X} 處缺少 'PE\\0\\0' 簽章").into(),
|
||||
Msg::TruncatedCoffHeader => "COFF 標頭已截斷".into(),
|
||||
Msg::TruncatedOptionalHeader => "選用標頭已截斷".into(),
|
||||
Msg::BadOptionalMagic { magic } => format!("選用標頭魔術數字 0x{magic:X} 無效").into(),
|
||||
Msg::ImplausibleSectionCount { count } => format!("不合理的節區數量 {count}").into(),
|
||||
Msg::ZeroSizeOfImage => "SizeOfImage 為零".into(),
|
||||
Msg::SectionTablePastEof => "節區表超出檔案結尾".into(),
|
||||
Msg::SectionRawPastEof { index, start, end, file_len } => format!("節區 #{index} 原始資料 [0x{start:X}..0x{end:X}] 超出檔案大小 0x{file_len:X}").into(),
|
||||
Msg::NoBaseRelocations => "原生 DLL 無基底重定位表(DD[5] 為零)——在非偏好基底位址載入時將會當機".into(),
|
||||
Msg::ZeroEntryPoint => "進入點 RVA 為零".into(),
|
||||
Msg::EntryUnmapped { rva } => format!("進入點 RVA 0x{rva:X} 未映射至任何節區").into(),
|
||||
Msg::EntryAllZeros { rva } => format!("位於 RVA 0x{rva:X} 的進入點全為零(存根未恢復)").into(),
|
||||
Msg::EntryAllInt3 { rva } => format!("位於 RVA 0x{rva:X} 的進入點全為 int3 填充(存根未恢復)").into(),
|
||||
Msg::EntryNotExecutable { rva } => format!("進入點 RVA 0x{rva:X} 不在可執行節區內").into(),
|
||||
Msg::ImportDirectoryUnmapped { rva } => format!("匯入目錄 RVA 0x{rva:X} 未映射至任何節區").into(),
|
||||
Msg::ImportNameUnmapped { index, rva } => format!("匯入描述元 {index} 的 DLL 名稱 RVA 0x{rva:X} 未映射至任何節區").into(),
|
||||
Msg::ImportNameUnreadable { index, rva } => format!("匯入描述元 {index} 位於 RVA 0x{rva:X} 的 DLL 名稱不是可讀取的 ASCII(匯入表仍處於加密狀態?)").into(),
|
||||
Msg::ClrDirectoryUnmapped { rva } => format!("CLR (COR20) 目錄 RVA 0x{rva:X} 未映射至任何節區").into(),
|
||||
Msg::ClrHeaderBadSize { rva, size } => format!("位於 RVA 0x{rva:X} 的 COR20 標頭 cb 為 0x{size:X}(預期為 0x48)——CLR 標頭已損毀").into(),
|
||||
Msg::ClrMetadataUnmapped { rva } => format!("CLR MetaData RVA 0x{rva:X} 未映射至任何節區").into(),
|
||||
Msg::ClrMetadataNoBsjb { rva } => format!("位於 RVA 0x{rva:X} 的 CLR MetaData 缺少 'BSJB' 簽章(中繼資料已損毀——受控映像將無法載入)").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn step(step: &Step) -> Cow<'static, str> {
|
||||
match step {
|
||||
Step::DecryptHeader => "解密檔案標頭...".into(),
|
||||
Step::DecryptPayload => "解密載荷...".into(),
|
||||
Step::LocateConfig => "定位組態配置...".into(),
|
||||
Step::DecryptStage2 => "解密 stage2...".into(),
|
||||
Step::DecryptStages3To5 => "解密階段 3-5...".into(),
|
||||
Step::DecryptSections => "解密節區資料...".into(),
|
||||
Step::DecryptSectionsNewLayout => "解密節區資料(新結構配置)...".into(),
|
||||
Step::LoadSections => "載入並解壓縮節區...".into(),
|
||||
Step::DecryptImports => "解密匯入字串...".into(),
|
||||
Step::RebuildHeaders => "重建 PE 標頭...".into(),
|
||||
Step::Pe32LocateConfig => "定位組態配置 (PE32)...".into(),
|
||||
Step::Pe32Stages => "解密各階段 (PE32)...".into(),
|
||||
Step::Pe32EighthStage => "解密 eighthStage (PE32)...".into(),
|
||||
Step::Pe32Load => "載入並解壓縮檔案資料 (PE32)...".into(),
|
||||
Step::Pe32Text { formula } => format!("解密 .text (PE32 dd8, formula={formula})...").into(),
|
||||
Step::Pe32TextSkip => "略過 .text dd8(已為明文)...".into(),
|
||||
Step::Pe32Imports => "解密匯入字串 (PE32)...".into(),
|
||||
Step::Pe32Rebuild => "重建 PE 檔案配置 (PE32)...".into(),
|
||||
Step::InitKeys => "初始化金鑰...".into(),
|
||||
Step::DecryptKeyTable => "解密金鑰表...".into(),
|
||||
Step::DecryptPrimary => "解密主要描述元...".into(),
|
||||
Step::RelocsParams => "處理重定位與解壓縮參數...".into(),
|
||||
Step::DecryptBlock1 => "解密程式碼區塊 1 (addr3)...".into(),
|
||||
Step::DecryptBlocks2To3 => "解密程式碼區塊 2-3 (addr3b, addr4)...".into(),
|
||||
Step::DecryptBlock4 => "解密程式碼區塊 4 (addr5)...".into(),
|
||||
Step::DllSections => "解密並解壓縮節區...".into(),
|
||||
Step::FixHeaders => "修補 PE 標頭與節區表...".into(),
|
||||
Step::AndroidPrimary => "解碼主要 0x9D 目標映像容器...".into(),
|
||||
Step::AndroidAuxiliary => "解碼輔助 0x9D ELF 實體化容器...".into(),
|
||||
Step::AndroidTables => "重建靜態 ELF 動態連結器表...".into(),
|
||||
Step::WriteTo { dest } => format!("寫入至 {dest}").into(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn term(term: &Term) -> Cow<'static, str> {
|
||||
match term {
|
||||
Term::Ok => "正常",
|
||||
Term::Suspect => "可疑",
|
||||
Term::Recognized => "已識別",
|
||||
Term::NotRecognized => "未識別",
|
||||
Term::Skipped => "已略過",
|
||||
Term::Error => "錯誤",
|
||||
Term::Restored => "已恢復",
|
||||
Term::Duplicate => "重複",
|
||||
Term::NotTarget => "非目標",
|
||||
Term::Unchanged => "未變更",
|
||||
Term::Inventoried => "已列出",
|
||||
Term::Failed => "失敗",
|
||||
Term::Blocked => "受阻",
|
||||
Term::NotAttempted => "未嘗試",
|
||||
Term::Succeeded => "成功",
|
||||
Term::Rejected => "已拒絕",
|
||||
Term::Clean => "乾淨",
|
||||
Term::Warnings => "警告",
|
||||
Term::NotRun => "未執行",
|
||||
Term::Absent => "無",
|
||||
Term::Spliced => "已拼接",
|
||||
Term::Unmatched => "不相符",
|
||||
Term::Unreadable => "無法讀取",
|
||||
Term::Detection => "偵測",
|
||||
Term::ManifestInventory => "資訊清單清查",
|
||||
Term::EntryProbe => "條目探測",
|
||||
Term::Recovery => "恢復",
|
||||
Term::StaticValidation => "靜態驗證",
|
||||
Term::OutputWrite => "輸出寫入",
|
||||
Term::SharedLibrary => "共用程式庫",
|
||||
Term::Metadata => "中繼資料",
|
||||
Term::ExeStyle => "EXE 風格",
|
||||
Term::Dll => "DLL",
|
||||
Term::AndroidStaged => "Android 分階段",
|
||||
Term::MetadataSeeded => "基於種子的中繼資料",
|
||||
Term::MetadataStructural => "結構化中繼資料",
|
||||
Term::MetadataMethodIndices => "中繼資料方法索引",
|
||||
Term::WindowsPe => "Windows PE",
|
||||
Term::AndroidElf => "Android ELF",
|
||||
Term::Il2cppMetadata => "il2cpp 中繼資料",
|
||||
Term::NativeExe => "原生 EXE",
|
||||
Term::ManagedExe => ".NET EXE",
|
||||
Term::NativeDll => "原生 DLL",
|
||||
Term::ManagedDll => ".NET DLL",
|
||||
Term::HeaderMagic => "標頭魔術數字",
|
||||
Term::ExternalCompanionDeclaration => "宣告外部伴生檔案",
|
||||
Term::CompanionSpliced => "伴生檔案已拼接",
|
||||
Term::PrivateSection => "私有節區",
|
||||
Term::AesSchedule => "AES 金鑰排程",
|
||||
Term::ValidatedMetadataTransform => "已驗證的中繼資料轉換",
|
||||
Term::Known => "已知",
|
||||
Term::ContextRequired => "需要應用程式上下文",
|
||||
Term::Unverified => "未驗證",
|
||||
Term::Original => "原始檔案",
|
||||
Term::SplicedCompanion => "已拼接伴生檔案",
|
||||
}
|
||||
.into()
|
||||
}
|
||||
|
||||
pub(crate) fn cli(cli: &Cli) -> Cow<'static, str> {
|
||||
match cli {
|
||||
Cli::Error => "錯誤".into(),
|
||||
Cli::Warning => "警告".into(),
|
||||
Cli::DoneIn { ms } => format!("完成,耗時 {ms} ms").into(),
|
||||
Cli::PressEnter => "\n請按 Enter 鍵結束…".into(),
|
||||
Cli::ScanUnreadable { count } => format!("掃描期間有 {count} 個檔案無法讀取,可能遺漏目標").into(),
|
||||
Cli::Summary { unpacked, skipped, errors, suspect, metadata } => format!("已解包 {unpacked} · 已略過 {skipped} · 錯誤 {errors} · 可疑 {suspect} · 中繼資料 {metadata}").into(),
|
||||
Cli::SummaryPackages { packages } => format!(" · 應用程式套件 {packages}").into(),
|
||||
Cli::IntegrityFailed => "完整性檢查失敗".into(),
|
||||
Cli::IntegrityFailedLikelyCrash => "! 完整性檢查失敗(執行時期極可能當機)".into(),
|
||||
Cli::MetadataLine { rel, dest, remapped } => format!("中繼資料 {rel} -> {dest} (已重新映射 {remapped} 個方法欄位)").into(),
|
||||
Cli::MetadataVersionLine { version, dest, remapped } => format!("中繼資料 v{version} -> {dest} (已重新映射 {remapped} 個方法欄位)").into(),
|
||||
Cli::MetadataAlreadyClean { version } => format!("中繼資料 v{version}:").into(),
|
||||
Cli::MetadataNothingToDo => "已解除混淆,無須處理".into(),
|
||||
Cli::EmbeddedMetadataLine { input, dest } => format!("中繼資料 {input}(內嵌) -> {dest}").into(),
|
||||
Cli::EmbeddedMetadataFailed => "內嵌中繼資料".into(),
|
||||
Cli::MetadataUnsupportedLine { version } => format!("不支援的中繼資料版本 {version},已保持原樣").into(),
|
||||
Cli::OutRequiresDirectory => "--out 需要指定目錄引數".into(),
|
||||
Cli::UnknownOption { option } => format!("未知的選項 '{option}'").into(),
|
||||
Cli::MultipleInputs { first, second } => format!("指定了多個輸入路徑('{first}' 與 '{second}')").into(),
|
||||
Cli::SubcommandNeedsPath { subcommand } => format!("'{subcommand}' 需要指定輸入路徑").into(),
|
||||
Cli::InspectNoDryRun => "'inspect' 不會寫入任何內容;請移除 --dry-run".into(),
|
||||
Cli::InspectNoOut => "'inspect' 不會寫入任何內容;不允許使用 --out".into(),
|
||||
Cli::DryRunNoOut => "--dry-run 不會寫入任何輸出;不允許使用 --out".into(),
|
||||
Cli::ColorRequiresMode => "--color 需要指定 auto、always 或 never".into(),
|
||||
Cli::ThreadsRequiresInteger => "--threads 需要指定正整數引數".into(),
|
||||
Cli::LimitRequiresInteger { flag } => format!("{flag} 需要指定無號整數引數").into(),
|
||||
Cli::LimitMustBePositive { flag } => format!("{flag} 必須大於零").into(),
|
||||
Cli::LimitTooLarge { flag } => format!("{flag} 超出支援的位元組範圍").into(),
|
||||
Cli::UnknownLimit { flag } => format!("未知的資源選項 '{flag}'").into(),
|
||||
Cli::HelpPath => " <file|folder>\n\
|
||||
\x20 受保護的 CrackProof PE (.exe/.dll)、il2cpp\n\
|
||||
\x20 global-metadata.dat、受保護的 Android AArch64 程式庫\n\
|
||||
\x20 (.so)、Android 應用程式套件 (.apk/.apks/.xapk),或包含\n\
|
||||
\x20 上述項目的資料夾。省略子命令時等同於 'unpack'。"
|
||||
.into(),
|
||||
Cli::HelpInspect => " inspect PATH\n\
|
||||
\x20 執行研究用的真實靜態恢復流程,並回報觀測到的一切:\n\
|
||||
\x20 識別依據、嘗試過的各條路線及其遭拒原因、選用的路線、\n\
|
||||
\x20 靜態檢查的判定結果,以及引擎本身的結構依據(保護標頭\n\
|
||||
\x20 欄位、種子、模組記錄、恢復映像資訊)。不會保留任何\n\
|
||||
\x20 內容:無輸出檔案、無記錄檔、無暫存目錄,且絕不執行\n\
|
||||
\x20 輸入項。"
|
||||
.into(),
|
||||
Cli::HelpUnpack => " unpack PATH 偵測並恢復;將結果寫入輸出(預設動作)。".into(),
|
||||
Cli::HelpJson => " --json 將單一含版本資訊的機器可讀報告寫入 stdout,不輸出其他\n\
|
||||
\x20 內容。隱含安靜模式與 --no-log。"
|
||||
.into(),
|
||||
Cli::HelpDryRun => " --dry-run 執行真實恢復流程但不保留任何內容:無輸出目錄,亦無\n\
|
||||
\x20 記錄檔。Android 提取仍會使用其專屬的暫存工作區,完成後\n\
|
||||
\x20 即會捨棄。"
|
||||
.into(),
|
||||
Cli::HelpThreads => " --threads N 此次執行的工作執行緒正整數上限。會覆寫 SENBEI_THREADS;\n\
|
||||
\x20 設為 1 會使用循序執行路徑。環境變數本身不會變更。"
|
||||
.into(),
|
||||
Cli::HelpColor => " --color MODE 可為 auto(預設)、always 或 never;亦支援 --color=MODE。\n\
|
||||
\x20 auto 會分別為終端機的 stdout/stderr 著色,除非 NO_COLOR\n\
|
||||
\x20 非空或 TERM=dumb。明確指定 always/never 會覆寫這些變數。\n\
|
||||
\x20 JSON 與儲存的記錄檔維持純文字。"
|
||||
.into(),
|
||||
Cli::HelpScanAll => " --scan-all 一併探測低於檔案大小下限的 .exe/.dll/.so/中繼資料名稱;\n\
|
||||
\x20 其他檔案名稱仍會排除。"
|
||||
.into(),
|
||||
Cli::HelpStrictIntegrity => " --strict-integrity\n\
|
||||
\x20 當任何輸出未通過靜態完整性檢查(可疑)或有檔案發生錯誤\n\
|
||||
\x20 時,以非零狀態碼結束。預設為關閉:可疑檔案仍會寫出,且\n\
|
||||
\x20 除非有檔案發生錯誤,否則處理序會以 0 結束。安靜模式層級\n\
|
||||
\x20 維持不變。搭配 'inspect' 時,檢查會套用至為研究而實際\n\
|
||||
\x20 恢復的映像;不會保留任何輸出檔案。"
|
||||
.into(),
|
||||
Cli::HelpLimits { entry_mib, total_mib, entries, depth } => format!(
|
||||
" Android 資源限制(MiB = 1048576 位元組):\n\
|
||||
\x20 --max-entry-mib N 單一封存條目/已解碼緩衝區/輸出(預設 {entry_mib})\n\
|
||||
\x20 --max-total-mib N 累計封存位元組數與單一引擎工作配額(預設 {total_mib})\n\
|
||||
\x20 --max-entries N 封存條目/階段 2 記錄數(預設 {entries})\n\
|
||||
\x20 --max-depth N 巢狀深度,根層級 = 0(預設 {depth})\n\
|
||||
\x20 系統會在解壓縮或配置記憶體前檢查限制;這些限制並非尖峰記憶體使用量上限。"
|
||||
)
|
||||
.into(),
|
||||
Cli::HelpExitCodes => " 結束代碼:0 成功,1 目標失敗(或啟用 --strict-integrity 時有可疑項),\n\
|
||||
\x20 2 命令列參數遭拒。"
|
||||
.into(),
|
||||
Cli::ReportScanHeading => "掃描".into(),
|
||||
Cli::ReportScan { skipped, walk_errors, probe_errors } => format!("已探測非目標 {skipped} · 走訪錯誤 {walk_errors} · 探測錯誤 {probe_errors}").into(),
|
||||
Cli::ReportScanIncomplete => "分析不完整;部分目錄項目或所選檔案無法檢驗".into(),
|
||||
Cli::AnalysisIncomplete => "分析不完整".into(),
|
||||
Cli::AnalysisIncompleteInput => "I/O、資源限制或底層機制導致無法完成所要求的工作".into(),
|
||||
Cli::AnalysisIncompleteEntry => "無法完成所要求的條目分析".into(),
|
||||
Cli::Source { size } => format!("來源: {size} 位元組 (0x{size:X})").into(),
|
||||
Cli::Target { platform, format, kind } => format!("目標: {platform} · {format} · {kind}").into(),
|
||||
Cli::FormatUnavailable => "格式無法使用".into(),
|
||||
Cli::KindUnavailable => "種類不適用或無法使用".into(),
|
||||
Cli::ProtectionRecognition { status } => format!("保護識別: {status}").into(),
|
||||
Cli::Evidence { evidence } => format!("依據: {evidence}").into(),
|
||||
Cli::Route { route, outcome } => format!("路線 {route}: {outcome}").into(),
|
||||
Cli::SelectedRoute { route } => format!("已選用路線: {route}").into(),
|
||||
Cli::StaticRecovery { status } => format!("靜態恢復: {status}").into(),
|
||||
Cli::OutputValidation { status } => format!("輸出靜態驗證: {status}").into(),
|
||||
Cli::Companion { state } => format!("伴生檔案: {state}").into(),
|
||||
Cli::CompanionIdentity { size, sha256 } => format!("{size} 位元組 · SHA-256 {sha256}").into(),
|
||||
Cli::InputView { view } => format!("分析輸入檢視: {view}").into(),
|
||||
Cli::InputViewSplicedNote => "低於 0x1000 的檔案偏移定址載入器存根;自 0x1000 起的偏移定址伴生檔案偏移(檔案偏移 - 0x1000)".into(),
|
||||
Cli::MetadataIdentity { version, layout } => format!("IL2CPP 中繼資料版本: {version} · 結構配置定義 {layout}").into(),
|
||||
Cli::SeededTokens { value } => format!("基於種子的方法權杖: {}", yes_no(*value)).into(),
|
||||
Cli::StructuralTokens { value } => format!("結構化方法權杖: {}", yes_no(*value)).into(),
|
||||
Cli::MethodIndexRestore { value, context } => format!("方法索引恢復: {} · 需要應用程式上下文: {}", yes_no(*value), yes_no(*context)).into(),
|
||||
Cli::Container { kind, entries, manifests } => format!("容器: {kind} · {entries} 個條目 · {manifests} 份資訊清單").into(),
|
||||
Cli::Manifest { source, package, version } => format!("資訊清單 {source} → {package} {version}").into(),
|
||||
Cli::Unnamed => "<unnamed>".into(),
|
||||
Cli::Candidate { entry } => format!("候選: {entry}").into(),
|
||||
Cli::MetadataEvidence => "中繼資料轉換依據".into(),
|
||||
Cli::Entry { name, status } => format!("條目 {name}: {status}").into(),
|
||||
Cli::EntryRoute { route } => format!("路線: {route}").into(),
|
||||
Cli::EntryMetadataVersion { version } => format!("中繼資料版本: {version}").into(),
|
||||
Cli::EntryRemapped { remapped } => format!("已重新映射的方法欄位: {remapped}").into(),
|
||||
Cli::ModuleContextSource { source } => format!("模組上下文來源: {source}").into(),
|
||||
Cli::StageLine { stage, status } => format!("階段 {stage}: {status}").into(),
|
||||
Cli::Recovered { size, sha256 } => format!("已恢復: {size} 位元組 · SHA-256 {sha256}").into(),
|
||||
Cli::InspectionStatus { status, ms } => format!("檢查狀態: {status} · {ms} ms").into(),
|
||||
Cli::DiagnosticWarning => "警告".into(),
|
||||
Cli::DiagnosticError => "錯誤".into(),
|
||||
Cli::DiagnosticReason => "原因".into(),
|
||||
Cli::DiagnosticDetail => "詳情".into(),
|
||||
Cli::DiagnosticEnglish => "英文原文".into(),
|
||||
}
|
||||
}
|
||||
|
||||
/// A capability flag as a word of this language.
|
||||
fn yes_no(value: bool) -> &'static str {
|
||||
if value { "是" } else { "否" }
|
||||
}
|
||||
Reference in new issue
Block a user