We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents a69ca5a + 19d4457 commit d66ae38Copy full SHA for d66ae38
algorithms/smt_api_hashing.py
@@ -0,0 +1,32 @@
1
+#!/usr/bin/env python
2
+import ctypes
3
+
4
+DESCRIPTION = """
5
6
+ Author = 0x0d4y
7
8
+ Description = This is the API Hashing algorithm, of ScoringMathTea RAT used by Lazarus.
9
10
+ Sample_I MD5: cc9cf047aec871cefb1c7d4b8d5d3432
11
12
+"""
13
+TYPE = 'unsigned_int'
14
+TEST_1 = 797271551
15
16
+def hash(data):
17
+ h = 0x2DBB955 # Seed value
18
+ for char_byte in data:
19
+ if char_byte >= 128:
20
+ signed_char_val = char_byte - 256
21
+ else:
22
+ signed_char_val = char_byte
23
24
+ signed_h = ctypes.c_int32(h).value
25
26
+ s = signed_h >> 2
27
+ m = signed_h * 32
28
+ right_side = (signed_char_val + s + m)
29
30
+ h = (h ^ right_side) & 0xFFFFFFFF
31
32
+ return h
0 commit comments