Function at 0x40da90
Capabilities:
Check if file exists
Print debug messages
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4f111b
mov eax, dword fs:[0]
push eax
sub esp, 0x9c
mov eax, dword [0x54b1b4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
lea eax, [ebp - 0x54]
push eax
mov esi, ecx
call fcn.0040d810
add esp, 4
xor ebx, ebx
mov dword [ebp - 4], ebx
mov eax, dword [ebp - 0x54]
mov edi, 8
cmp dword [ebp - 0x40], edi
jae 0x40dae1
lea eax, [ebp - 0x54]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40dc06
mov eax, dword [ebp - 0x54]
cmp dword [ebp - 0x40], edi
jae 0x40dafb
lea eax, [ebp - 0x54]
push 0x5117c8
push eax
call fcn.004bb543
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x40db28
cmp dword [ebp - 0x40], 8
jb 0x40db21
mov ecx, dword [ebp - 0x54]
push ecx
call fcn.004ba3a4
add esp, 4
xor al, al
jmp 0x40dce6
push 0x27
lea edx, [ebp - 0x37]
push ebx
push edx
mov byte [ebp - 0x38], bl
call fcn.004c24e0
add esp, 0xc
push edi
push 1
lea eax, [ebp - 0x38]
push 0x28
push eax
call fcn.004bb92b
push edi
call fcn.004bb9b5
lea eax, [ebp - 0x38]
add esp, 0x14
mov dword [ebp - 0x5c], 0xf
mov dword [ebp - 0x60], ebx
mov byte [ebp - 0x70], bl
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
cmp cl, bl
jne 0x40db64
sub eax, edx
push eax
lea ecx, [ebp - 0x38]
push ecx
lea ecx, [ebp - 0x70]
call fcn.00407c70
lea edx, [ebp - 0xa8]
push edx
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 1
call fcn.0040ffc0
add esp, 4
mov edi, eax
mov byte [ebp - 4], 2
call fcn.00407640
mov edi, 8
mov byte [ebp - 4], 1
cmp dword [ebp - 0x94], edi
jb 0x40dbbb
mov eax, dword [ebp - 0xa8]
push eax
call fcn.004ba3a4
add esp, 4
cmp dword [esi + 0x10], ebx
je 0x40dbf1
cmp dword [ebp - 0x5c], 0x10
jb 0x40dbd2
mov ecx, dword [ebp - 0x70]
push ecx
call fcn.004ba3a4
add esp, 4
mov dword [ebp - 0x5c], 0xf
mov dword [ebp - 0x60], ebx
mov byte [ebp - 0x70], bl
cmp dword [ebp - 0x40], edi
jb 0x40dce4
mov edx, dword [ebp - 0x54]
push edx
jmp 0x40dcdc
mov byte [ebp - 4], bl
cmp dword [ebp - 0x5c], 0x10
jb 0x40dc06
mov eax, dword [ebp - 0x70]
push eax
call fcn.004ba3a4
add esp, 4
mov ecx, esi
call fcn.0040d720
test al, al
jne 0x40dc38
push 0x5117cc
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [ebp - 0x40], edi
jb 0x40db21
mov ecx, dword [ebp - 0x54]
push ecx
call fcn.004ba3a4
add esp, 4
xor al, al
jmp 0x40dce6
mov eax, dword [ebp - 0x54]
cmp dword [ebp - 0x40], edi
jae 0x40dc43
lea eax, [ebp - 0x54]
push 0x5117fc
push eax
call fcn.004bb543
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x40dc71
cmp dword [ebp - 0x40], 8
jb 0x40db21
mov edx, dword [ebp - 0x54]
push edx
call fcn.004ba3a4
add esp, 4
xor al, al
jmp 0x40dce6
lea eax, [ebp - 0x8c]
push eax
mov ecx, esi
call fcn.0040fef0
mov eax, dword [ebp - 0x8c]
mov esi, 0x10
add esp, 4
cmp dword [ebp - 0x78], esi
jae 0x40dc98
lea eax, [ebp - 0x8c]
mov ecx, dword [ebp - 0x7c]
push edi
push 1
push ecx
push eax
call fcn.004bbf34
push edi
call fcn.004bb9b5
add esp, 0x14
cmp dword [ebp - 0x78], esi
jb 0x40dcc2
mov edx, dword [ebp - 0x8c]
push edx
call fcn.004ba3a4
add esp, 4
cmp dword [ebp - 0x40], 8
mov dword [ebp - 0x78], 0xf
mov dword [ebp - 0x7c], ebx
mov byte [ebp - 0x8c], bl
jb 0x40dce4
mov eax, dword [ebp - 0x54]
push eax
call fcn.004ba3a4
add esp, 4
mov al, 1
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004ba3af
mov esp, ebp
pop ebp
ret