Function at 0x412520
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x441918
mov eax, dword fs:[0]
push eax
sub esp, 0x30
mov eax, dword [0x4521a0]
xor eax, esp
mov dword [esp + 0x28], eax
push ebx
push esi
push edi
mov eax, dword [0x4521a0]
xor eax, esp
push eax
lea eax, [esp + 0x40]
mov dword fs:[0], eax
cmp dword [ecx + 0x3c], 0
mov dword [esp + 0x10], ecx
je 0x41283d
cmp byte [ecx + 0x41], 0
je 0x41283d
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push 0xffffffffffffffff
call edx
cmp eax, 0xffffffff
je 0x412830
mov ecx, 0xf
xor eax, eax
mov byte [esp + 0x20], 0
mov dword [esp + 0x34], ecx
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], 8
cmp ecx, 0x10
jae 0x4125aa
lea eax, [esp + 0x20]
mov byte [eax + 8], 0
mov dword [esp + 0x48], 0
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x34]
mov edi, edi
cmp edx, 0x10
jb 0x4126d3
mov ebx, eax
mov dword [esp + 0x14], ebx
test eax, eax
je 0x4125f7
mov ecx, eax
cmp edx, 0x10
jae 0x4125de
lea ecx, [esp + 0x20]
cmp ecx, ebx
ja 0x4125f7
mov ecx, eax
cmp edx, 0x10
jae 0x4125ed
lea ecx, [esp + 0x20]
mov esi, dword [esp + 0x30]
add ecx, esi
cmp ebx, ecx
jbe 0x412604
call fcn.004285a7
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x1c]
cmp ecx, 0xfffffffc
je 0x41262f
mov ecx, eax
cmp edx, 0x10
jae 0x412618
lea ecx, [esp + 0x20]
mov esi, dword [esp + 0x30]
add ecx, esi
cmp ebx, ecx
jb 0x41262f
call fcn.004285a7
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x30]
cmp edx, 0x10
jb 0x4126e0
mov esi, eax
test eax, eax
je 0x41266a
mov ecx, eax
cmp edx, 0x10
jae 0x41264d
lea ecx, [esp + 0x20]
cmp ecx, esi
ja 0x41266a
mov ecx, eax
cmp edx, 0x10
jae 0x41265c
lea ecx, [esp + 0x20]
mov ebx, dword [esp + 0x30]
add ecx, ebx
mov ebx, dword [esp + 0x14]
cmp esi, ecx
jbe 0x412677
call fcn.004285a7
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x1c]
cmp ecx, 0xfffffffc
je 0x412698
cmp edx, 0x10
jae 0x412689
lea eax, [esp + 0x20]
mov edx, dword [esp + 0x30]
add eax, edx
cmp esi, eax
jb 0x412698
call fcn.004285a7
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x3c]
mov edx, dword [ecx]
mov edx, dword [edx + 0x18]
lea eax, [esp + 0x18]
push eax
mov eax, dword [esp + 0x14]
add ebx, edi
push ebx
push esi
add eax, 0x44
push eax
call edx
sub eax, 0
je 0x4126e9
sub eax, 1
je 0x4126f1
sub eax, 2
lea ecx, [esp + 0x1c]
jne 0x41282b
jmp 0x412838
lea ebx, [esp + 0x20]
mov dword [esp + 0x14], ebx
jmp 0x4125d3
lea esi, [esp + 0x20]
jmp 0x412642
mov eax, dword [esp + 0x10]
mov byte [eax + 0x41], 0
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
cmp edx, 0x10
jb 0x412815
mov esi, eax
test eax, eax
je 0x41272c
mov ecx, eax
cmp edx, 0x10
jae 0x412713
lea ecx, [esp + 0x20]
cmp ecx, esi
ja 0x41272c
mov ecx, eax
cmp edx, 0x10
jae 0x412722
lea ecx, [esp + 0x20]
mov edi, dword [esp + 0x30]
add ecx, edi
cmp esi, ecx
jbe 0x412739
call fcn.004285a7
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x1c]
cmp ecx, 0xfffffffc
je 0x412764
mov ecx, eax
cmp edx, 0x10
jae 0x41274d
lea ecx, [esp + 0x20]
mov edi, dword [esp + 0x30]
add ecx, edi
cmp esi, ecx
jb 0x412764
call fcn.004285a7
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
sub edi, esi
je 0x4127f1
cmp edx, 0x10
jb 0x41281e
mov esi, eax
test eax, eax
je 0x4127a3
mov ecx, eax
cmp edx, 0x10
jae 0x41278a
lea ecx, [esp + 0x20]
cmp ecx, esi
ja 0x4127a3
mov ecx, eax
cmp edx, 0x10
jae 0x412799
lea ecx, [esp + 0x20]
mov ebx, dword [esp + 0x30]
add ecx, ebx
cmp esi, ecx
jbe 0x4127b0
call fcn.004285a7
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x1c]
cmp ecx, 0xfffffffc
je 0x4127d1
cmp edx, 0x10
jae 0x4127c2
lea eax, [esp + 0x20]
mov edx, dword [esp + 0x30]
add eax, edx
cmp esi, eax
jb 0x4127d1
call fcn.004285a7
mov eax, dword [esp + 0x10]
mov ecx, dword [eax + 0x4c]
push ecx
push edi
push 1
push esi
call fcn.0042974c
add esp, 0x10
cmp edi, eax
jne 0x412827
mov edx, dword [esp + 0x34]
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x10]
cmp byte [ecx + 0x41], 0
je 0x412834
test edi, edi
jne 0x4125c0
push edi
lea eax, [edi + 8]
lea edi, [esp + 0x20]
call fcn.004120b0
jmp 0x4125b6
lea esi, [esp + 0x20]
jmp 0x412708
lea esi, [esp + 0x20]
jmp 0x41277f
lea ecx, [esp + 0x1c]
call fcn.00406220
xor al, al
jmp 0x41283f
lea ecx, [esp + 0x1c]
call fcn.00406220
mov al, 1
mov ecx, dword [esp + 0x40]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x28]
xor ecx, esp
call fcn.00427f27
mov esp, ebp
pop ebp
ret