The uncheatable Value

User projects written in or related to FreeBASIC.
mrminecrafttnt
Posts: 76
Joined: Feb 11, 2013 12:23

The uncheatable Value

Postby mrminecrafttnt » Oct 28, 2018 15:01

Simply try to use Cheatengine to change this value.. good look! :D

Code: Select all

type encoded_ubyte
    dim as ulongint ptr value
    dim as ulongint ptr key
    declare sub set (value as ubyte)
    declare function get as ubyte
    declare constructor
    declare destructor
end type

constructor encoded_ubyte
    key = new ulongint[1]
    value = new ulongint[1]
    *key = int(rnd*99999999999)
    *value = 0
end constructor
   
destructor encoded_ubyte
    delete (key)
    delete (value)
end destructor
   
sub encoded_ubyte.set (value as ubyte)
    *this.value = value xor *this.key
end sub

function encoded_ubyte.get as ubyte
    return *this.value xor *this.key
end function

type crypted_ubyte
    crypted_data as encoded_ubyte
    encryption_key as encoded_ubyte
    declare sub set (v as ubyte)
    declare function get as ubyte
end type

type crypted_integer
    value(any) as crypted_ubyte
    hash as crypted_ubyte
    declare sub set (value as integer)
    declare function get as integer
end type

sub crypted_ubyte.set (value as ubyte)
    encryption_key.set int(rnd*256)
    crypted_data.set value xor encryption_key.get
end sub

function crypted_ubyte.get as ubyte
   
    return crypted_data.get xor encryption_key.get
end function

sub crypted_integer.set (v as integer)
    hash.set v mod 255
    redim this.value(len(str(v)))
    dim as string s = str(v)
    for i as integer = lbound(value) to ubound(value)
        value(i).set s[i]
    next
end sub

function crypted_integer.get as integer
   
    dim as string s
    for i as integer = lbound(value) to ubound(value)
        s+=chr(value(i).get)
    next
    if hash.get = val(s) mod 255 then return val(s) else return 0
end function

type ac_integer_precoder
    value as crypted_integer ptr
    key as crypted_integer ptr
    declare sub set (value as integer)
    declare function get as integer
    declare constructor
    declare destructor
end type

constructor ac_integer_precoder
    value = new crypted_integer[1]
    key = new crypted_integer[1]
end constructor

destructor ac_integer_precoder
    delete(value)
    delete(key)
end destructor

sub ac_integer_precoder.set (i  as integer)
    *key.set int(rnd*99999999)
    *value.set i xor *key.get
end sub

function ac_integer_precoder.get as integer
    return *value.get xor *key.get
end function



type ac_integer_data
    integer_data as ac_integer_precoder ptr
    checksum as double
    declare constructor
    declare destructor
    declare sub set (value as integer)
    declare function get as integer
end type

constructor ac_integer_data
    integer_data = new ac_integer_precoder[1]
    *integer_data.set 0
end constructor

destructor  ac_integer_data
    delete(integer_data)
end destructor

sub ac_integer_data.set (value as integer)
    checksum = sqr(value)/2
    *integer_data.set value
end sub

function ac_integer_data.get as integer
    dim as double calcsum = sqr(*integer_data.get)/2
    if calcsum = checksum then
        return *integer_data.get
    end if
end function

type ac_integer_crypt_n_hash
    dim as ac_integer_data v
    dim as ac_integer_data k
    dim as ac_integer_data h
    declare sub set (value as integer)
    declare function get as integer
end type

sub ac_integer_crypt_n_hash.set (value as integer)
    k.set int(rnd*99999999)
    v.set value xor k.get
    h.set k.get + v.get
    dim as ac_integer_data check
    check.set v.get xor k.get
    if check.get <> value then v.set 0 : k.set int(rnd*99999999)
    check.set 0
end sub

function ac_integer_crypt_n_hash.get as integer
    if h.get = k.get + v.get then
        return v.get xor k.get
    else
        return 0
    end if
end function

type ac_integer
    value(3) as ac_integer_crypt_n_hash ptr
    declare sub set (v as integer)
    declare function get as integer
    declare constructor
    declare destructor
end type

constructor ac_integer
     for i as integer = lbound(value) to ubound (value)
         value(i) = new ac_integer_crypt_n_hash[1]
         *value(i).set 0
     next
     
end constructor

destructor ac_integer
    for i as integer = lbound(value) to ubound(value)
        value(i) = new ac_integer_crypt_n_hash[1]
        *value(i).set 0
    next
end destructor

sub ac_integer.set (v as integer)
    for i as integer = lbound(value) to ubound(value)
        *value(I).set v
        if *value(I).get <> v then value(i) = 0
    next
   
end sub

function ac_integer.get as integer
   
    for i as integer = lbound(value) to ubound(value)
        for i2 as integer = lbound(value) to ubound(value)-1
            if i <> i2 then
                if *value(i).get<>*value(i2).get then
                    *value(i).set *value(i2+1 mod ubound(value)).get
                end if
                if *value(i2+1 mod ubound(value)).get <> *value(i).get then
                    *value(i2+1 mod ubound(value)).set *value(i).get
                end if
            end if
        next
    next
    if *value(lbound(value)).get = *value(ubound(value)).get then return *value(lbound(value)).get else return 0
end function


locate ,,0
dim as ac_integer test
test.set 123456

do
    sleep 1
    locate 1
    PRINT "CHANGE ME! ->"; test.get; " <-"
loop until inkey <> ""

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 2 guests