LdrpThumbProcessRelocation

UINT64 __stdcall LdrpThumbProcessRelocation(UINT16 *RelocationPtr, UINT64 Va, INT64 Diff){
  int v3; 
  _WORD *v4; 
  unsigned int v5; 
  unsigned __int16 v6; 
  unsigned int v7; 
  __int16 v8; 
  __int16 v9; 

  v3 = *RelocationPtr >> 12;
  v4 = (_WORD *)(Va + (*RelocationPtr & 0xFFE));
  v5 = 1;
  if( v3 == 5 )
  {
    return(unsigned int)LdrpArmProcessRelocation(RelocationPtr, Va, Diff);
  }
  else if( v3 == 7 )
  {
    v6 = v4[1];
    v7 = Diff
       + ((unsigned __int8)v6 | (v6 >> 4) & 0x700 | (unsigned __int16)(2 * ((*v4 << 11) | *v4 & 0x400)) | (((unsigned __int8)v4[3] | ((unsigned __int16)v4[3] >> 4) & 0x700 | (unsigned __int16)(2 * ((v4[2] << 11) | v4[2] & 0x400))) << 16));
    *v4 = *v4 & 0xFBF0 | ((unsigned __int16)(((unsigned __int16)v7 >> 11) | v7 & 0x800) >> 1);
    v8 = v7 & 0x700;
    v7 >>= 16;
    v4[1] = (unsigned __int8)(Diff + v6) | v6 & 0x8F00 | (16 * v8);
    v9 = v4[3];
    v4[2] = v4[2] & 0xFBF0 | ((unsigned __int16)(((unsigned __int16)v7 >> 11) | v7 & 0x800) >> 1);
    v4[3] = (unsigned __int8)v7 | v9 & 0x8F00 | (16 * (v7 & 0x700));
  }
  else
  {
    return 0;
  }
  return v5;
}

Referenced by:

LdrProcessRelocationBlockLongLong