LdrpGenericProcessRelocation

NTSTATUS __stdcall LdrpGenericProcessRelocation(UINT16 *RelocationPtr, UINT64 Va, INT64 Diff){
  unsigned int v3; 
  NTSTATUS v4; 
  unsigned __int16 v5; 
  unsigned int v6; 
  _QWORD *v7; 
  unsigned int v8; 
  unsigned int v9; 
  unsigned int v10; 
  unsigned int v11; 

  v3 = *RelocationPtr;
  v4 = 1;
  v5 = v3 & 0xFFF;
  v6 = v3 >> 12;
  v7 = (_QWORD *)(Va + v5);
  if( v6 )
  {
    v8 = v6 - 1;
    if( v8 )
    {
      v9 = v8 - 1;
      if( v9 )
      {
        v10 = v9 - 1;
        if( v10 )
        {
          v11 = v10 - 1;
          if( v11 )
          {
            if( v11 == 6 )
              *v7 += Diff;
            else
              return 0;
          }
          else
          {
            v4 = 2;
            if( (v5 & 2) == 0 )
              *(_WORD *)v7 = (RelocationPtr[1] + 0x8000 + (unsigned int)Diff + (*(unsigned __int16 *)v7 << 16)) >> 16;
          }
        }
        else
        {
          *(_DWORD *)v7 += Diff;
        }
      }
      else
      {
        *(_WORD *)v7 += Diff;
      }
    }
    else
    {
      *(_WORD *)v7 = ((unsigned int)Diff + (*(unsigned __int16 *)v7 << 16)) >> 16;
    }
  }
  return v4;
}

Referenced by:

LdrProcessRelocationBlockLongLong