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

Disassembly:
lea eax, [ebp - 0xc]
lea edx, [ebp - 0x12c]
mov ecx, 0x104
call fcn.0040388c
test byte [ebp - 0x158], 0x10
je 0x40ae01
mov eax, dword [ebp - 0xc]
mov edx, 0x40b4b0
call fcn.004039f0
je 0x40b348
mov eax, dword [ebp - 0xc]
mov edx, 0x40b4bc
call fcn.004039f0
je 0x40b348
push dword [ebp - 4]
push dword [ebp - 0xc]
push 0x40b4c8
lea eax, [ebp - 0x160]
mov edx, 3
call fcn.00403964
mov eax, dword [ebp - 0x160]
call fcn.0040ad10
jmp 0x40b348
mov eax, 0x41eb54
mov edx, 0x40b4d4
call fcn.00403780
cmp word [0x41d298], 0
jne 0x40ae28
add dword [0x41eb78], 1
jno 0x40ae28
call fcn.00402f1c
mov eax, dword [0x41eb78]
cmp eax, dword [0x41eb74]
jl 0x40b348
lea eax, [ebp - 0x164]
push eax
mov eax, dword [ebp - 0xc]
call fcn.004038a4
mov edx, eax
sub edx, 2
jno 0x40ae54
call fcn.00402f1c
mov ecx, 3
mov eax, dword [ebp - 0xc]
call fcn.00403afc
mov eax, dword [ebp - 0x164]
lea edx, [ebp - 0x10]
call fcn.0040520c
mov edx, dword [0x41eb48]
mov eax, dword [ebp - 0x10]
call fcn.00403b3c
test eax, eax
je 0x40ae87
mov byte [ebp - 0x15], 3
jmp 0x40ae8b
mov byte [ebp - 0x15], 1
mov eax, 0x41eb54
mov edx, 0x40b5a4
call fcn.00403780
cmp byte [ebp - 0x15], 3
jne 0x40af70
mov eax, dword [0x41eb44]
call fcn.004038a4
test eax, eax
jne 0x40aebb
mov byte [ebp - 0x15], 2
jmp 0x40af70
cmp dword [ebp - 0x138], 0x9600000
jbe 0x40aed0
mov byte [ebp - 0x15], 2
jmp 0x40af70
mov eax, dword [ebp - 0x10]
mov edx, 0x40b668
call fcn.004039f0
jne 0x40af17
cmp dword [ebp - 0x138], 0x7530
jae 0x40aef1
mov byte [ebp - 0x15], 2
jmp 0x40af70
lea eax, [ebp - 0x168]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 4]
call fcn.004038f0
mov eax, dword [ebp - 0x168]
call fcn.004055bc
test al, al
jne 0x40af70
mov byte [ebp - 0x15], 2
jmp 0x40af70
mov edx, dword [ebp - 0xc]
mov eax, dword [0x41eda8]
call fcn.00403b3c
test eax, eax
je 0x40af70
mov edx, dword [ebp - 0xc]
mov eax, dword [0x41edac]
call fcn.00403b3c
test eax, eax
jne 0x40af70
mov edx, dword [ebp - 0xc]
mov eax, dword [0x41edb0]
call fcn.00403b3c
test eax, eax
jne 0x40af70
mov edx, dword [ebp - 0xc]
mov eax, dword [0x41edb4]
call fcn.00403b3c
test eax, eax
jne 0x40af70
mov edx, dword [ebp - 0xc]
mov eax, dword [0x41edb8]
call fcn.00403b3c
test eax, eax
jne 0x40af70
mov byte [ebp - 0x15], 2
mov eax, 0x41eb54
mov edx, 0x40b674
call fcn.00403780
cmp byte [ebp - 0x15], 3
jne 0x40b027
add word [0x41d298], 1
jae 0x40af98
call fcn.00402f1c
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.0040a3d8
test al, al
je 0x40afd5
mov eax, 0x41eb58
mov edx, dword [ebp - 4]
call fcn.00403780
lea eax, [ebp - 0x16c]
mov ecx, 0x40b4c8
mov edx, dword [0x41eb40]
call fcn.004038f0
mov eax, dword [ebp - 0x16c]
call fcn.0040ad10
push dword [0x41eb24]
push 0x40b6a8
lea edx, [ebp - 0x174]
movzx eax, word [0x41d298]
call fcn.00405148
push dword [ebp - 0x174]
push 0x40b6b4
lea eax, [ebp - 0x170]
mov edx, 4
call fcn.00403964
mov eax, dword [ebp - 0x170]
call fcn.004057dc
sub word [0x41d298], 1
jae 0x40b027
call fcn.00402f1c
mov eax, 0x41eb54
mov edx, 0x40b6c4
call fcn.00403780
mov byte [ebp - 0x16], 0
cmp byte [ebp - 0x15], 1
jne 0x40b2e9
cmp dword [0x41eb84], 0x64
setl al
sub al, 1
jb 0x40b09c
jne 0x40b0b0
mov edx, dword [0x41ecb4]
mov eax, dword [ebp - 0x10]
call fcn.00403b3c
test eax, eax
jle 0x40b06c
mov byte [ebp - 0x16], 1
jmp 0x40b0b0
mov edx, dword [0x41ecb0]
mov eax, dword [ebp - 0x10]
call fcn.00403b3c
test eax, eax
jle 0x40b084
mov byte [ebp - 0x16], 0
jmp 0x40b0b0
cmp dword [ebp - 0x138], 0xa00000
ja 0x40b096
mov byte [ebp - 0x16], 1
jmp 0x40b0b0
mov byte [ebp - 0x16], 0
jmp 0x40b0b0
mov edx, dword [0x41ecb4]
mov eax, dword [ebp - 0x10]
call fcn.00403b3c
test eax, eax
setg byte [ebp - 0x16]
cmp byte [ebp - 0x16], 0
je 0x40b2e9
lea eax, [ebp - 0x178]
mov ecx, dword [ebp - 0xc]
mov edx, dword [ebp - 4]
call fcn.004038f0
mov eax, dword [ebp - 0x178]
lea edx, [ebp - 0x14]
call fcn.00408aa8
mov eax, dword [ebp - 0x14]
call fcn.004038a4
test eax, eax
jle 0x40b2e9
push 0
push 0x80
push 4
push 0
push 0
push 0x40000000
mov eax, dword [0x41eb14]
call fcn.00403aa4
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [0x41eba0], eax
push 2
push 0
push 0
mov eax, dword [0x41eba0]
push eax
call sub.kernel32.dll_SetFilePointer_1
push 0
mov eax, dword [0x41eba0]
push eax
call sub.kernel32.dll_GetFileSize_1
test eax, eax
jns 0x40b137
call fcn.00402f14
mov dword [0x41eb88], eax
cmp dword [0x41eb88], 0xed800
jle 0x40b208
push 0x40b754
lea edx, [ebp - 0x180]
mov eax, dword [0x41eb88]
call fcn.00405148
push dword [ebp - 0x180]
push 0x40b768
lea edx, [ebp - 0x184]
mov eax, 0xed800
call fcn.00405148
push dword [ebp - 0x184]
lea eax, [ebp - 0x17c]
mov edx, 4
call fcn.00403964
mov eax, dword [ebp - 0x17c]
call fcn.00412764
push 0xc8
mov ecx, dword [0x41ed38]
mov edx, dword [0x41ed00]
mov eax, 0x80000002
call fcn.00406e90
push 0x40b774
mov ecx, dword [0x41ed04]
mov edx, dword [0x41ed00]
mov eax, 0x80000002
call fcn.00406d68
push 0
mov ecx, dword [0x41ed0c]
mov edx, dword [0x41ed00]
mov eax, 0x80000002
call fcn.00406e90
push 0
mov ecx, dword [0x41ed08]
mov edx, dword [0x41ed00]
invalid