Function at 0x10048590
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x72c
mov eax, dword [0x100b0380]
xor eax, esp
mov dword [esp + 0x724], eax
push ebx
push ebp
push esi
push edi
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x532]
push ecx
mov word [esp + 0x534], ax
call fcn.1007dcf0
add esp, 0xc
xor edx, edx
push 0x206
push edx
lea eax, [esp + 0x32a]
push eax
mov word [esp + 0x32c], dx
call fcn.1007dcf0
add esp, 0xc
xor ecx, ecx
push 0xfe
push ecx
lea edx, [esp + 0x22]
push edx
mov word [esp + 0x24], cx
call fcn.1007dcf0
add esp, 0xc
xor eax, eax
push 0x206
push eax
lea ecx, [esp + 0x122]
push ecx
mov word [esp + 0x124], ax
call fcn.1007dcf0
mov edx, dword [0x100e38a0]
xor edx, dword [0x100e389c]
mov eax, dword [0x100e3968]
add esp, 0xc
cmp eax, edx
je 0x10048654
mov edx, dword [0x100e3898]
xor edx, dword [0x100e3894]
lea ecx, [esp + 0x528]
push ecx
push 0x104
add edx, eax
call edx
push 0x400
call fcn.100799bf
add esp, 4
xor edx, edx
mov ebp, eax
mov dword [esp + 0x14], edx
jmp 0x10048674
mov edx, dword [esp + 0x14]
xor eax, eax
movzx esi, ax
mov eax, esi
shl esi, 0x10
or eax, esi
mov ecx, 0x82
lea edi, [esp + 0x118]
rep stosd dword es:[edi], eax
xor eax, eax
movzx ecx, word [esp + eax + 0x528]
mov word [esp + eax + 0x118], cx
add eax, 2
test cx, cx
jne 0x10048690
cmp edx, 0xa
jle 0x100487bc
cmp edx, 0x1e
jl 0x100486c9
mov esi, 0x10
lea edi, [esp + 0x18]
call fcn.100484d0
jmp 0x100487ca
cmp edx, 0x14
jg 0x1004874d
mov edi, 0x80
lea esi, [esp + 0x18]
call fcn.100483d0
mov eax, dword [0x100e38a0]
mov ecx, dword [0x100e3aa0]
mov edx, eax
xor edx, dword [0x100e389c]
cmp ecx, edx
je 0x10048712
mov eax, esi
push eax
mov eax, dword [0x100e3898]
xor eax, dword [0x100e3894]
lea edx, [esp + 0x11c]
push edx
add eax, ecx
call eax
mov eax, dword [0x100e38a0]
xor eax, dword [0x100e389c]
mov ecx, dword [0x100e3aac]
cmp ecx, eax
je 0x1004873d
mov eax, dword [0x100e3898]
xor eax, dword [0x100e3894]
push 0
lea edx, [esp + 0x11c]
push edx
push 0
add eax, ecx
call eax
mov esi, 0x10
lea edi, [esp + 0x18]
call fcn.100484d0
jmp 0x100487ca
mov esi, 0x10
lea edi, [esp + 0x18]
call fcn.100484d0
mov eax, dword [0x100e38a0]
mov ecx, dword [0x100e3aa0]
mov edx, eax
xor edx, dword [0x100e389c]
cmp ecx, edx
je 0x10048791
mov eax, edi
push eax
mov eax, dword [0x100e3898]
xor eax, dword [0x100e3894]
lea edx, [esp + 0x11c]
push edx
add eax, ecx
call eax
mov eax, dword [0x100e38a0]
xor eax, dword [0x100e389c]
mov ecx, dword [0x100e3aac]
cmp ecx, eax
je 0x100487bc
mov eax, dword [0x100e3898]
xor eax, dword [0x100e3894]
push 0
lea edx, [esp + 0x11c]
push edx
push 0
add eax, ecx
call eax
mov edi, 0x80
lea esi, [esp + 0x18]
call fcn.100483d0
xor eax, eax
lea esp, [esp]
movzx ecx, word [esp + eax + 0x118]
mov word [esp + eax + 0x320], cx
add eax, 2
test cx, cx
jne 0x100487d0
mov ecx, dword [0x100e38a0]
xor ecx, dword [0x100e389c]
mov eax, dword [0x100e3aa0]
cmp eax, ecx
je 0x1004881a
lea edx, [esp + 0x18]
push edx
mov edx, dword [0x100e3898]
xor edx, dword [0x100e3894]
lea ecx, [esp + 0x324]
push ecx
add edx, eax
call edx
lea eax, [esp + 0x320]
add eax, 0xfffffffe
mov cx, word [eax + 2]
add eax, 2
test cx, cx
jne 0x10048824
mov ecx, dword [0x1009f82c]
mov edx, dword [0x1009f830]
mov dword [eax], ecx
mov cx, word [0x1009f834]
mov dword [eax + 4], edx
mov word [eax + 8], cx
call fcn.10079c4e
cdq
mov ecx, 0x3e8
idiv ecx
push 0x100a2368
mov esi, edx
lea edx, [esp + 0x324]
push edx
add esi, 0xa
call fcn.1007c019
mov ebx, eax
add esp, 8
test ebx, ebx
je 0x100488b2
xor edi, edi
test esi, esi
jle 0x10048896
nop
call fcn.10079c4e
cdq
mov ecx, 0xff
idiv ecx
inc edi
cmp edi, esi
mov byte [edi + ebp - 1], dl
jl 0x10048880
push ebx
push esi
push 1
push ebp
call fcn.1007c192
push ebx
call fcn.1007c39e
add esp, 0x14
push ebx
call fcn.1007c471
add esp, 4
mov eax, dword [esp + 0x14]
inc eax
cmp eax, 0x28
mov dword [esp + 0x14], eax
jl 0x10048670
push ebp
call fcn.10079d09
mov ecx, dword [esp + 0x738]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.10079a05
add esp, 0x72c
ret