From cd1b331b6fe1c9075e2a1d9614131e9ed5bfc7da Mon Sep 17 00:00:00 2001 From: z3r0privacy Date: Tue, 13 Feb 2024 14:44:07 +0100 Subject: [PATCH] Add PikaBot variant of mul21_add --- algorithms/mul21_add_seed_8952.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 algorithms/mul21_add_seed_8952.py diff --git a/algorithms/mul21_add_seed_8952.py b/algorithms/mul21_add_seed_8952.py new file mode 100644 index 0000000..1030731 --- /dev/null +++ b/algorithms/mul21_add_seed_8952.py @@ -0,0 +1,16 @@ +#!/usr/bin/env python + +DESCRIPTION = "MULTIPLY 0x21 and ADD (seed 8952), used in PikaBot in February 2024" +# Type can be either 'unsigned_int' (32bit) or 'unsigned_long' (64bit) +TYPE = 'unsigned_int' +# Test must match the exact hash of the string 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789' +TEST_1 = 0xDD4DE543 + + +def hash(data): + h = 8952 + for c in data: + if c > 96: + c -= 0x20 + h = (c + 0x21*h) & 0xFFFFFFFF + return h