
05-11-2026, 05:49
|
|
Friend
|
|
Join Date: Sep 2022
Posts: 17
Rept. Given: 0
Rept. Rcvd 13 Times in 7 Posts
Thanks Given: 8
Thanks Rcvd at 74 Times in 14 Posts
|
|
|
Fixed
Quote:
Originally Posted by Storm Shadow
Maybe it is just me , but looks like it only calculate v1 to v6 so no matter what input you get same results ?
|
Fixed one:
Quote:
# By: terco _ AT4RE
# provides conversion between Python values and C-style binary data
import struct
# read user input and convert it to bytes
s = input("Enter a string: ").encode()
# create a 256-byte buffer filled with 'e' (0x65)
buf = bytearray(b'e' * 256)
# copy the input string into the buffer
buf[:len(s)] = s
# add null terminator
buf[len(s)] = 0
# read first 16 bytes as 4 little-endian 32-bit integers (DWORDs)
d0, d1, d2, d3 = struct.unpack("<4I", buf[:16])
# apply XOR
r1 = (d0 ^ 0x3617E418) ^ (d1 ^ 0xA935FC2E)
r2 = (d2 ^ 0x57D872B9) ^ (d3 ^ 0x493DB437)
# print Serial
print(f"{r1:08X}{r2:08X}")
|
|