Function at 0x40bc80
Capabilities:
Create process on windows

Disassembly:
sub esp, 0x54
push ebx
push ebp
push esi
push edi
xor ebp, ebp
push 0x44
mov esi, eax
lea eax, [esp + 0x20]
push ebp
xor edi, edi
push eax
mov dword [esp + 0x20], edi
mov dword [esp + 0x24], ebp
call fcn.004858b0
xor eax, eax
mov ecx, 5
add esp, 0xc
mov dword [0x4d9b14], eax
mov dword [0x4d9b18], eax
mov dword [0x4d9b1c], eax
mov dword [0x4d9b20], eax
mov word [esp + 0x4c], cx
mov dword [esp + 0x24], str.Winsta0Winlogon
mov dword [esp + 0x1c], 0x44
call fcn.0040b900
call fcn.0040b6c0
mov eax, dword [0x4f37c0]
cmp eax, ebp
je 0x40bcea
call eax
lea eax, [esp + 0x10]
call fcn.0040bbc0
test eax, eax
je 0x40bf95
mov edx, dword [esp + 0x10]
push ebp
push edx
lea eax, [esp + 0x20]
push eax
call dword [sym.imp.USERENV.dll_CreateEnvironmentBlock]
push ebp
test eax, eax
je 0x40be52
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
push 0x4d9b14
lea ecx, [esp + 0x20]
push ecx
push ebp
push edx
push 0x408
push ebp
push ebp
push ebp
push 0x4d9a10
push ebp
push eax
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserA]
test eax, eax
je 0x40bd61
mov dword [0x4f3744], ebp
mov dword [esp + 0x14], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40be28
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe9
jne 0x40be28
mov edi, 1
cmp dword [0x4f3748], edi
jne 0x40be07
mov eax, dword [0x4f3744]
add eax, edi
cmp eax, 3
mov dword [0x4f3744], eax
jle 0x40be28
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push str.winsta.dll
call edi
push str.user32.dll
mov esi, eax
call edi
xor edi, edi
mov ebx, eax
test esi, esi
je 0x40bdc4
push str.WinStationConnectW
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test ebx, ebx
je 0x40bdd6
push str.LockWorkStation
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebp, eax
test edi, edi
je 0x40bdf8
mov ecx, dword [0x4f37c0]
xor eax, eax
test ecx, ecx
je 0x40bde8
call ecx
push 0
push 0x4a9b10
push eax
push 0
push 0
call edi
call ebp
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
xor ebp, ebp
jmp 0x40be28
mov ecx, dword [esp + 0x10]
push 0x408
push ecx
mov ecx, dword [esp + 0x20]
push esi
call fcn.0040b220
add esp, 0xc
mov dword [0x4f3744], ebp
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x18]
cmp eax, ebp
je 0x40bf7e
push eax
call dword [sym.imp.USERENV.dll_DestroyEnvironmentBlock]
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [esp + 0x10]
push 0x4d9b14
lea edx, [esp + 0x20]
push edx
push ebp
push ebp
push 8
push ebp
push ebp
push ebp
push 0x4d9a10
push ebp
push eax
call dword [sym.imp.ADVAPI32.dll_CreateProcessAsUserA]
test eax, eax
je 0x40bea9
mov dword [0x4f3744], ebp
mov dword [esp + 0x14], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe9
jne 0x40bf7e
mov edi, 1
cmp dword [0x4f3748], edi
jne 0x40bf62
mov eax, dword [0x4f3744]
add eax, edi
cmp eax, 3
mov dword [0x4f3744], eax
jle 0x40bf7e
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryA]
push str.winsta.dll
call edi
push str.user32.dll
mov esi, eax
call edi
xor edi, edi
mov ebx, eax
test esi, esi
je 0x40bf0c
push str.WinStationConnectW
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test ebx, ebx
je 0x40bf1e
push str.LockWorkStation
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebp, eax
test edi, edi
je 0x40bf40
mov ecx, dword [0x4f37c0]
xor eax, eax
test ecx, ecx
je 0x40bf30
call ecx
push 0
push 0x4a9b10
push eax
push 0
push 0
call edi
call ebp
push 0xbb8
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret
mov ecx, dword [esp + 0x10]
push 8
push ecx
push esi
xor ecx, ecx
call fcn.0040b220
add esp, 0xc
mov dword [0x4f3744], ebp
mov dword [esp + 0x14], edi
mov edx, dword [esp + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret
mov eax, edi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x54
ret