-
Notifications
You must be signed in to change notification settings - Fork 27
/
HashCalculator.cpp
67 lines (52 loc) · 1.78 KB
/
HashCalculator.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#include <stdio.h>
#include <stdlib.h>
/*
_ __ _____
/\ /\__ _ ___| | __/ _\_ _ ___ /__ \___ __ _ _ __ ___
/ /_/ / _` |/ __| |/ /\ \| | | / __| / /\/ _ \/ _` | '_ ` _ \
/ __ / (_| | (__| < _\ \ |_| \__ \ / / | __/ (_| | | | | | |
\/ /_/ \__,_|\___|_|\_\\__/\__, |___/ \/ \___|\__,_|_| |_| |_|
|___/
http://hacksys.vfreaks.com/
hacksysteam@hotmail.com
Thanks to:
Ruei-Min Jiang (@mike820324) a.k.a MicroMike
respect to you bro.
Module Name:
Hash Calculator
Abstract:
This function calculates the Function hash according
to its name.
IDE:
Dev-C++ 4.9.9.2 (Windows XP SP3)
Compiler:
gcc 3.4.2
*/
unsigned int hash_function(const char* string){
unsigned int value = 0;
__asm__("xor %%ebx, %%ebx;\n\t\
loop:\n\t\
xor %%eax, %%eax;\n\t\
lodsb;\n\t\
rol $5, %%ebx;\n\t\
addl %%eax, %%ebx;\n\t\
cmp $0, %%eax;\n\t\
jnz loop;\n\t\
ror $5, %%ebx;\n\t\
movl %%ebx, %0;\n\t"
:"=m" (value)
:"S" (string)
:
);
printf("%s: 0x%x\n",string,value);
}
int main(){
hash_function("LoadLibraryA");
hash_function("CloseHandle");
hash_function("CreateFileA");
hash_function("ExitProcess");
hash_function("FormatEx");
hash_function("DeviceIoControl");
hash_function("Sleep");
system("pause");
}