Das deutsche QBasic- und FreeBASIC-Forum Foren-Übersicht Das deutsche QBasic- und FreeBASIC-Forum
Für euch erreichbar unter qb-forum.de, fb-forum.de und freebasic-forum.de!
 
FAQFAQ   SuchenSuchen   MitgliederlisteMitgliederliste   BenutzergruppenBenutzergruppen  RegistrierenRegistrieren
ProfilProfil   Einloggen, um private Nachrichten zu lesenEinloggen, um private Nachrichten zu lesen   LoginLogin
Zur Begleitseite des Forums / Chat / Impressum
Aktueller Forenpartner:

Meine Anticheating Engine - wie verbessern??

 
Neues Thema eröffnen   Neue Antwort erstellen    Das deutsche QBasic- und FreeBASIC-Forum Foren-Übersicht -> Allgemeine Fragen zu FreeBASIC.
Vorheriges Thema anzeigen :: Nächstes Thema anzeigen  
Autor Nachricht
Andt2018



Anmeldungsdatum: 22.12.2017
Beiträge: 7

BeitragVerfasst am: 04.12.2018, 07:38    Titel: Meine Anticheating Engine - wie verbessern?? Antworten mit Zitat

Hi! Hab mal ne simple Anticheating Engine geschrieben, mit Selbsttest und Cheaterkennung.Im falle eines Cheat/Hacks werden dann zuflällige Werte ausgegeben wenns ganz krass wird, dann wird das Programm einfach abstüzen.
Die Frage ist wie könnte man das hier noch verbessern?
Aktuell ist das ganze nur für Integers.
Features:
-Speichert werte Verschlüsselt und gehasht
-Mehrere Sensoren für Cheaterkennung
-Timer basiertes Andtidebugging
-Quellcode Sabotage erkennung
-Erkennung von typischen Cheats mit 3 fach kompensierung( gibt Warnung aus)
-Einfaches Obusfactoring
Ach ja ein Selbsttest durfte auch nicht fehlen.. lächeln
Happy Hacking.. *g*

Code:
type ash
    value as integer
    declare constructor
end type

constructor ash
    value = -2
end constructor
   

dim shared instruction as ubyte 'for checking the amount of instructions
type anticheat
    T as integer
    errorcompension as integer 'if have one group (value and key) have bad values
                               'so try next (up to errorcompension 2)
                               'if this fails so is the thread trapped in an loop now :)
    value(2) as integer
    key(2) as integer
    hash as integer
    dim as integer cheatdetection 'cheatid code
    anti_selftesthack as ash
    declare sub set (v as integer)
    declare function get as integer
    declare function rnd32 as integer
    declare constructor
end type

constructor anticheat
    cheatdetection = anti_selftesthack.value   
    dim as integer v1 = rnd32
    dim as integer v2 = rnd32
    if v1 = v2 then cheatdetection = 8
    dim as integer v = 123456
    if v = 0 then cheatdetection = 7
    color 15
    Print "Selftest results: ";
    Print "RANDOMIZER..";
   
    if rnd32 > 0 and (rnd32 <> rnd32) and (v1 <> v2-1) then
        color 10 :
        pRINT "PASSED";
        cheatdetection+=1
    else
        color 12
        print "FAILED";
        cheatdetection = 5
    end if
    color 15
    PRINT "..SABOTAGE DETECTION..";
   
    set v
    if get <> v then cheatdetection = 1
    set v + 1
    if get <> v + 1 then cheatdetection = 2
    set get - 2
    if get <> v - 1 then cheatdetection = 3
    set 0
    if get <> 0 then cheatdetection = 4
    cheatdetection+=1
    if cheatdetection = 0 then
        color 10
        print "PASSED"
       
    ELSE
       
        color 12
        PRINT "FAILED"
    end if
    color 7
end constructor

function anticheat.rnd32 as integer
  static x as integer
  x+=1
  return int(rnd * 2^31)
end function
   
   
sub anticheat.set (v as integer)
    if cheatdetection > 0 then exit sub
    instruction+=1
    dim as integer trys = 10
    do
        key(0) = rnd32
        key(1) = rnd32
        trys-=1
        if trys = 0 then exit do
    loop until key(0) > 0 and key(1) > 0
    do
        if errorcompension = 0 then
            value(0) = v xor key(0)
            if value(0) <> (v xor key(0)) then
                errorcompension = 1
                end if
            else
                value(1) = v xor key(1)
                errorcompension = 1
                if value(1) <> (v xor key(1)) then
                    errorcompension = 2
                key(2)= rnd32
                value(2) = v xor key(2)
            end if
        end if
    trys-=1
    if errorcompension > 0 then print "WARNING! TRYING TO CHEAT WAS DETECTED! - THIS WILL NOT BE TOLERATED!"
loop until value(errorcompension) = (v xor key(errorcompension)) or trys <= 0
    if errorcompension > ubound(value) then set v
    if (value(errorcompension) xor key(errorcompension)) <> v then errorcompension = 1 : set v
    hash = key(errorcompension) + value(errorcompension)
    if hash = 0 or key(errorcompension) = 0 then set v
    T =CINT(TIMER)
end sub

function anticheat.get as integer
    if cheatdetection > 0 then return rnd32
    static oi as integer
    oi = instruction
   instruction+=1
    if hash = 0 and key(errorcompension) = 0 then return rnd32: errorcompension = 1
    if hash = key(errorcompension) + value(errorcompension) then
        if value(errorcompension) = (value(errorcompension) xor key(errorcompension)) then
            return rnd32
        end if
        if cint(timer)-t > 1 then set rnd32 'anti debugging.. ;)
        set value(errorcompension) xor key(errorcompension)
        if instruction-oi <> 2 then cheatdetection = 6
        instruction = 0
        return value(errorcompension) xor key(errorcompension)
    else
        return rnd32
    end if
end function


'###example starts here###
locate ,,0
dim as anticheat score
score.set 10000
Print "CHEAT ME! INCRASE WITH + / DECRASE WITH -, ESC TO EXIT"

do
    locate 3
    print score.get
    select case inkey
    case "+"
        score.set score.get + 1
    case "-"
        score.set score.get - 1
    case chr(27)
        exit do
    end select
loop
[/code]
Nach oben
Benutzer-Profile anzeigen Private Nachricht senden
Beiträge der letzten Zeit anzeigen:   
Neues Thema eröffnen   Neue Antwort erstellen    Das deutsche QBasic- und FreeBASIC-Forum Foren-Übersicht -> Allgemeine Fragen zu FreeBASIC. Alle Zeiten sind GMT + 1 Stunde
Seite 1 von 1

 
Gehe zu:  
Du kannst keine Beiträge in dieses Forum schreiben.
Du kannst auf Beiträge in diesem Forum nicht antworten.
Du kannst deine Beiträge in diesem Forum nicht bearbeiten.
Du kannst deine Beiträge in diesem Forum nicht löschen.
Du kannst an Umfragen in diesem Forum nicht mitmachen.

 Impressum :: Datenschutz