initial commit

This commit is contained in:
Syping 2020-10-25 04:54:54 +01:00
commit b2a225d50a
2 changed files with 48 additions and 0 deletions

15
CMakeLists.txt Normal file
View File

@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.5)
project(gtajoaat LANGUAGES C)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(GTAJOAAT_SOURCES
src/plugin_gtajoaat.c
)
add_library(gtajoaat SHARED
${GTAJOAAT_SOURCES}
)
install(TARGETS gtajoaat DESTINATION share/checkbrute/plugins)

33
src/plugin_gtajoaat.c Normal file
View File

@ -0,0 +1,33 @@
#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
const char* checkbrute_format()
{
return "GTA5";
}
const char* checkbrute_version()
{
return "0.1";
}
uint64_t checkbrute_hash64(unsigned char* data, size_t size)
{
size_t i = 0;
uint32_t hash = 0;
while (i != size) {
hash += tolower(data[i++]);
hash += hash << 10;
hash ^= hash >> 6;
}
hash += hash << 3;
hash ^= hash >> 11;
hash += hash << 15;
return hash;
}
int checkbrute_hashsz()
{
return 4;
}