Sign in to follow this  
Followers 0
Glyph

Obfuscator random function

4 posts in this topic

Func randochar()
    $wee = Random(1, 2, 1)
    Return Execute("_" & $wee & "()")
EndFunc   ;==>randochar

Func _1()
    ;number 0-9
    $ran = Chr(Random(48, 57, 1))
    Return $ran
EndFunc   ;==>_1

Func _2()
    ;letter a-f
    $ran = Chr(Random(65, 70, 1))
    Return $ran
EndFunc   ;==>_2

This works perfectly fine, but i tried to use obfuscator, and because it's an execute function it won't work being obfuscated....

Anyone have any workarounds??

this code was made by me thinkign the obfuscator might work with execute function...


tolle indicium

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Func randochar()
    Switch Random(1, 2, 1)
        Case 1
            return _1();
        Case 2
            return _2();
    EndSwitch
EndFunc ;==>randochar

Func _1()
  ;number 0-9
    $ran = Chr(Random(48, 57, 1))
    Return $ran
EndFunc ;==>_1

Func _2()
  ;letter a-f
    $ran = Chr(Random(65, 70, 1))
    Return $ran
EndFunc ;==>_2

Edited by KentonBomb

Share this post


Link to post
Share on other sites

didn't even think to use a switch!

very clever, thank you!


tolle indicium

Share this post


Link to post
Share on other sites

didn't even think to use a switch!

very clever, thank you!

Or you can go ninja like this:

Func randochar()
    Switch Random(1, 2, 1)
        Case 1
            $ran = Chr(Random(48, 57, 1))
            Return $ran
        Case 2
            $ran = Chr(Random(65, 70, 1))
            Return $ran
    EndSwitch
EndFunc   ;==>randochar

;)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0