Function at 0x402e70
Capabilities:
Get file size
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x4296c6
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x4530
call fcn.00427360
mov eax, dword [0x431040]
xor eax, esp
mov dword [esp + 0x452c], eax
push ebx
push edi
mov eax, dword [0x431040]
xor eax, esp
push eax
lea eax, [esp + 0x4540]
mov dword fs:[0], eax
xor ebx, ebx
cmp dword [ebp + 8], ebx
jne 0x402ec2
xor eax, eax
jmp 0x4031bb
cmp dword [esi + 0x2c], ebx
je 0x402ebb
push 0x7f
lea eax, [esp + 0x39]
push ebx
push eax
mov byte [esp + 0x40], bl
call fcn.0041c570
add esp, 0xc
push 0x7f
lea ecx, [esp + 0xb9]
push ebx
push ecx
mov byte [esp + 0xc0], bl
call fcn.0041c570
mov edx, dword [0x4321e8]
mov eax, dword [edx + 0xc]
add esp, 0xc
mov ecx, 0x4321e8
call eax
add eax, 0x10
mov dword [esp + 0x1c], eax
lea ecx, [ebp + 0xc]
mov dword [esp + 0x4548], ebx
mov ebx, dword [ebp + 8]
push ecx
lea edi, [esp + 0x20]
call fcn.004031e0
lea edx, [esp + 0x24]
push edx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [esp + 0x2a]
movzx ecx, word [esp + 0x26]
movzx edx, word [esp + 0x24]
push eax
push ecx
push edx
lea eax, [esp + 0xc0]
push str._04d__02d__02d
push eax
call fcn.0041a6df
movzx ecx, word [esp + 0x44]
movzx edx, word [esp + 0x42]
movzx eax, word [esp + 0x40]
add esp, 0x14
push ecx
push edx
push eax
lea ecx, [esp + 0x40]
push str._02d:_02d:_02d
push ecx
call fcn.0041a6df
lea eax, [esi + 0x10]
add esp, 0x14
push eax
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi]
xor ebx, ebx
cmp eax, ebx
je 0x4030a7
cmp dword [esi + 0x38], ebx
je 0x402fe4
lea edx, [esp + 0x14]
push edx
push eax
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov edx, dword [esp + 0x18]
mov ecx, dword [esi + 0x38]
xor eax, eax
cmp edx, eax
jl 0x402fe4
jg 0x402fc3
mov eax, dword [esp + 0x14]
cmp eax, ecx
jbe 0x402fe4
mov edx, dword [esi]
push ebx
lea ecx, [esp + 0x1c]
push ecx
push ebx
push edx
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp dword [esi + 0xc], ebx
mov dword [esp + 0x10], ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x40303e
lea ecx, [esp + 0x34]
push ecx
lea edx, [esp + 0xb8]
push edx
lea eax, [esp + 0x13c]
push 0x42bdbc
push eax
call fcn.0041a6df
lea eax, [esp + 0x144]
add esp, 0x10
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403020
push 0
sub eax, edx
lea ecx, [esp + 0x14]
push ecx
push eax
mov eax, dword [esi]
lea edx, [esp + 0x140]
push edx
push eax
call ebx
mov edi, dword [esp + 0x1c]
mov eax, edi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x403047
push 0
lea ecx, [esp + 0x14]
push ecx
sub eax, edx
mov edx, dword [esi]
push eax
push edi
push edx
call ebx
cmp dword [esi + 0x30], 0
je 0x403077
mov ecx, dword [esi]
push 0
lea eax, [esp + 0x14]
push eax
push 2
push 0x42bd98
push ecx
call ebx
cmp dword [esi + 8], 0
je 0x403086
mov edx, dword [esi]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
xor ebx, ebx
cmp dword [esi + 4], ebx
je 0x4030ba
push edi
cmp dword [esi + 0xc], ebx
je 0x4030ad
lea eax, [esp + 0x38]
push eax
push str._s__s_n
call fcn.0041aa88
add esp, 0xc
jmp 0x4030ba
mov edi, dword [esp + 0x1c]
jmp 0x403088
push 0x42bdcc
call fcn.0041aa88
add esp, 8
cmp dword [esi + 0x34], ebx
je 0x4030d1
push edi
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x42bdd0
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
cmp dword [esi + 0x3c], ebx
je 0x403184
cmp dword [esi + 0x44], ebx
je 0x403184
push edi
cmp dword [esi + 0xc], ebx
je 0x403105
lea ecx, [esp + 0x38]
push ecx
lea edx, [esp + 0x53c]
push str._s__s
push edx
call fcn.0041a6df
add esp, 0x10
jmp 0x40311a
lea eax, [esp + 0x538]
push 0x42bddc
push eax
call fcn.0041a6df
add esp, 0xc
lea eax, [esi + 0x54]
push eax
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [esp + 0x10]
push ecx
lea ecx, [esp + 0x538]
call fcn.00401680
lea edi, [esi + 0x6c]
lea ebx, [esp + 0x10]
mov byte [esp + 0x4548], 1
call fcn.00403950
mov byte [esp + 0x4548], 0
mov eax, dword [esp + 0x10]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x403175
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ecx, dword [esp + 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
push edx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [edi - 0x10]
mov dword [esp + 0x4548], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4031b6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x4540]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov ecx, dword [esp + 0x452c]
xor ecx, esp
call fcn.0041a2c9
mov esp, ebp
pop ebp
ret