Author Topic: AntiFake based on HWID  (Read 10114 times)

0 Members and 1 Guest are viewing this topic.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
AntiFake based on HWID
« on: April 25, 2011, 03:47:25 am »
Name: AntiFakeHWID

Author: Mighty
Script version: 1.0.2
Server version: 2.6.5
Release Date: 25.04.2011
Compile Test: Passed
Description:
Script stores all nicknames that has been used by specific GUID generated by MSAC.
It sorts data in files daily at 4 am (or later if the server is not empty)

Commands:
 * /whoiz X - shows who X is (X = ID or nickname part)
 * /whoizall - shows everyone's "personalities"
 * /readwhoiz X - shows detailed information about player
 * /mark ID As_Who - use this when you know who the person is, but the script is wrong (admins only ofc)

Requirements:
 * Make sure you've created a folder ../scripts/AntiFakeHWID/hwid/. You can also modify PATH const at the beginning of .pas file for the different path.

Uses:
 * Explode function by DorkeyDear, CurryWurst

---

---
Code: {snippets}
Code: [Select]
Procedure RecognisePlayer(ID: byte);
var
i: integer;
infile: array of string;
data: array of tData;
guid: string;
begin
guid := GetPlayerStat(ID,'MSAC.GUID');
While ContainsString(guid,':') do
begin Delete(guid,StrPos(':',guid),1); end;

if FileExists(PATH+guid+EXT) then
begin
infile := Explode(ReadFile(PATH+guid+EXT),chr(13)+chr(10));
for i:=0 to ArrayHigh(infile)-1 do
begin
SetArrayLength(data,i+1);
data[i] := LoadLine(infile[i]);
if i=19 then break;
end;
for i:=0 to GetArrayLength(data)-1 do
begin
Player[ID].Names[i+1] := data[i].Name;
Player[ID].NamesC[i+1] := data[i].Count;
if i=19 then break;
end;
Player[ID].RealName := Player[ID].Names[1];
end
else
Player[ID].RealName := 'unknown';
end;

Questions? Bugs? Report please --> macekmil@gmail.com
« Last Edit: September 09, 2011, 01:05:54 pm by Mighty »
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Beowulf Agate

  • Major
  • *
  • Posts: 73
Re: AntiFake based on GUID
« Reply #1 on: April 25, 2011, 04:31:47 am »
Great job Mighty :)

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: AntiFake based on GUID
« Reply #2 on: April 25, 2011, 05:53:08 am »
Interesting script, thank you, however what is the following line for (not what it does, why it does exactly that):

Delete(guid,8,1);

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: AntiFake based on GUID
« Reply #3 on: April 25, 2011, 07:41:01 am »
the GUID MSAC generates is XXXXXXXX:XXXXXXXX
Names of files i create here are guids, but since name of a file cant include colon, i had to delete it.
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Mr

  • Inactive Soldat Developer
  • Soldier
  • ******
  • Posts: 166
Re: AntiFake based on GUID
« Reply #4 on: April 25, 2011, 09:57:59 am »
The size of GUIDs generated by MSAC can vary depending on the amount of data used to create it. Therefore, there can be more than just one colon in the string returned by GetPlayerStat.
If there is more than one, your script will probably not work correctly, if there is none at all (also possible) your script will crash as you access data that does not exist. Also it is not said that each part of the GUID is 8 chars long. It can basically have any size from 2 to 8 chars.

Please also make sure to only get the GUID after MSAC received it (MSAC_OnConnect signals this), else GetPlyerStat will return an empty string.

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: AntiFake based on GUID
« Reply #5 on: April 25, 2011, 10:14:25 am »
ugh... to help improving it a lil' bit i paste here quicksort implementation
Code: (pascal) [Select]
//t: array to be sorted, l: start point of sorting (most likely 0), r: end point of sorting (most likely GetArrayLength(t)-1), asc: true if ascending, false if descending
procedure quicksort(var t: array of integer; l,r:integer; asc: boolean);
var
   pivot,b,i,j:integer;
