Function at 0x4022d7
Capabilities:
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x18cc
call fcn.0041d000
mov eax, dword [0x4271f0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0x14]
push esi
mov dword [ebp - 0x18ac], ecx
mov ecx, dword [ebp + 0x10]
push edi
mov dword [ebp - 0x18b4], eax
mov dword [ebp - 0x18a8], ecx
mov esi, edx
cmp eax, dword [0x429770]
jg 0x402607
call fcn.0040261e
xor eax, eax
push 0x1000
mov word [ebp - 0x18a4], ax
xor edi, edi
lea eax, [ebp - 0x18a2]
push edi
push eax
call fcn.00411bc0
push ebx
push esi
lea eax, [ebp - 0x18a4]
push 0x800
push eax
call fcn.0040c013
add esp, 0x1c
push 0xffffffffffffffff
push dword [0x429778]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [0x429768], 8
mov eax, dword [0x429754]
jae 0x402373
mov eax, 0x429754
push edi
push 0x80
push 4
push edi
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x18c0], ebx
cmp ebx, 0xffffffff
je 0x4025fb
lea eax, [ebp - 0x18c4]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
jne 0x4023ce
push edi
lea eax, [ebp - 0x18cc]
push eax
push 2
lea eax, [ebp - 0x18b0]
push eax
push ebx
mov word [ebp - 0x18b0], 0xfeff
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [ebp - 0x18bc]
push eax
call fcn.0040c2df
mov dword [ebp - 0x18bc], eax
lea eax, [ebp - 0x18bc]
push eax
mov dword [ebp - 0x18b8], edx
call fcn.0040c2b8
mov esi, eax
xor eax, eax
push 0x898
mov word [ebp - 0x8a0], ax
lea eax, [ebp - 0x89e]
push edi
push eax
call fcn.00411bc0
add esp, 0x14
cmp dword [0x429770], 4
jg 0x40249f
cmp dword [0x42974c], 8
jb 0x402435
mov eax, dword [0x429738]
mov dword [ebp - 0x18a8], eax
jmp 0x40243f
mov dword [ebp - 0x18a8], 0x429738
lea eax, [ebp - 0x18a4]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push dword [ebp - 0x18a8]
mov eax, dword [ebp - 0x18b4]
movsx eax, byte [eax + str.ENNNIWARNT]
push eax
push dword [esi]
mov eax, dword [esi + 0x10]
push dword [esi + 4]
inc eax
push dword [esi + 8]
push dword [esi + 0xc]
push eax
mov eax, dword [esi + 0x14]
add eax, 0x76c
push eax
push str._d__02d__02d__02d:_02d:_02d__t_c__t_s__t_08x:_08x__t_s_r_n
lea eax, [ebp - 0x8a0]
push 0x44c
push eax
call fcn.0040b8ed
add esp, 0x38
jmp 0x4025ab
mov ebx, dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [ebp - 0x18ac], edi
jne 0x4024b5
mov dword [ebp - 0x18ac], edi
jmp 0x4024f5
push dword [ebp - 0x18ac]
call ebx
lea edi, [eax + 1]
lea eax, [edi + edi]
call fcn.00418470
mov eax, esp
push edi
push eax
push 0xffffffffffffffff
push dword [ebp - 0x18ac]
xor ecx, ecx
push ecx
push ecx
mov dword [ebp - 0x18b0], eax
mov word [eax], cx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, dword [ebp - 0x18b0]
mov dword [ebp - 0x18ac], eax
xor edi, edi
cmp dword [ebp - 0x18a8], edi
jne 0x402501
xor eax, eax
jmp 0x402531
push dword [ebp - 0x18a8]
call ebx
lea edi, [eax + 1]
lea eax, [edi + edi]
call fcn.00418470
mov ebx, esp
push edi
push ebx
push 0xffffffffffffffff
push dword [ebp - 0x18a8]
xor eax, eax
push eax
push eax
mov word [ebx], ax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov eax, ebx
xor edi, edi
cmp dword [0x42974c], 8
mov ebx, dword [0x429738]
jae 0x402545
mov ebx, 0x429738
push dword [ebp + 0xc]
lea ecx, [ebp - 0x18a4]
push dword [ebp - 0x18ac]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
mov eax, dword [ebp - 0x18b4]
movsx eax, byte [eax + str.ENNNIWARNT]
push ebx
push eax
push dword [esi]
mov eax, dword [esi + 0x10]
push dword [esi + 4]
inc eax
push dword [esi + 8]
push dword [esi + 0xc]
push eax
mov eax, dword [esi + 0x14]
add eax, 0x76c
push eax
push str._d__02d__02d__02d:_02d:_02d__t_c__t_s__t_08x:_08x__t__s__s__tFL:_s__d__r_n
lea eax, [ebp - 0x8a0]
push 0x44c
push eax
call fcn.0040b8ed
mov ebx, dword [ebp - 0x18c0]
add esp, 0x44
lea eax, [ebp - 0x8a0]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
push 2
push edi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x8a0]
lea ecx, [eax + 2]
mov dx, word [eax]
add eax, 2
cmp dx, di
jne 0x4025cc
sub eax, ecx
push edi
sar eax, 1
lea ecx, [ebp - 0x18c8]
push ecx
add eax, eax
push eax
lea eax, [ebp - 0x8a0]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [0x429778]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
lea esp, [ebp - 0x18d8]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040b365
leave
ret 0x10