feat: Semaine 10
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import sys
|
||||
|
||||
def solve():
|
||||
binary_path = './crackme_esdi'
|
||||
|
||||
# L'adresse virtuelle 0x402090 dans un binaire sans PIE (base 0x400000)
|
||||
# correspond à l'offset fichier 0x2090
|
||||
file_offset = 0x2090
|
||||
password_length = 14
|
||||
xor_key = 0x42
|
||||
|
||||
try:
|
||||
with open(binary_path, 'rb') as f:
|
||||
f.seek(file_offset)
|
||||
encrypted_bytes = f.read(password_length)
|
||||
|
||||
# Application du XOR inverse pour casser le chiffrement
|
||||
password = "".join(chr(b ^ xor_key) for b in encrypted_bytes)
|
||||
|
||||
print(f"[+] Crackme résolu : valeur = {password}")
|
||||
|
||||
except FileNotFoundError:
|
||||
print(f"[-] Erreur : Le fichier {binary_path} est introuvable.")
|
||||
except Exception as e:
|
||||
print(f"[-] Une erreur est survenue : {e}")
|
||||
|
||||
if __name__ == '__main__':
|
||||
solve()
|
||||
Reference in New Issue
Block a user