checkbrute_gtajoaat/src/plugin_gtajoaat.c

52 lines
1.4 KiB
C
Raw Normal View History

2020-10-25 16:57:16 +01:00
/*****************************************************************************
* checkbrute_gtajoaat Checkbrute GTAJOAAT plugin
* Copyright (C) 2020 Syping
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* This software is provided as-is, no warranties are given to you, we are not
* responsible for anything with use of the software, you are self responsible.
*****************************************************************************/
2020-10-25 04:54:54 +01:00
#include <stdint.h>
#include <stdio.h>
#include <ctype.h>
const char* checkbrute_format()
{
2020-10-25 04:56:51 +01:00
return "GTAJOAAT";
2020-10-25 04:54:54 +01:00
}
const char* checkbrute_version()
{
return "0.1";
}
2020-10-25 14:18:57 +01:00
uint32_t checkbrute_hash32(unsigned char* data, size_t size)
2020-10-25 04:54:54 +01:00
{
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;
2020-10-25 16:30:05 +01:00
return hash & 0xffffffffL;
2020-10-25 04:54:54 +01:00
}
int checkbrute_hashsz()
{
return 4;
}