title: IDA Pro - rewriting HIBYTE, LOBYTE and __OFSUB__ macros to C++
body: <p>I was able to hook one function and now I'm trying to rewrite it's code, but I have issues with
  translating some macros generated by IDA Pro's pseudocode</p>
  <pre><code> LOBYTE(v8) = v8 &amp; 3;  
   LOBYTE(v12) = 0;
   HIBYTE(v12) = *result;
   v21 = __OFSUB__(v24 + 1, 30); 
  </code></pre>
  <p>LOBYTE and HIBYTE are detected by Visual Studio but when I copy-paste them I get this error</p>
  <blockquote>
  <p>Error (active)    E0137   expression must be a modifiable lvalue</p>
  </blockquote>
  <p>I tried to rewrite it to something like this</p>
  <blockquote>
  <p>LOBYTE(v8); v8 = v8 &amp; 3;</p>
  </blockquote>
  <p>and then the error dissappears, but it doesn't seem to work fine.
  As for offsub, it is not detected at all as a valid macro.</p>
  <p>Do you have any ideas what should I do?</p>