Page 1 of 1

thefool's obfuscation routine :(

Posted: Wed Jan 23, 2013 3:38 am
by rsts
No longer works in PB5b5 x86 (enable inline asm)

Code: Select all

Macro osR(w,msk,shft)
  ((w & msk) >> shft)
EndMacro
Macro osL(w,msk,shft)
  ((w & msk) << shft)
EndMacro
Procedure ob_obsfucate_sillier(mem.l, sz.l, skip.l = #False)
    Protected i.l, wk.l
    Protected *ps.byte
   
    Goto oc
    ooa:
    wk = *ps\b & $FF
    ;return to ba
    Goto ba
    oc:
   
    myooa = ?ooa
    Goto ob
    begin:
   
    For i = 1 To sz
        PUSH myooa
        ;do some stuff?
        RET
        ba:
       
        Goto ooo3
        ;do the *ps+1
        orpa:
        *ps + 1
        Goto ooo4
        ooo3:
       
       
        ;do
        Goto a1
        r2:
        Goto a2
        r3:
        Goto a3
        a2:
        teos|(osR(wk, $08, 3) | osL(wk, $01, 3) | osR(wk, $04, 1))
        Goto r3:
        a1:
        teos = osR(wk, $C0, 2) | osL(wk, $30, 2)
        Goto r2
        a3:
        teos|(osL(wk, $02, 1))
       
        *ps\b = teos
       
        PUSH l_orpa  ;=======ERROR============
        RET
        ooo4:
       
       
    Next
   
    Goto oa
    ob:
    *ps = mem
    Goto begin
    oa:
   
EndProcedure

Code: Select all

---------------------------
PureBasic - Assembler error
---------------------------
PureBasic.asm [448]:

MP0

PureBasic.asm [229] MP0 [140]:

PUSH l_orpa

error: undefined symbol 'l_orpa'.


---------------------------
OK   
---------------------------
assistance please :)

Re: thefool's obfuscation routine :(

Posted: Wed Jan 23, 2013 3:47 am
by Shield
Change it to PUSH l_ob_obsfucate_sillier_orpa. :)

Re: thefool's obfuscation routine :(

Posted: Wed Jan 23, 2013 4:24 am
by rsts
Shield wrote:Change it to PUSH l_ob_obsfucate_sillier_orpa. :)
:D

cheers

Re: thefool's obfuscation routine :(

Posted: Thu Jul 25, 2013 1:35 am
by rsts
And with PB5.2b7 things have changed once again :(

PUSH myooa = syntax error.

every new release brings a new set of challenges :)

Re: thefool's obfuscation routine :(

Posted: Thu Jul 25, 2013 5:59 am
by Danilo
rsts wrote:And with PB5.2b7 things have changed once again :(

PUSH myooa = syntax error.

every new release brings a new set of challenges :)
Just put "EnableASM" in front of the code, or put EnableASM / DisableASM combination within the procedure.

Re: thefool's obfuscation routine :(

Posted: Thu Jul 25, 2013 2:58 pm
by rsts
Whoops :oops:
Thought compiler options took care of that.

Many thanks. :)

Re: thefool's obfuscation routine :(

Posted: Thu Jul 25, 2013 3:27 pm
by Fred
It did before the update, but it is now removed as it was redundant with the compiler directive.

Re: thefool's obfuscation routine :(

Posted: Sun Aug 24, 2014 3:55 pm
by Tenaja
For those wanting to use this with Unicode, you need to replace the Len() arguments in the obfuscation calls with StringByteLength(). Otherwise it only does the first half, since Unicode is 2-bytes per char.

Another alternative would be mod the code to work on a character level, rather than a byte level...but clearly, more work.