From 6f5adb9ab4ffba301ceaee35fb323811e0f70408 Mon Sep 17 00:00:00 2001 From: l3fdb33f Date: Thu, 12 Oct 2023 14:37:37 -0400 Subject: [PATCH] Adding algorithm seen in CS Loader --- algorithms/mult3_add_init_9C.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 algorithms/mult3_add_init_9C.py diff --git a/algorithms/mult3_add_init_9C.py b/algorithms/mult3_add_init_9C.py new file mode 100644 index 0000000..0d5285e --- /dev/null +++ b/algorithms/mult3_add_init_9C.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +DESCRIPTION = "MULTIPLY 3 and ADD, starting key 0x9C" +TYPE = 'unsigned_int' +TEST_1 = 3481051867 + + +def hash(data): + key = 0x9C + for byte in data: + dword = byte & 0xffffffff + key = (key * 3) & 0xffffffff + key = (key + dword) & 0xffffffff + return key