Function at 0x40de70
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 0x4f22cb
mov eax, dword fs:[0]
push eax
sub esp, 0x9c
mov eax, dword [0x54c1b4]
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.0040dbf0
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 0x40dec1
lea eax, [ebp - 0x54]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40dfe6
mov eax, dword [ebp - 0x54]
cmp dword [ebp - 0x40], edi
jae 0x40dedb
lea eax, [ebp - 0x54]
push 0x5129f0
push eax
call fcn.004bc673
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x40df08
cmp dword [ebp - 0x40], 8
jb 0x40df01
mov ecx, dword [ebp - 0x54]
push ecx
call fcn.004bb4d8
add esp, 4
xor al, al
jmp 0x40e0c6
push 0x27
lea edx, [ebp - 0x37]
push ebx
push edx
mov byte [ebp - 0x38], bl
call fcn.004c3610
add esp, 0xc
push edi
push 1
lea eax, [ebp - 0x38]
push 0x28
push eax
call fcn.004bca5b
push edi
call fcn.004bcae5
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 0x40df44
sub eax, edx
push eax
lea ecx, [ebp - 0x38]
push ecx
lea ecx, [ebp - 0x70]
call fcn.00408040
lea edx, [ebp - 0xa8]
push edx
lea ecx, [ebp - 0x70]
mov byte [ebp - 4], 1
call fcn.004103a0
add esp, 4
mov edi, eax
mov byte [ebp - 4], 2
call fcn.00407a10
mov edi, 8
mov byte [ebp - 4], 1
cmp dword [ebp - 0x94], edi
jb 0x40df9b
mov eax, dword [ebp - 0xa8]
push eax
call fcn.004bb4d8
add esp, 4
cmp dword [esi + 0x10], ebx
je 0x40dfd1
cmp dword [ebp - 0x5c], 0x10
jb 0x40dfb2
mov ecx, dword [ebp - 0x70]
push ecx
call fcn.004bb4d8
add esp, 4
mov dword [ebp - 0x5c], 0xf
mov dword [ebp - 0x60], ebx
mov byte [ebp - 0x70], bl
cmp dword [ebp - 0x40], edi
jb 0x40e0c4
mov edx, dword [ebp - 0x54]
push edx
jmp 0x40e0bc
mov byte [ebp - 4], bl
cmp dword [ebp - 0x5c], 0x10
jb 0x40dfe6
mov eax, dword [ebp - 0x70]
push eax
call fcn.004bb4d8
add esp, 4
mov ecx, esi
call fcn.0040db00
test al, al
jne 0x40e018
push 0x5129f4
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [ebp - 0x40], edi
jb 0x40df01
mov ecx, dword [ebp - 0x54]
push ecx
call fcn.004bb4d8
add esp, 4
xor al, al
jmp 0x40e0c6
mov eax, dword [ebp - 0x54]
cmp dword [ebp - 0x40], edi
jae 0x40e023
lea eax, [ebp - 0x54]
push 0x512a24
push eax
call fcn.004bc673
mov edi, eax
add esp, 8
cmp edi, ebx
jne 0x40e051
cmp dword [ebp - 0x40], 8
jb 0x40df01
mov edx, dword [ebp - 0x54]
push edx
call fcn.004bb4d8
add esp, 4
xor al, al
jmp 0x40e0c6
lea eax, [ebp - 0x8c]
push eax
mov ecx, esi
call fcn.004102d0
mov eax, dword [ebp - 0x8c]
mov esi, 0x10
add esp, 4
cmp dword [ebp - 0x78], esi
jae 0x40e078
lea eax, [ebp - 0x8c]
mov ecx, dword [ebp - 0x7c]
push edi
push 1
push ecx
push eax
call fcn.004bd064
push edi
call fcn.004bcae5
add esp, 0x14
cmp dword [ebp - 0x78], esi
jb 0x40e0a2
mov edx, dword [ebp - 0x8c]
push edx
call fcn.004bb4d8
add esp, 4
cmp dword [ebp - 0x40], 8
mov dword [ebp - 0x78], 0xf
mov dword [ebp - 0x7c], ebx
mov byte [ebp - 0x8c], bl
jb 0x40e0c4
mov eax, dword [ebp - 0x54]
push eax
call fcn.004bb4d8
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.004bb4e3
mov esp, ebp
pop ebp
ret