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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2e8
mov eax, dword [0x4545c0]
xor eax, ebp
mov dword [ebp - 8], eax
cmp dword [0x4589d4], 0
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 0x2b4], esi
mov dword [ebp - 0x2c0], eax
mov dword [ebp - 0x2cc], edi
mov dword [ebp - 0x2d4], ecx
mov dword [ebp - 0x2d0], edx
je 0x417137
cmp esi, dword [0x4589d0]
jb 0x417137
cmp esi, 4
jne 0x41688e
cmp dword [0x4589dc], 0
jne 0x417137
mov eax, 0x458c08
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416840
sub eax, edx
sar eax, 1
je 0x417137
push 0x458c08
push edi
call fcn.004321a7
add esp, 8
test eax, eax
je 0x417137
push str.16777343
push edi
call fcn.004321a7
add esp, 8
test eax, eax
jne 0x4168a3
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.004243bb
mov esp, ebp
pop ebp
ret
cmp esi, 6
je 0x416897
test esi, esi
jne 0x4168a3
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x2d8], eax
mov dword [ebp - 0x2a8], 0
cmp esi, 5
je 0x4168dc
cmp esi, 3
jne 0x4168c3
mov dword [ebp - 0x2a8], 0x44e3d8
jmp 0x4168dc
mov dword [ebp - 0x2a8], 0x44e3e0
cmp esi, 2
je 0x4168dc
mov dword [ebp - 0x2a8], 0x44e3e4
lea eax, [ebp - 0x2a4]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
xor ecx, ecx
push 0x206
push ecx
lea edx, [ebp - 0x292]
push edx
mov word [ebp - 0x294], cx
call fcn.0042c9e0
add esp, 0xc
cmp esi, 4
je 0x416937
movzx eax, word [ebp - 0x29e]
movzx ecx, word [ebp - 0x2a2]
movzx edx, word [ebp - 0x2a4]
push eax
push ecx
push edx
push 0x4583b8
push str._s_04u_02u_02u.log
lea eax, [ebp - 0x294]
push eax
jmp 0x416960
movzx ecx, word [ebp - 0x29e]
movzx edx, word [ebp - 0x2a2]
movzx eax, word [ebp - 0x2a4]
push ecx
push edx
push eax
push 0x4587c8
push str._s_04u_02u_02u.log
lea ecx, [ebp - 0x294]
push ecx
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
push 0x4589e4
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, dword [sym.imp.KERNEL32.dll_CreateFileW]
push 0
push 0x8000080
push 3
push 0
push 3
push 0xc0000000
lea edx, [ebp - 0x294]
push edx
mov dword [ebp - 0x2ac], 0
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
cmp esi, 0xffffffff
jne 0x4169f0
push 0
push 0x8000080
push 1
push 0
push 3
push 0xc0000000
lea eax, [ebp - 0x294]
push eax
call edi
mov esi, eax
cmp esi, 0xffffffff
je 0x41712c
push 0
lea ecx, [ebp - 0x2ac]
push ecx
push 2
lea edx, [ebp - 0x2b0]
push edx
push esi
mov word [ebp - 0x2b0], 0xfeff
call ebx
lea eax, [ebp - 0x2e4]
push eax
xor edi, edi
push esi
mov dword [ebp - 0x2e4], edi
mov dword [ebp - 0x2e0], edi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
mov ecx, dword [0x4589e0]
xor eax, eax
cmp dword [ebp - 0x2e0], eax
jl 0x416a2e
jg 0x41712c
cmp dword [ebp - 0x2e4], ecx
jae 0x41712c
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 2
push 0
push 0
push esi
call edi
test byte [0x45983c], 1
jne 0x416a58
or dword [0x45983c], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x459838], eax
xor ecx, ecx
push 0x7e
push ecx
lea edx, [ebp - 0x8a]
push edx
mov word [ebp - 0x8c], cx
call fcn.0042c9e0
mov eax, dword [ebp - 0x2a8]
mov ecx, dword [ebp - 0x2b4]
mov edx, dword [ecx*4 + 0x455a90]
add esp, 0xc
push eax
push edx
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
movzx ecx, word [ebp - 0x298]
movzx edx, word [ebp - 0x29a]
push eax
movzx eax, word [ebp - 0x296]
push eax
movzx eax, word [ebp - 0x29c]
push ecx
mov ecx, dword [0x459838]
push edx
push eax
push ecx
lea edx, [ebp - 0x8c]
push str.__i____02u:_02u:_02u:_03u___0x_08x____s___s
push edx
call dword [sym.imp.USER32.dll_wsprintfW]
lea eax, [ebp - 0x8c]
add esp, 0x28
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416ad4
sub eax, edx
push 0
sar eax, 1
lea ecx, [ebp - 0x2ac]
push ecx
lea edx, [eax + eax]
push edx
lea eax, [ebp - 0x8c]
push eax
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
cmp dword [ebp - 0x2c0], 0
mov dword [ebp - 0x2b8], 0
je 0x416b71
mov eax, dword [ebp - 0x2c0]
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416b20
sub eax, edx
push 0
sar eax, 1
lea ecx, [ebp - 0x2ac]
push ecx
lea edx, [eax + eax]
mov dword [ebp - 0x2b8], eax
mov eax, dword [ebp - 0x2c0]
push edx
push eax
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
push 0
lea ecx, [ebp - 0x2ac]
push ecx
push 4
push 0x44e3e4
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
mov eax, dword [ebp - 0x2cc]
mov dword [ebp - 0x2bc], 0
test eax, eax
je 0x416be0
lea edx, [eax + 2]
jmp 0x416b90
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416b90
mov ecx, dword [ebp - 0x2cc]
sub eax, edx
push 0
sar eax, 1
lea edx, [ebp - 0x2ac]
push edx
mov dword [ebp - 0x2bc], eax
add eax, eax
push eax
push ecx
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
push 0
lea edx, [ebp - 0x2ac]
push edx
push 4
push 0x44e3e4
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
mov eax, dword [ebp - 0x2d4]
mov dword [ebp - 0x2c8], 0
test eax, eax
je 0x416c48
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416bf7
sub eax, edx
push 0
sar eax, 1
lea ecx, [ebp - 0x2ac]
push ecx
lea edx, [eax + eax]
mov dword [ebp - 0x2c8], eax
mov eax, dword [ebp - 0x2d4]
push edx
push eax
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
push 0
lea ecx, [ebp - 0x2ac]
push ecx
push 4
push 0x44e3e4
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
mov eax, dword [ebp - 0x2d0]
mov dword [ebp - 0x2c4], 0
test eax, eax
je 0x416cb0
lea edx, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416c60
mov ecx, dword [ebp - 0x2d0]
sub eax, edx
push 0
sar eax, 1
lea edx, [ebp - 0x2ac]
push edx
mov dword [ebp - 0x2c4], eax
add eax, eax
push eax
push ecx
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
push 0
lea edx, [ebp - 0x2ac]
push edx
push 4
push 0x44e3e4
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
cmp dword [ebp - 0x2b4], 6
jne 0x416db0
cmp dword [ebp - 0x2d8], 0
mov dword [ebp - 0x2a8], 0
jbe 0x416db0
mov ecx, dword [ebp - 0x2d8]
push 0
push 0
lea eax, [ebp - 0x2a8]
push eax
push 0
push ecx
push str.wininet.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
push eax
push 0x1300
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov eax, dword [ebp - 0x2a8]
test eax, eax
je 0x416db0
push 0x44e290
push eax
call fcn.00424984
add esp, 8
test eax, eax
je 0x416d27
sub eax, dword [ebp - 0x2a8]
jmp 0x416d3d
mov eax, dword [ebp - 0x2a8]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416d30
sub eax, edx
push 0
lea edx, [ebp - 0x2ac]
push edx
push 0x16
push str.ErrorMsg_:
sar eax, 1
push esi
mov dword [ebp - 0x2b4], eax
call ebx
push 2
push 0
push 0
push esi
call edi
mov ecx, dword [ebp - 0x2b4]
push 0
lea eax, [ebp - 0x2ac]
push eax
mov eax, dword [ebp - 0x2a8]
lea edx, [ecx + ecx]
push edx
push eax
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
push 0
lea ecx, [ebp - 0x2ac]
push ecx
push 4
push 0x44e3e4
push esi
call ebx
push 2
push 0
push 0
push esi
call edi
mov edx, dword [ebp - 0x2a8]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
xor edi, edi
push edi
lea eax, [ebp - 0x2ac]
push eax
push 4
push 0x44e290
push esi
call ebx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x4589d8], edi
je 0x41712c
mov esi, dword [ebp - 0x2b8]
cmp esi, edi
ja 0x416dfd
cmp dword [ebp - 0x2bc], edi
ja 0x416dfd
cmp dword [ebp - 0x2c8], edi
ja 0x416dfd
cmp dword [ebp - 0x2c4], edi
jbe 0x41712c
mov eax, dword [ebp - 0x2d8]
mov dword [ebp - 0x2b0], edi
mov dword [ebp - 0x2a8], edi
cmp eax, edi
jbe 0x416e6c
push edi
push edi
lea ecx, [ebp - 0x2b0]
push ecx
push edi
push eax
push edi
push 0x1b00
call dword [sym.imp.KERNEL32.dll_FormatMessageW]
mov eax, dword [ebp - 0x2b0]
cmp eax, edi
je 0x416e6c
push 0x44e290
push eax
call fcn.00424984
add esp, 8
cmp eax, edi
je 0x416e4e
sub eax, dword [ebp - 0x2b0]
jmp 0x416e64
mov eax, dword [ebp - 0x2b0]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416e57
sub eax, edx
sar eax, 1
mov dword [ebp - 0x2a8], eax
lea eax, [ebp - 0x8c]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416e75
sub eax, edx
sar eax, 1
add eax, dword [ebp - 0x2a8]
xor ecx, ecx
add eax, dword [ebp - 0x2c4]
mov edx, 2
add eax, dword [ebp - 0x2c8]
add eax, dword [ebp - 0x2bc]
lea esi, [eax + esi + 0x20]
mov eax, esi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.00424a1d
add esi, esi
push esi
mov ebx, eax
push edi
push ebx
mov dword [ebp - 0x2b4], esi
call fcn.0042c9e0
mov eax, str._Smr_
mov ecx, ebx
add esp, 0x10
sub ecx, eax
movzx edx, word [eax]
mov word [ecx + eax], dx
add eax, 2
cmp dx, di
jne 0x416ed6
lea eax, [ebp - 0x8c]
mov edx, eax
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416ef0
sub eax, edx
lea edi, [ebx - 2]
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x416f00
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
cmp dword [ebp - 0x2b8], 0
rep movsb byte es:[edi], byte [esi]
jbe 0x416f5c
mov eax, dword [ebp - 0x2c0]
mov edx, eax
lea ecx, [ecx]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416f30
sub eax, edx
lea edi, [ebx - 2]
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x416f40
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [ebp - 0x2bc], 0
jbe 0x416fcc
lea eax, [ebx - 2]
jmp 0x416f70
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x416f70
mov ecx, dword [0x44e3e4]
mov dword [eax], ecx
mov dx, word [0x44e3e8]
mov word [eax + 4], dx
mov eax, dword [ebp - 0x2cc]
mov edx, eax
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x416f97
sub eax, edx
lea edi, [ebx - 2]
jmp 0x416fb0
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x416fb0
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [ebp - 0x2c8], 0
jbe 0x41703c
lea eax, [ebx - 2]
jmp 0x416fe0
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x416fe0
mov ecx, dword [0x44e3e4]
mov dword [eax], ecx
mov dx, word [0x44e3e8]
mov word [eax + 4], dx
mov eax, dword [ebp - 0x2d4]
mov edx, eax
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x417007
sub eax, edx
lea edi, [ebx - 2]
jmp 0x417020
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x417020
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [ebp - 0x2c4], 0
jbe 0x4170ac
lea eax, [ebx - 2]
jmp 0x417050
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x417050
mov ecx, dword [0x44e3e4]
mov dword [eax], ecx
mov dx, word [0x44e3e8]
mov word [eax + 4], dx
mov eax, dword [ebp - 0x2d0]
mov edx, eax
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x417077
sub eax, edx
lea edi, [ebx - 2]
jmp 0x417090
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x417090
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
cmp dword [ebp - 0x2b0], 0
je 0x41710d
lea eax, [ebx - 2]
jmp 0x4170c0
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x4170c0
mov ecx, dword [0x44e3e4]
mov dword [eax], ecx
mov dx, word [0x44e3e8]
mov word [eax + 4], dx
mov eax, dword [ebp - 0x2a8]
mov ecx, dword [ebp - 0x2b0]
push eax
push ecx
push ebx
call fcn.00424620
mov edx, dword [ebp - 0x2b0]
add esp, 0xc
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov dword [ebp - 0x2b0], 0
push ebx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [ebp - 0x2b4]
push eax
push 0
push ebx
call fcn.0042c9e0
push ebx
call fcn.00424a28
add esp, 0x10
push 0x4589e4
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004243bb
mov esp, ebp
pop ebp
ret