title: Possible strategies to increase the difficulty of effective bytehacking
body: <p>I've been asked to patch a few minor flaws in a game of the unreal series. It uses the unrealscript language which produces bytecode in a similar way to Java.</p>
  
  <p>One of the issues is that it's possible to edit any packages downloaded to a client and insert a <code>goto</code> instruction to jump over important bits of code.</p>
  
  <p>It isn't possible to prevent this so I'm wondering what sort of strategies could be applied to make the task more difficult. There's two approaches that come to mind:</p>
  
  <ol>
  <li><p>An automatic internal state checking mecanism for anything that is clientside. The
  way it be done would be to have a before and after check for each
  function call. One peculiarity of the language is the <a href="http://wiki.beyondunreal.com/Legacy:UnrealScript_Language_Reference/Functions#Function_Parameter_Specifiers" rel="nofollow noreferrer">out</a> keyword in functions.</p>
  
  <blockquote>
    <p>The "out" specified lets you tell a
    function that it should actually
    modify the variable that is passed to
    it, rather than making a local copy.
    This is useful, for example, if you
    have a function that needs to return
    several values to the caller. You can
    just have the caller pass several
    variables to the function which are
    "out" values.</p>
  </blockquote></li>
  <li><p>A serverside checking mecanism that takes action if something incoherent happens or
  there is a timeout. Obviously, code can't be bounced between the client and server every
  tick because of the overhead it would generate but it would be possible to have some
  information exchanged, say, every x seconds.</p>
  
  <p>Perhaps the two approaches could be combined. What is your opinion on this?</p></li>
  </ol>