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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x58cf10
mov eax, dword fs:[0]
push eax
push ecx
mov eax, 0x4538
call fcn.004c3410
mov eax, dword [0x5f4760]
xor eax, esp
mov dword [esp + 0x4534], eax
push ebx
push edi
mov eax, dword [0x5f4760]
xor eax, esp
push eax
lea eax, [esp + 0x4548]
mov dword fs:[0], eax
xor ebx, ebx
mov dword [esp + 0x18], ebx
cmp dword [ebp + 8], ebx
jne 0x409e86
xor eax, eax
jmp 0x40a214
cmp dword [esi + 0x2c], ebx
je 0x409e7f
push 0x7f
lea eax, [esp + 0x41]
push ebx
push eax
mov byte [esp + 0x48], bl
call fcn.004add60
add esp, 0xc
push 0x7f
lea ecx, [esp + 0xc1]
push ebx
push ecx
mov byte [esp + 0xc8], bl
call fcn.004add60
add esp, 0xc
lea edx, [esp + 0x10]
push edx
call fcn.004030f0
mov dword [esp + 0x4550], ebx
mov ebx, dword [ebp + 8]
lea eax, [ebp + 0xc]
push eax
lea edi, [esp + 0x14]
call fcn.00402da0
lea ecx, [esp + 0x2c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx edx, word [esp + 0x32]
movzx eax, word [esp + 0x2e]
movzx ecx, word [esp + 0x2c]
push edx
push eax
push ecx
lea edx, [esp + 0xc8]
push str._04d__02d__02d
push edx
call fcn.004a4097
movzx eax, word [esp + 0x4e]
movzx ecx, word [esp + 0x4c]
movzx edx, word [esp + 0x4a]
add esp, 0x14
push eax
movzx eax, word [esp + 0x38]
push ecx
push edx
push eax
lea ecx, [esp + 0x4c]
push str._02d:_02d:_02d._03d
push ecx
call fcn.004a4097
lea eax, [esi + 0x10]
add esp, 0x18
push eax
mov dword [esp + 0x2c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esi]
xor edi, edi
cmp eax, edi
je 0x40a04f
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [esi + 0x38], edi
je 0x409fa3
lea edx, [esp + 0x1c]
push edx
push eax
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov edx, dword [esp + 0x20]
mov ecx, dword [esi + 0x38]
xor eax, eax
cmp edx, eax
jl 0x409fa3
jg 0x409f86
mov eax, dword [esp + 0x1c]
cmp eax, ecx
jbe 0x409fa3
mov edx, dword [esi]
push edi
lea ecx, [esp + 0x24]
push ecx
push edi
push edx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], edi
call ebx
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov ecx, dword [esi]
push 2
push edi
push edi
push ecx
call ebx
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [esp + 0x14], edi
cmp dword [esi + 0xc], edi
je 0x40a004
lea edx, [esp + 0x3c]
push edx
lea eax, [esp + 0xc0]
push eax
lea ecx, [esp + 0x144]
push 0x5d3aec
push ecx
call fcn.004a4097
lea eax, [esp + 0x14c]
add esp, 0x10
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x409fe7
mov ecx, dword [esi]
sub eax, edx
push edi
lea edx, [esp + 0x18]
push edx
push eax
lea eax, [esp + 0x148]
push eax
push ecx
call ebx
mov edx, dword [esp + 0x10]
mov eax, edx
lea edi, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a010
push 0
lea ecx, [esp + 0x18]
push ecx
sub eax, edi
push eax
push edx
mov edx, dword [esi]
push edx
call ebx
cmp dword [esi + 0x30], 0
je 0x40a040
mov ecx, dword [esi]
push 0
lea eax, [esp + 0x18]
push eax
push 2
push 0x5d2c30
push ecx
call ebx
cmp dword [esi + 8], 0
je 0x40a04f
mov edx, dword [esi]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
cmp dword [esi + 4], 0
je 0x40a086
cmp dword [esi + 0xc], 0
je 0x40a074
mov eax, dword [esp + 0x10]
push eax
lea ecx, [esp + 0x40]
push ecx
push str._s__s_n
call fcn.004a4d17
add esp, 0xc
jmp 0x40a086
mov edx, dword [esp + 0x10]
push edx
push 0x5d3afc
call fcn.004a4d17
add esp, 8
cmp dword [esi + 0x34], 0
je 0x40a151
mov eax, dword [esp + 0x10]
mov eax, dword [eax - 0xc]
cmp eax, 0xbb8
jge 0x40a0a8
mov ebx, dword [esp + 0x18]
lea eax, [esp + 0x10]
jmp 0x40a0f3
lea ecx, [esp + 0x1c]
push ecx
mov ecx, 0xbb8
lea edx, [esp + 0x14]
call fcn.00408930
mov byte [esp + 0x4550], 1
lea edx, [esp + 0x14]
push str.......
push edx
mov ecx, eax
mov dword [esp + 0x20], 1
call fcn.0040a9e0
add esp, 8
mov dword [esp + 0x4550], 2
mov ebx, 3
mov dword [esp + 0x18], ebx
mov eax, dword [eax]
mov edi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push eax
call edi
mov dword [esp + 0x4550], 1
test bl, 2
je 0x40a11f
lea eax, [esp + 0x14]
and ebx, 0xfffffffd
push eax
mov dword [esp + 0x1c], ebx
call fcn.00403090
mov dword [esp + 0x4550], 0
test bl, 1
je 0x40a140
lea ecx, [esp + 0x1c]
and ebx, 0xfffffffe
push ecx
mov dword [esp + 0x1c], ebx
call fcn.00403090
call dword [sym.imp.KERNEL32.dll_IsDebuggerPresent]
test eax, eax
je 0x40a151
push 0x5d3b14
call edi
cmp dword [esi + 0x3c], 0
je 0x40a1ef
cmp dword [esi + 0x44], 0
je 0x40a1ef
cmp dword [esi + 0xc], 0
mov edx, dword [esp + 0x10]
push edx
je 0x40a18c
lea eax, [esp + 0x40]
push eax
lea ecx, [esp + 0x544]
push 0x5d3b08
push ecx
call fcn.004a4097
add esp, 0x10
jmp 0x40a1a1
lea eax, [esp + 0x540]
push 0x5d3b10
push eax
call fcn.004a4097
add esp, 0xc
lea eax, [esi + 0x54]
push eax
mov dword [esp + 0x20], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea ecx, [esp + 0x14]
push ecx
lea ecx, [esp + 0x540]
call fcn.00402fe0
mov byte [esp + 0x4550], 3
lea edi, [esi + 0x6c]
lea ebx, [esp + 0x14]
call fcn.0040a8f0
mov byte [esp + 0x4550], 0
mov edx, ebx
push edx
call fcn.00403090
mov eax, dword [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esp + 0x28]
push ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [esp + 0x4550], 0xffffffff
lea edx, [esp + 0x10]
push edx
call fcn.00403090
mov eax, 1
mov ecx, dword [esp + 0x4548]
mov dword fs:[0], ecx
pop ecx
pop edi
pop ebx
mov ecx, dword [esp + 0x4534]
xor ecx, esp
call fcn.004a314d
mov esp, ebp
pop ebp
ret