Function at 0x401000
Capabilities:
Create process on windows
Get common file path
Read file on windows
Set current directory
Set file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x578
push edi
push 0x407030
push 0
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_PulseEvent]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x401157
push 0x104
push 0
lea ecx, [ebp - 0x10c]
push ecx
call fcn.00401400
add esp, 0xc
push 0
lea edx, [ebp - 8]
push edx
push 0x104
lea eax, [ebp - 0x10c]
push eax
push 0xfffffffffffffff6
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x401148
cmp dword [ebp - 8], 0
je 0x401148
push 0x407048
push 0x2e
lea ecx, [ebp - 0x10c]
push ecx
call fcn.004013d0
add esp, 8
push eax
call fcn.00405b60
add esp, 8
test eax, eax
jne 0x401148
mov dword [ebp - 0x214], 3
push 0x104
lea edx, [ebp - 0x210]
push edx
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
push 0x407050
lea eax, [ebp - 0x210]
push eax
call fcn.004012f0
add esp, 8
lea ecx, [ebp - 0x210]
push ecx
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
mov edx, dword [ebp - 0x214]
and edx, 0xfffffffe
push edx
lea eax, [ebp - 0x10c]
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
mov ecx, dword [ebp - 0x214]
push ecx
push 2
push 0
push 3
push 0xc0000000
lea edx, [ebp - 0x10c]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x218], eax
cmp dword [ebp - 0x218], 0xffffffff
je 0x40113b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x218]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40127b
mov dword [ebp - 0x578], 0x44
mov dword [ebp - 0x574], 0
mov ecx, 0xf
xor eax, eax
lea edi, [ebp - 0x570]
rep stosd dword es:[edi], eax
mov dword [ebp - 0x228], 0
xor edx, edx
mov dword [ebp - 0x224], edx
mov dword [ebp - 0x220], edx
mov dword [ebp - 0x21c], edx
push 0x104
lea eax, [ebp - 0x534]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [ebp - 0x534]
push ecx
lea edx, [ebp - 0x430]
push edx
call fcn.004012e0
add esp, 8
push 0x5c
lea eax, [ebp - 0x430]
push eax
call fcn.004013d0
add esp, 8
mov byte [eax], 0
push 0x5c
lea ecx, [ebp - 0x534]
push ecx
call fcn.004013d0
add esp, 8
add eax, 1
push eax
lea edx, [ebp - 0x430]
push edx
push 0x407064
lea eax, [ebp - 0x32c]
push eax
call fcn.00401284
add esp, 0x10
mov dword [ebp - 0x54c], 1
mov word [ebp - 0x548], 0
lea ecx, [ebp - 0x228]
push ecx
lea edx, [ebp - 0x578]
push edx
lea eax, [ebp - 0x430]
push eax
push 0
push 0
push 1
push 0
push 0
lea ecx, [ebp - 0x32c]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x40127b
push 0xffffffffffffffff
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x228]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 0x224]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
pop edi
mov esp, ebp
pop ebp
ret 0x10