Public feed #890554

Someone

public text v1 · immutable
Raw Edit
·published 2008-02-03 20:58 UTC
rendered paste body
unsigned __int32 __thiscall SSWindowCheck(int this, DWORD targetProcessId)
{
  unsigned __int32 result; // eax@1
  HWND v3; // edi@1
  int this_ptr; // esi@1
  HWND curHwnd; // eax@1
  DWORD dwProcessId; // [sp+8h] [bp-4h]@1

  this_ptr = this;
  curHwnd = GetForegroundWindow();                              // Get handle to foreground window
  v3 = curHwnd;
  GetWindowThreadProcessId(curHwnd, &dwProcessId);              // Get process id of foreground window
  result = dwProcessId;
  if ( dwProcessId == targetProcessId )                         // Foreground window is the game window
  {
    *(_DWORD *)(this_ptr + 1176) = 44;                          // pWindowPlacement->length = sizeof(WINDOWPLACEMENT)
    GetWindowPlacement(v3, (WINDOWPLACEMENT *)(this_ptr + 1176));
    result = *(_BYTE *)(this_ptr + 1184) & 1;                   // result = pWindowPlacement->showCmd & SW_MAXIMIZE
    *(_DWORD *)(this_ptr + 8) = *(_BYTE *)(this_ptr + 1184) & 1;// PBObject->resultOfWinCheck = pWindowPlacement->showCmd & SW_MAXIMIZE
  }
  else
  {
    *(_DWORD *)(this_ptr + 8) = 0;                              // PBObject->resultOfWinCheck = 0
  }
  return result;
}