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

Disassembly:
push ebp
mov ebp, esp
push 0xfffffffffffffffe
push 0x1008fa38
push 0x1005aa50
mov eax, dword fs:[0]
push eax
sub esp, 8
mov eax, 0x1694
call fcn.10055c30
mov eax, dword [0x1009cbc0]
xor dword [ebp - 8], eax
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0x10]
mov dword fs:[0], eax
mov dword [ebp - 0x18], esp
mov ebx, edx
mov dword [ebp - 0x1688], ebx
mov esi, ecx
xor eax, eax
mov word [ebp - 0x1684], ax
mov dword [ebp - 0x1682], eax
mov dword [ebp - 0x167e], eax
mov dword [ebp - 0x167a], eax
mov word [ebp - 0x1676], ax
mov dword [ebp - 0x1694], 0xffffffff
mov dword [ebp - 0x168c], eax
lea edi, [eax + 0x32]
mov dword [ebp - 0x1690], eax
mov dword [ebp - 0x16a0], eax
mov dword [ebp - 0x169c], eax
mov dword [ebp - 0x16a4], 0x140003
mov dword [ebp - 0x1698], eax
call fcn.10001ab0
cmp eax, 1
jne 0x10002915
mov dword [ebp - 4], 0
mov dword [ebp - 4], eax
lea eax, [ebp - 0x1684]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push str.mbae_default.log
lea eax, [ebp - 0x224]
cmp word [0x100e1fb0], 0
jne 0x1000256b
push 0x104
push eax
call fcn.10053320
add esp, 0xc
jmp 0x1000257e
push 0x100e1fb0
push 0x10086350
push eax
call fcn.10004ed0
add esp, 0x10
push ebx
movzx eax, word [ebp - 0x1678]
push eax
movzx eax, word [ebp - 0x167a]
push eax
movzx eax, word [ebp - 0x167c]
push eax
movzx eax, word [ebp - 0x167e]
push eax
movzx eax, word [ebp - 0x1682]
push eax
movzx eax, word [ebp - 0x1684]
push eax
push esi
push str._s__04d__02d__02d____02d:_02d:_02d____s_r_n
lea eax, [ebp - 0x1674]
push eax
call fcn.10004f20
add esp, 0x28
mov ebx, dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea ebx, [ebx]
push 0
push 0x80
push 4
push 0
push 1
push 4
lea eax, [ebp - 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x1694], esi
cmp esi, 0xffffffff
jne 0x100026e1
push str.Retry_log_file_open_from_dll_n
call ebx
push 0xc8
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp esi, esi
jne 0x100026e1
mov eax, edi
dec edi
mov dword [ebp - 0x16ac], edi
test eax, eax
jne 0x100025d0
cmp esi, esi
jne 0x100026e1
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
add eax, 0x1e
mov dword [ebp - 0x1688], eax
call esi
lea edi, [eax + 0x1e]
push 0x1000a
call fcn.1005218a
add esp, 4
mov esi, eax
test esi, esi
jne 0x1000266b
push str.Memory_allocation_error_in_log_file_n
call fcn.10052604
add esp, 4
push str.Memory_allocation_error_in_log_file_n
call ebx
jmp 0x100026c3
push 0x100865c0
push 0xffff
push esi
call fcn.10052136
add esp, 0xc
push edi
test eax, eax
jle 0x100026a6
mov byte [esi + 0xffff], 0
push esi
push str.MbaeBasicLog
push 1
mov edx, 0x156
mov ecx, str.....mbae_commonMbaeLog.cpp
call fcn.10001cf0
add esp, 0x10
jmp 0x100026ba
push str.Error__d_in_swprintf_s_n
call fcn.10052604
add esp, 8
push str.Error_in_swprintf_s_n
call ebx
push esi
call fcn.10052152
add esp, 4
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
mov eax, dword [ebp - 0x1688]
jmp 0x10002a36
lea eax, [ebp - 0x16a0]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
je 0x1000278e
mov eax, dword [ebp - 0x16a0]
or eax, dword [ebp - 0x169c]
jne 0x1000278e
push eax
lea eax, [ebp - 0x168c]
push eax
push 4
lea eax, [ebp - 0x16a4]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1000272e
cmp dword [ebp - 0x168c], 4
je 0x1000278e
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push str.Error__d_writting_the_log_file_header_n
mov eax, dword [ebp - 0x1690]
dec eax
push eax
lea eax, [ebp - 0x1674]
push eax
call fcn.1005211a
add esp, 0x10
lea eax, [ebp - 0x1674]
push eax
call ebx
lea eax, [ebp - 0x1674]
push eax
push 0x10086484
call fcn.10052604
add esp, 8
call esi
mov esi, eax
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
mov eax, esi
jmp 0x10002a36
lea edi, [ebp - 0x1674]
lea ecx, [edi + 2]
mov ax, word [edi]
add edi, 2
test ax, ax
jne 0x10002797
sub edi, ecx
sar edi, 1
mov dword [ebp - 0x1690], edi
lea eax, [edi + 0x14]
push eax
call fcn.1005218a
add esp, 4
mov ecx, eax
mov dword [ebp - 0x16a8], ecx
test ecx, ecx
jne 0x100027f8
push edi
push str.Memory_allocation_error_in_log_file:__d_n
call fcn.10052604
add esp, 8
lea eax, [ebp - 0x1674]
push eax
call ebx
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
mov eax, 5
jmp 0x10002a36
push 0xffffffffffffffff
lea eax, [ebp - 0x1674]
push eax
lea eax, [edi + 1]
push eax
push ecx
lea eax, [ebp - 0x1698]
push eax
call fcn.10052d14
add esp, 0x14
mov edi, eax
test edi, edi
je 0x1000284d
push edi
mov esi, dword [ebp - 0x1688]
push esi
push str.wcstombs_s_error_in_log_file:__s____d_n
call fcn.10052604
add esp, 0xc
push esi
call ebx
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
mov eax, edi
jmp 0x10002a36
mov edi, dword [ebp - 0x16a8]
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10002858
sub ecx, edx
mov dword [ebp - 0x1698], ecx
jne 0x10002886
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
mov eax, 8
jmp 0x10002a36
mov ecx, edi
call fcn.10002a60
mov ecx, eax
mov dword [ebp - 0x1688], ecx
mov eax, dword [ebp - 0x1690]
cdq
and edx, 7
add eax, edx
sar eax, 3
cmp ecx, eax
jl 0x10002869
push 0
lea eax, [ebp - 0x168c]
push eax
push 4
lea eax, [ebp - 0x1690]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1000291c
cmp dword [ebp - 0x168c], 4
jne 0x1000291c
mov eax, dword [ebp - 0x1688]
shl eax, 3
push 0
lea ecx, [ebp - 0x168c]
push ecx
push eax
push edi
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1000291c
mov ecx, dword [ebp - 0x1688]
lea eax, [ecx*8]
cmp dword [ebp - 0x168c], eax
jne 0x1000291c
mov dword [ebp - 4], 0
call fcn.10002987
mov dword [ebp - 4], 0xfffffffe
xor eax, eax
jmp 0x10002a36
push dword [ebp - 0x1688]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
lea eax, [ebp - 0x224]
push eax
push str.Error_writting_the_log_file:__s____d____d_n
lea eax, [ebp - 0x1674]
push eax
call fcn.10004f20
add esp, 0x14
lea eax, [ebp - 0x1674]
push eax
call ebx
lea eax, [ebp - 0x1674]
push eax
push 0x10086484
call fcn.10052604
add esp, 8
call esi
mov esi, eax
push 0xfffffffffffffffe
lea eax, [ebp - 0x10]
push eax
push 0x1009cbc0
call fcn.10062b20
add esp, 0xc
mov eax, esi
jmp 0x10002a36
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.1005132c
mov esp, ebp
pop ebp
ret