Function at 0x508f10
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x5c
mov eax, dword [0x56b0f0]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push 0x5c
mov eax, dword [ebx]
mov dword [ebp - 0x4c], ebx
mov eax, dword [eax + 0x8664]
mov dword [ebp - 0x40], eax
push dword [eax]
call fcn.004c4130
mov ebx, dword [ebx]
add esp, 8
xorps xmm0, xmm0
mov dword [ebp - 0x50], eax
movlpd qword [ebp - 0x5c], xmm0
call fcn.004f7a10
mov ecx, dword [ebx + 0x154]
mov edi, edx
mov edx, dword [ebp - 0x4c]
mov esi, eax
mov dword [edx + 0x2a0], ecx
lea ecx, [ebx + 0x53c]
mov eax, dword [ebx + 0x104]
mov dword [edx + 0x2a4], eax
mov eax, dword [edx]
mov dword [eax + 0xdc], ecx
mov eax, dword [ebp - 0x50]
test eax, eax
jne 0x508f9c
pop edi
pop esi
mov eax, 0x25
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004add49
mov esp, ebp
pop ebp
ret
cmp byte [eax + 1], 0
je 0x508f86
mov eax, dword [ebx + 0x8650]
or eax, dword [ebx + 0x8654]
je 0x508fc9
mov eax, dword [ebp - 0x40]
push 0x518e0c
push dword [eax]
call fcn.004cc5a3
mov edx, eax
add esp, 8
mov dword [ebp - 0x44], edx
jmp 0x50902d
mov eax, dword [edx]
push dword [eax + 0x330]
mov eax, dword [ebp - 0x40]
push 0x8301
push dword [eax]
call fcn.004e3c42
add esp, 0xc
test eax, eax
jns 0x509010
mov eax, dword [ebp - 0x40]
push dword [eax]
push str.Cant_open__s_for_writing
push ebx
call fcn.004e8210
add esp, 0xc
mov eax, 0x17
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004add49
mov esp, ebp
pop ebp
ret
push eax
call fcn.004d92c9
mov eax, dword [ebp - 0x40]
push 0x518e08
push dword [eax]
call fcn.004cc5a3
add esp, 0xc
mov dword [ebp - 0x44], eax
mov edx, eax
test edx, edx
je 0x508fe7
mov ecx, dword [ebx + 0x1b0]
mov eax, dword [ebx + 0x1b4]
cmp ecx, 0xffffffff
jne 0x509046
cmp eax, ecx
je 0x509054
push eax
push ecx
push ebx
call fcn.004ff2b0
mov edx, dword [ebp - 0x44]
add esp, 0xc
cmp dword [ebx + 0x8654], 0
jg 0x5090c5
jl 0x509068
cmp dword [ebx + 0x8650], 0
jae 0x5090c5
lea eax, [ebp - 0x3c]
push eax
push edx
call fcn.004d779c
add esp, 4
push eax
call fcn.00513e7e
add esp, 8
test eax, eax
je 0x5090b3
push dword [ebp - 0x44]
call fcn.004cb1af
mov eax, dword [ebp - 0x40]
push dword [eax]
push str.Cant_get_the_size_of__s
push ebx
call fcn.004e8210
add esp, 0x10
mov eax, 0x17
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004add49
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x24]
mov dword [ebx + 0x8650], eax
mov eax, dword [ebp - 0x20]
mov dword [ebx + 0x8654], eax
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x5c]
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x58]
push eax
push 0x4000
push dword [ebp - 0x4c]
call fcn.004ec330
add esp, 0xc
mov dword [ebp - 0x40], eax
test eax, eax
jne 0x5091a7
mov ecx, dword [ebp - 0x58]
mov dword [ebp - 0x48], ecx
test ecx, ecx
jle 0x5091fe
mov eax, dword [ebx + 0x8654]
mov edx, dword [ebx + 0x8650]
mov dword [ebp - 0x40], eax
mov eax, edx
or eax, dword [ebp - 0x40]
je 0x509149
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x48], 0
cmp dword [ebp - 0x48], eax
jg 0x5091c8
jl 0x509131
cmp ecx, edx
ja 0x5091c8
sub edx, ecx
mov ecx, 0
mov dword [ebx + 0x8650], edx
sbb eax, ecx
mov dword [ebp - 0x48], ecx
mov dword [ebx + 0x8654], eax
lea edx, [ebx + 0x53c]
push dword [ebp - 0x44]
push ecx
push 1
push edx
call fcn.004cb742
mov ecx, dword [ebp - 0x48]
add esp, 0x10
cmp eax, ecx
jne 0x5091f7
mov edx, dword [ebp - 0x54]
mov eax, dword [ebp - 0x50]
add edx, ecx
mov dword [ebp - 0x54], edx
adc eax, 0
push eax
push edx
push ebx
mov dword [ebp - 0x50], eax
call fcn.004ff290
push dword [ebp - 0x4c]
call fcn.004ff460
add esp, 0x10
test eax, eax
jne 0x5091f0
push edi
push esi
push ebx
call fcn.004ff0b0
add esp, 0xc
mov dword [ebp - 0x40], eax
test eax, eax
je 0x5090d1
mov esi, dword [ebp - 0x40]
push dword [ebp - 0x44]
call fcn.004cb1af
mov ecx, dword [ebp - 4]
add esp, 4
mov eax, esi
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004add49
mov esp, ebp
pop ebp
ret
mov eax, edx
mov dword [ebx + 0x8650], 0
lea edx, [ebx + 0x53c]
mov dword [ebx + 0x8654], 0
add edx, eax
sub ecx, eax
mov dword [ebp - 0x48], ecx
jmp 0x50914f
mov esi, 0x2a
jmp 0x5091aa
mov esi, 0x37
jmp 0x5091aa
push dword [ebp - 0x4c]
call fcn.004ff460
mov esi, dword [ebp - 0x40]
add esp, 4
test eax, eax
mov ecx, 0x2a
cmovne esi, ecx
jmp 0x5091aa