The MASM Forum

Specialised Projects => PowerBASIC => Topic started by: hutch-- on May 17, 2016, 11:16:09 AM

Title: PB version of the MASM example to shuffle an array.
Post by: hutch-- on May 17, 2016, 11:16:09 AM
This is a PowerBASIC version of a MASM32 example that shuffles an array of lines of text. It has numerous uses, arranging text data for a balanced tree, general randomising of words and in a particular use, to shuffle lines of text in an include file to alter the binary image of an executable file each time it is built. The MASM32 original is in "examples\example07\shuflarr\"
Title: Re: PB version of the MASM example to shuffle an array.
Post by: jj2007 on May 17, 2016, 11:36:33 AM
Quote from: hutch-- on May 17, 2016, 11:16:09 AMto alter the binary image of an executable file each time it is built

Wait until the moderator bans you (http://masm32.com/board/index.php?topic=4.0) :eusa_naughty:
Title: Re: PB version of the MASM example to shuffle an array.
Post by: hutch-- on May 20, 2016, 02:15:13 PM
 :biggrin:

Nah, you miss it, at compile time the internal order is dictated by the order of the source code so if you shuffle the order of the source code, you shuffle the internal binary image which makes it a real pain to make a static patch for. The point of the tool is so that every time you build the executable, the internal binary image is different so that a static patch for one build will not work on another build.
Title: Re: PB version of the MASM example to shuffle an array.
Post by: jj2007 on May 20, 2016, 04:06:57 PM
 :biggrin: :t
Title: Re: PB version of the MASM example to shuffle an array.
Post by: HSE on May 21, 2016, 02:11:41 AM
I just see that MASM32 example yesterday, searching for randomization. Very nice idea.  :t
Title: Re: PB version of the MASM example to shuffle an array.
Post by: jiucenglou on July 16, 2017, 12:08:42 AM
So the usage is for software protection ?  :t