chore(i18n): finish translating code comments and scripts to English
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
CI / Format and clippy (push) Successful in 1m57s
CI / Dependency audit (push) Successful in 13s
CI / Check desktop app (Linux) (push) Successful in 3m54s
CI / Tests (Linux) (push) Failing after 7m25s
Release / Create release (push) Successful in 6s
Release / CLI (linux-aarch64) (push) Successful in 1m48s
Release / CLI (linux-x86_64) (push) Successful in 2m39s
Release / Desktop app (linux-aarch64) (push) Successful in 10m9s
Release / Desktop app (linux-x86_64) (push) Successful in 12m20s
Release / Desktop app (windows) (push) Successful in 7m32s
Release / Build latest.json (push) Successful in 5s
Completes the English-only standardization for code, comments, scripts and CI templates (UI/CLI-facing strings stay bilingual pt-BR/en, untouched). Covers the remaining crates/, apps/gui/ui/ and apps/gui/src-tauri/ comments, .gitea/ workflow and template comments, .githooks/ hooks, and the scripts/ source comments for the files already renamed in a prior commit (check.sh, generate-logo.py, install-hooks.sh). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
This commit is contained in:
1 parent
da212e6926
commit
6328220c60
129 files changed
+1961
-1834
No files matched your search
@@ -1,6 +1,6 @@
|
||||
//! Mais formatos reconhecidos pela estrutura (cabeçalhos, blocos e tamanhos internos), para o
|
||||
//! carving devolver o arquivo inteiro e não só o começo. Cada detector devolve o tamanho exato
|
||||
//! quando a estrutura permite e uma confiança proporcional ao que foi conferido.
|
||||
//! Additional file formats recognized by internal structure (headers, chunks, and embedded sizes)
|
||||
//! so file carving recovers complete files rather than prefixes. Each detector returns the exact
|
||||
//! byte length when determinable and a confidence level proportional to structural validation.
|
||||
|
||||
use crate::signatures::Hit;
|
||||
use crate::source::{read_vec, Source};
|
||||
@@ -40,7 +40,7 @@ fn hit(len: u64, ext: &'static str, confidence: Confidence) -> Option<Hit> {
|
||||
})
|
||||
}
|
||||
|
||||
/// Primeiros bytes que disparam os detectores deste módulo.
|
||||
/// Leading byte values that trigger detectors in this module.
|
||||
pub fn might_start(b0: u8) -> bool {
|
||||
matches!(
|
||||
b0,
|
||||
@@ -67,7 +67,7 @@ pub fn might_start(b0: u8) -> bool {
|
||||
)
|
||||
}
|
||||
|
||||
/// Tenta os formatos adicionais. `h` são os primeiros bytes (>= 12) lidos em `off`.
|
||||
/// Probes additional formats. `h` contains the leading bytes (>= 12) read at `off`.
|
||||
pub fn detect(src: &dyn Source, off: u64, h: &[u8], max: u64) -> Option<Hit> {
|
||||
if h.starts_with(&[0x1F, 0x8B, 0x08]) {
|
||||
return gzip(src, off, max);
|
||||
@@ -153,9 +153,9 @@ pub fn detect(src: &dyn Source, off: u64, h: &[u8], max: u64) -> Option<Hit> {
|
||||
None
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------- compactadores
|
||||
// -------------------------------------------------------------- compressed streams
|
||||
|
||||
/// Alimenta um descompactador com blocos de `src` até o fim do fluxo; devolve (bytes lidos, saída crc32 opcional).
|
||||
/// Feeds chunks from `src` into a decompressor until end-of-stream; returns `(compressed_bytes, optional_crc32)`.
|
||||
fn inflate_len(
|
||||
src: &dyn Source,
|
||||
start: u64,
|
||||
@@ -311,7 +311,7 @@ fn zstd(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
if btype == 3 {
|
||||
return None;
|
||||
}
|
||||
// RLE: o conteúdo é 1 byte; os outros ocupam `bsize`.
|
||||
// RLE block: 1 byte in stream, expands to `bsize`.
|
||||
let body = if btype == 1 { 1 } else { bsize };
|
||||
pos += 3 + body;
|
||||
if pos - off > max {
|
||||
@@ -328,7 +328,7 @@ fn zstd(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
hit(p as u64, "zst", Confidence::Medium)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------ mídia
|
||||
// ------------------------------------------------------------------ media
|
||||
|
||||
fn vint(b: &[u8]) -> Option<(u64, usize, bool)> {
|
||||
let first = *b.first()?;
|
||||
@@ -367,7 +367,7 @@ fn matroska(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
return hit(total, ext, Confidence::High);
|
||||
}
|
||||
}
|
||||
// Tamanho desconhecido (gravação ao vivo): caminha pelos elementos de topo.
|
||||
// Unknown segment size (live recording): walk top-level EBML elements.
|
||||
let mut pos = off + (p + sl) as u64;
|
||||
let mut last_good = pos;
|
||||
for _ in 0..2_000_000 {
|
||||
@@ -394,7 +394,7 @@ fn matroska(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
hit(last_good - off, ext, Confidence::Low)
|
||||
}
|
||||
|
||||
/// ID de elemento EBML (mantém os bits de marcação).
|
||||
/// Reads an EBML element ID (preserving marker bits).
|
||||
fn vint_id(b: &[u8]) -> Option<(u64, usize, bool)> {
|
||||
let first = *b.first()?;
|
||||
let len = first.leading_zeros() as usize + 1;
|
||||
@@ -456,7 +456,7 @@ fn ogg(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
}
|
||||
|
||||
fn mpegts(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
// 188 bytes por pacote (ou 192 com carimbo de 4 bytes antes do sync).
|
||||
// 188 bytes per MPEG-TS packet (or 192 with a 4-byte timecode prefix before the sync byte).
|
||||
let probe = read_vec(src, off, 188 * 8).ok()?;
|
||||
if probe.len() < 188 * 8 || !(0..8).all(|i| probe[i * 188] == 0x47) {
|
||||
return None;
|
||||
@@ -492,7 +492,7 @@ fn flv(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
if t.len() < 15 {
|
||||
break;
|
||||
}
|
||||
// PreviousTagSize(4) + tipo(1) + tamanho(3)
|
||||
// PreviousTagSize(4) + tag_type(1) + data_size(3)
|
||||
let ty = t[4];
|
||||
if !matches!(ty, 8 | 9 | 18) {
|
||||
break;
|
||||
@@ -559,7 +559,7 @@ fn jp2(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
};
|
||||
if ty == b"jp2c" {
|
||||
if size == 0 {
|
||||
// até o fim do arquivo: procura EOC FF D9 depois
|
||||
// codestream extends to EOF: scan for EOC marker FF D9
|
||||
return hit((pos - off) + 8 + (4 << 20).min(max), "jp2", Confidence::Low);
|
||||
}
|
||||
return hit(pos - off + size, "jp2", Confidence::High);
|
||||
@@ -589,7 +589,7 @@ fn midi(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
hit(pos - off, "mid", Confidence::High)
|
||||
}
|
||||
|
||||
// -------------------------------------------------------- arquivos compactados
|
||||
// -------------------------------------------------------- archives
|
||||
|
||||
fn rar(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
let h = read_vec(src, off, 8).ok()?;
|
||||
@@ -703,7 +703,7 @@ fn swf(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
.then_some(())
|
||||
.and_then(|_| hit(len, "swf", Confidence::High));
|
||||
}
|
||||
// CWS: corpo em zlib a partir do byte 8
|
||||
// CWS: zlib-compressed body starting at byte 8
|
||||
let (consumed, _, out) = inflate_len(src, off + 8, max, false, true)?;
|
||||
hit(
|
||||
8 + consumed,
|
||||
@@ -716,7 +716,7 @@ fn swf(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------- binários e dados
|
||||
// ---------------------------------------------------------- binaries and data
|
||||
|
||||
fn elf(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
let h = read_vec(src, off, 64).ok()?;
|
||||
@@ -757,7 +757,7 @@ fn elf(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
)
|
||||
};
|
||||
let mut end = shoff + shentsize * shnum;
|
||||
// Segmentos de programa podem ir além (binários sem tabela de seções).
|
||||
// Program segments may extend further (stripped binaries without a section header table).
|
||||
if phnum > 0 && phnum < 256 && phentsize >= 32 {
|
||||
let ph = read_vec(src, off + phoff, (phnum * phentsize) as usize).ok()?;
|
||||
for i in 0..phnum as usize {
|
||||
@@ -947,7 +947,7 @@ fn ico(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
}
|
||||
end = end.max(o + size);
|
||||
}
|
||||
// a imagem de cada entrada: BMP/DIB (tamanho do cabeçalho 40) ou PNG
|
||||
// each icon entry payload is either a BMP/DIB (40-byte header) or a PNG
|
||||
let first_off = u32le(&d, 12);
|
||||
let probe = read_vec(src, off + first_off, 8).ok()?;
|
||||
if !(probe.starts_with(&[0x89, b'P', b'N', b'G']) || u32le(&probe, 0) == 40) {
|
||||
@@ -961,7 +961,7 @@ fn regf(src: &dyn Source, off: u64, max: u64) -> Option<Hit> {
|
||||
if h.len() < 4096 {
|
||||
return None;
|
||||
}
|
||||
// soma XOR dos 127 primeiros u32 = valor em 0x1FC
|
||||
// XOR checksum of the first 127 u32 words must match the word at 0x1FC
|
||||
let mut x = 0u32;
|
||||
for i in 0..127 {
|
||||
x ^= u32le(&h, i * 4) as u32;
|
||||
|
||||
Reference in new issue
Block a user