begin
if l < r then
begin
pivot := t[random(l+1, r+1)];
//pivot:=t[(l+r) div 2 + 1];
i := l-1;
j := r+1;
repeat
if asc then begin
repeat i := i+1 until pivot <= t[i];
repeat j := j-1 until pivot >= t[j];
end else begin
repeat i := i+1 until pivot >= t[i];
repeat j := j-1 until pivot <= t[j];
end
b:=t[i]; t[i]:=t[j]; t[j]:=b
until i >= j;
t[j]:=t[i]; t[i]:=b;
quicksort(t,l,i-1, asc);
quicksort(t,i,r, asc);
end;
end;

sorted array is returned via reference
« Last Edit: April 25, 2011, 10:16:08 am by FalconPL »
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: AntiFake based on GUID
« Reply #6 on: April 26, 2011, 07:15:45 am »
For those who've downloaded the very first version of script, please delete all data stored in ../AntiFakeGUID/guid/ . For those who've downloaded the script today:

Ok, i know it's pretty much sad, but I failed again, omitting one bugfix which was essential, noticed it online, which was too late already. And once again the .pas file must be updated.
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline PKS|Shooter

  • Soldier
  • **
  • Posts: 130
  • Dont fuck with us!
    • PKS - La Familia
Re: AntiFake based on GUID
« Reply #7 on: April 29, 2011, 10:03:35 am »
very nice script thanks! works greatly

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: AntiFake based on HWID
« Reply #8 on: September 09, 2011, 01:06:15 pm »
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Beowulf Agate

  • Major
  • *
  • Posts: 73
Re: AntiFake based on HWID
« Reply #9 on: March 20, 2012, 11:03:03 am »
C'mon repair those memory leaks in 2.7.2 version. The script is awesome.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: AntiFake based on HWID
« Reply #10 on: March 20, 2012, 11:11:29 am »
I'm short on free time lately, I definitely will do that ASAP...
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: AntiFake based on HWID
« Reply #11 on: June 06, 2012, 01:32:57 pm »
I'd like to see total time spent on server when I use readwhoiz on a specific player.

Im chill like that

Offline Bonecrusher

  • Global Moderator
  • Veteran
  • *****
  • Posts: 1397
  • High above
    • Zabijaka.pl
Re: AntiFake based on HWID
« Reply #12 on: July 12, 2012, 12:21:42 pm »
Also /whoiz hwid would be nice

Im chill like that

Offline Falcon`

  • Flagrunner
  • ****
  • Posts: 792
  • A wanted lagger
Re: AntiFake based on HWID
« Reply #13 on: August 30, 2012, 03:10:31 pm »
this script crashes if ran on more than one server and they both launch in more or less perfect sync. Crashes on both with Access Denied exception when attempting to sort files.
If you're not paying for something, you're not the customer; you're the product being sold.
- Andrew Lewis

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

Offline Mighty

  • Camper
  • ***
  • Posts: 276
Re: AntiFake based on HWID
« Reply #14 on: August 31, 2012, 08:33:10 am »
That is more helpful than you may think! Thanks!
xFire: macmil        e-mail: macekmil@gmail.com
My scripts: Accuracy Script       Flashbang       Punishments GUID
            CatchMe Gamemod       AntiFake
            CW System             AntiFakeGUID

Offline KoGAi

  • Major(1)
  • Posts: 32
  • The Light of the Universe
Re: AntiFake based on HWID
« Reply #15 on: August 02, 2016, 11:26:07 pm »
It looks like after the latest release, this only works when checking against PIDs but not the actual player's name. :(
=₳US7RAL|¹² is a growing Soldat Community making a difference by offering a wide variety of top-notch servers across North America- a new alternative to everyone.
Jump into our servers in NA with the new domain (austral12.com)! Check our Facebook Page.
_______
#austral12soldat @ QuakeNet ▲ facebook.com/AUS7RAL12 ▲ twitter.com/AUS7RAL12