Author Topic: PB version of the MASM example to shuffle an array.  (Read 7115 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
PB version of the MASM example to shuffle an array.
« 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\"
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 13950
  • Assembly is fun ;-)
    • MasmBasic
Re: PB version of the MASM example to shuffle an array.
« Reply #1 on: May 17, 2016, 11:36:33 AM »
to alter the binary image of an executable file each time it is built

Wait until the moderator bans you :eusa_naughty:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 10583
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: PB version of the MASM example to shuffle an array.
« Reply #2 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 13950
  • Assembly is fun ;-)
    • MasmBasic
Re: PB version of the MASM example to shuffle an array.
« Reply #3 on: May 20, 2016, 04:06:57 PM »
 :biggrin: :t

HSE

  • Member
  • *****
  • Posts: 2499
  • AMD 7-32 / i3 10-64
Re: PB version of the MASM example to shuffle an array.
« Reply #4 on: May 21, 2016, 02:11:41 AM »
I just see that MASM32 example yesterday, searching for randomization. Very nice idea.  :t
Equations in Assembly: SmplMath

jiucenglou

  • Regular Member
  • *
  • Posts: 10
Re: PB version of the MASM example to shuffle an array.
« Reply #5 on: July 16, 2017, 12:08:42 AM »
So the usage is for software protection ?  :t