Function at 0x507cd0
Capabilities:
Check os version

Disassembly:
sub esp, 0x424
mov eax, dword [0x6aae14]
xor eax, esp
mov dword [esp + 0x420], eax
test byte [0x74bd5c], 1
push ebx
push ebp
push esi
push edi
mov ebp, 1
jne 0x507d29
or dword [0x74bd5c], ebp
cmp dword [0x74aff0], 0
jne 0x507d1f
mov dword [0x74aff0], ebp
call dword [sym.imp.KERNEL32.dll_GetVersion]
test eax, eax
js 0x507d1f
cmp al, 6
jb 0x507d1f
mov dword [0x74afec], ebp
mov eax, dword [0x74afec]
mov dword [0x74bd58], eax
mov eax, 2
test byte [0x74bd5c], al
jne 0x507d46
or dword [0x74bd5c], eax
call fcn.004d9b40
mov dword [0x74bd54], eax
mov eax, 4
test byte [0x74bd5c], al
jne 0x507d63
or dword [0x74bd5c], eax
call fcn.004d9bd0
mov dword [0x74bd50], eax
mov eax, 8
test byte [0x74bd5c], al
jne 0x507d80
or dword [0x74bd5c], eax
call fcn.004d9870
mov dword [0x74bd4c], eax
mov edi, dword [sym.imp.KERNEL32.dll_OpenEventA]
xor ebx, ebx
xor esi, esi
mov dword [esp + 0x10], esi
cmp dword [0x74bd58], ebx
jne 0x507db6
push str.GlobalShellReadyEvent
push ebx
push 0x1f0003
call edi
mov esi, eax
mov dword [esp + 0x10], esi
cmp esi, ebx
je 0x507db6
cmp esi, 0xffffffff
jne 0x5080da
push ebx
call fcn.00503120
test eax, eax
je 0x50804e
cmp dword [0x74bd50], ebx
jne 0x507dd8
cmp dword [0x74bd4c], ebx
je 0x50804e
push 0x103
lea ecx, [esp + 0x331]
push ebx
push ecx
mov byte [esp + 0x338], bl
call fcn.005dfd60
push 0x103
lea edx, [esp + 0x239]
push ebx
push edx
call fcn.005dfd60
add esp, 0x18
mov byte [esp + 0x228], bl
cmp dword [0x74bd48], ebx
jne 0x507ea3
push 0x613110
call fcn.004f4be0
mov dword [0x74bd48], eax
cmp eax, ebx
je 0x507e6d
cmp eax, 0xffffffff
je 0x507e6d
mov edi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x6130f4
push eax
call edi
mov dword [0x74bd44], eax
mov eax, dword [0x74bd48]
push 0x6130e4
push eax
call edi
mov ecx, dword [0x74bd48]
push 0x6130cc
push ecx
mov dword [0x74bd40], eax
call edi
mov dword [0x74bd3c], eax
jmp 0x507ea8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [esp + 0x330]
push 0x104
push edx
call fcn.004d8b50
push eax
lea eax, [esp + 0x238]
push str.Unable_to_load_Wtsapi32.dll__Reason:__s
push eax
call fcn.005dfb23
add esp, 0x18
xor eax, eax
jmp 0x508112
mov eax, dword [0x74bd3c]
cmp dword [0x74bd44], ebx
je 0x508032
cmp dword [0x74bd40], ebx
je 0x508032
cmp eax, ebx
je 0x508032
lea ecx, [esp + 0x18]
push ecx
lea edx, [esp + 0x18]
push edx
push ebp
push ebx
push ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
call eax
test eax, eax
jne 0x507f12
lea eax, [esp + 0x32c]
push 0x104
push eax
call fcn.004d8c20
push eax
lea ecx, [esp + 0x234]
push str.Unable_to_Enumerate_Sessions__Reason:__s
push ecx
call fcn.005dfb23
add esp, 0x14
xor eax, eax
jmp 0x508112
mov ebp, dword [esp + 0x18]
cmp ebp, ebx
jne 0x507f30
mov eax, dword [esp + 0x14]
cmp eax, ebx
je 0x507f29
push eax
call dword [0x74bd40]
xor eax, eax
jmp 0x508112
mov dword [esp + 0x1c], ebx
cmp ebp, ebx
jbe 0x508018
lea esp, [esp]
mov edx, dword [esp + 0x14]
push 0x103
lea eax, [esp + 0x25]
push 0
push eax
lea edi, [ebx + edx]
mov byte [esp + 0x2c], 0
call fcn.005dfd60
push 0x103
lea ecx, [esp + 0x135]
push 0
push ecx
mov byte [esp + 0x13c], 0
call fcn.005dfd60
add esp, 0x18
test edi, edi
je 0x508004
mov edx, dword [edi]
push edx
lea eax, [esp + 0x24]
push str.Session_dShellReadyEvent
push eax
call fcn.005dfb23
mov ecx, dword [edi]
push ecx
lea edx, [esp + 0x134]
push str.Session_dShellDesktopSwitchEvent
push edx
call fcn.005dfb23
mov edi, dword [sym.imp.KERNEL32.dll_OpenEventA]
add esp, 0x18
lea eax, [esp + 0x20]
push eax
push 0
push 0x1f0003
call edi
mov esi, eax
push esi
mov dword [esp + 0x14], esi
call fcn.004d90d0
add esp, 4
test eax, eax
jne 0x508018
cmp dword [0x74bd58], eax
je 0x508000
lea ecx, [esp + 0x124]
push ecx
push eax
push 0x1f0003
call edi
mov esi, eax
push esi
mov dword [esp + 0x14], esi
call fcn.004d90d0
add esp, 4
test eax, eax
jne 0x508018
mov ebp, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
inc eax
add ebx, 0xc
mov dword [esp + 0x1c], eax
cmp eax, ebp
jb 0x507f40
mov eax, dword [esp + 0x14]
xor ebx, ebx
cmp eax, ebx
je 0x5080da
push eax
call dword [0x74bd40]
jmp 0x5080da
lea edx, [esp + 0x228]
push str.Unable_to_get_ProcAddress_
push edx
call fcn.005dfb23
add esp, 8
xor eax, eax
jmp 0x508112
push 0x103
lea eax, [esp + 0x129]
push ebx
push eax
mov byte [esp + 0x130], bl
call fcn.005dfd60
push 0x103
lea ecx, [esp + 0x31]
push ebx
push ecx
mov byte [esp + 0x38], bl
call fcn.005dfd60
lea edx, [esp + 0x13c]
push str.ShellReadyEvent
push edx
call fcn.005dfb23
lea eax, [esp + 0x40]
push str.ShellDesktopSwitchEvent
push eax
call fcn.005dfb23
add esp, 0x28
lea ecx, [esp + 0x124]
push ecx
push ebx
push 0x1f0003
call edi
mov esi, eax
mov dword [esp + 0x10], esi
cmp esi, ebx
je 0x5080bf
cmp esi, 0xffffffff
jne 0x5080da
cmp dword [0x74bd58], ebx
je 0x5080da
lea edx, [esp + 0x20]
push edx
push ebx
push 0x1f0003
call edi
mov esi, eax
mov dword [esp + 0x10], esi
cmp esi, ebx
je 0x507e9c
cmp esi, 0xffffffff
je 0x507e9c
cmp dword [0x74bd54], ebx
je 0x5080f7
xor esi, esi
jmp 0x508101
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, eax
lea eax, [esp + 0x10]
push eax
call fcn.004dca10
xor eax, eax
cmp esi, ebx
sete al
mov ecx, dword [esp + 0x430]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.005dfbbe
add esp, 0x424
ret