Sha1Final
function · net · primitive
- Address
0x5d1b60· 122 bytes, up to0x5d1bd9- Signature
void __thiscall (void *this, uint8_t *digest)- Meaning
- Pads a SHA-1 context with 0x80 and zeros to 56 mod 64, adds the big-endian bit count, writes the 20-byte digest
- Confidence
- verified, proof one
- Finding
- net/crypto#sha-1-first-context
- Test
net::checksum_proof,net::hmac_sha1,net::sha1_family_a
Finding: SHA-1 first context in net: crypto
The logon checksum and the pin hash use a second SHA-1 implementation. Its context is a 64-bit bit count (low dword +0, high +4), five state words from +8, and a 64-byte buffer from +0x1c. Init zeroes the count and loads the five standard words. Update adds 8 per byte to the count, tops up the buffer, compresses whole blocks straight from the caller's bytes, and buffers the rest. Final saves the count big-endian, pads with 0x80 and zeros to 56 bytes modulo 64, adds the count, and writes the five state words big-endian.
The derivation is in the doc.
Callers 4
- ChecksumExecutables net
- HashPinWithSalts net
- Sha1Digest net
- Sha1DigestString net
Callees 1
- Sha1Update net
Calls and jumps by a bare address, from tables/calls.tsv.