From b2a225d50a3c932ae341c997c898042f00865186 Mon Sep 17 00:00:00 2001 From: Syping Date: Sun, 25 Oct 2020 04:54:54 +0100 Subject: [PATCH] initial commit --- CMakeLists.txt | 15 +++++++++++++++ src/plugin_gtajoaat.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 src/plugin_gtajoaat.c diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..ef8e73d --- /dev/null +++ b/CMakeLists.txt @@ -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) diff --git a/src/plugin_gtajoaat.c b/src/plugin_gtajoaat.c new file mode 100644 index 0000000..7ccd514 --- /dev/null +++ b/src/plugin_gtajoaat.c @@ -0,0 +1,33 @@ +#include +#include +#include + +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; +}