Function at 0x531218
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffff9b0
push ebx
push esi
push edi
mov dword [ebp - 0x28], ecx
mov esi, edx
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x20]
mov edx, dword [0x427d00]
call fcn.00407fe4
xor eax, eax
push ebp
push 0x531543
push dword fs:[eax]
mov dword fs:[eax], esp
xor eax, eax
mov dword [ebp - 0x30], eax
xor ecx, ecx
push ebp
push 0x531520
push dword fs:[ecx]
mov dword fs:[ecx], esp
movzx edi, byte [esi + 1]
cmp edi, 0x40
jle 0x53127b
mov ecx, dword [0x54bbe4]
mov dl, 1
mov eax, dword [0x5306c0]
call fcn.00421910
call fcn.00406618
test edi, edi
je 0x531444
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x34], eax
mov eax, edi
add eax, eax
lea eax, [ebp + eax*8 - 0x650]
mov dword [ebp - 0x38], eax
xor ebx, ebx
sub dword [ebp - 0x38], 0x10
movzx eax, byte [esi + ebx + 3]
mov edx, eax
and dl, 0x7f
movzx edx, dl
mov dword [ebp - 0x2c], edx
and al, 0x80
cmp dword [ebp - 0x2c], 0xa
jne 0x5312cd
mov eax, dword [ebp - 0x38]
mov dword [eax], 0xa
mov eax, dword [ebp - 0x38]
mov dword [eax + 8], 0x80020004
jmp 0x53143b
cmp dword [ebp - 0x2c], 0x48
jne 0x531347
mov edx, dword [ebp - 0x30]
lea edx, [ebp + edx*8 - 0x250]
mov dword [ebp - 0x3c], edx
test al, al
je 0x531314
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov eax, dword [eax]
call fcn.0040851c
mov edx, dword [ebp - 0x3c]
mov dword [edx], eax
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov edx, dword [ebp - 0x3c]
mov dword [edx + 4], eax
mov eax, dword [ebp - 0x38]
mov dword [eax], 0x4008
mov eax, dword [ebp - 0x3c]
mov edx, dword [ebp - 0x38]
mov dword [edx + 8], eax
jmp 0x53133f
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
call fcn.0040851c
mov edx, dword [ebp - 0x3c]
mov dword [edx], eax
mov eax, dword [ebp - 0x3c]
xor edx, edx
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x38]
mov dword [eax], 8
mov eax, dword [ebp - 0x3c]
mov eax, dword [eax]
mov edx, dword [ebp - 0x38]
mov dword [edx + 8], eax
inc dword [ebp - 0x30]
jmp 0x531437
test al, al
je 0x531390
cmp dword [ebp - 0x2c], 0xc
jne 0x531373
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
cmp word [eax], 0x100
jne 0x531373
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov edx, eax
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov ecx, 8
call fcn.0042a734
mov eax, dword [ebp - 0x2c]
or eax, 0x4000
mov edx, dword [ebp - 0x38]
mov dword [edx], eax
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov edx, dword [ebp - 0x38]
mov dword [edx + 8], eax
jmp 0x531437
cmp dword [ebp - 0x2c], 0xc
jne 0x531409
mov eax, dword [ebp - 0x34]
cmp word [eax], 0x100
jne 0x5313de
mov eax, dword [ebp - 0x30]
lea eax, [ebp + eax*8 - 0x250]
mov dword [ebp - 0x40], eax
mov eax, dword [ebp - 0x34]
mov eax, dword [eax + 8]
call fcn.0040851c
mov edx, dword [ebp - 0x40]
mov dword [edx], eax
mov eax, dword [ebp - 0x40]
xor edx, edx
mov dword [eax + 4], edx
mov eax, dword [ebp - 0x38]
mov dword [eax], 8
mov eax, dword [ebp - 0x40]
mov eax, dword [eax]
mov edx, dword [ebp - 0x38]
mov dword [edx + 8], eax
inc dword [ebp - 0x30]
jmp 0x531437
mov eax, dword [ebp - 0x34]
mov edx, dword [eax]
mov ecx, dword [ebp - 0x38]
mov dword [ecx], edx
mov edx, dword [eax + 4]
mov ecx, dword [ebp - 0x38]
mov dword [ecx + 4], edx
mov edx, dword [eax + 8]
mov ecx, dword [ebp - 0x38]
mov dword [ecx + 8], edx
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 0x38]
mov dword [edx + 0xc], eax
add dword [ebp - 0x34], 0xc
jmp 0x531437
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 0x2c]
mov dword [eax], edx
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov edx, dword [ebp - 0x38]
mov dword [edx + 8], eax
cmp dword [ebp - 0x2c], 5
jl 0x531437
cmp dword [ebp - 0x2c], 7
jg 0x531437
add dword [ebp - 0x34], 4
mov eax, dword [ebp - 0x34]
mov eax, dword [eax]
mov edx, dword [ebp - 0x38]
mov dword [edx + 0xc], eax
add dword [ebp - 0x34], 4
inc ebx
cmp edi, ebx
jne 0x531299
lea eax, [ebp - 0x650]
mov dword [ebp - 0x50], eax
mov eax, dword [ebp - 0x28]
add eax, 4
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x48], edi
movzx eax, byte [esi + 2]
mov dword [ebp - 0x44], eax
mov eax, dword [ebp - 0x28]
mov edx, dword [eax]
movzx eax, byte [esi]
cmp eax, 4
jne 0x531495
mov ecx, dword [ebp - 0x650]
and ecx, 0xfff
cmp ecx, 9
jne 0x531483
mov eax, 8
mov ecx, dword [ebp - 0x28]
mov dword [ecx], 0xfffffffd
sub dword [ebp - 0x4c], 4
inc dword [ebp - 0x44]
jmp 0x5314a9
cmp eax, 1
jne 0x5314a9
test edi, edi
jne 0x5314a9
cmp dword [ebp + 8], 0
je 0x5314a9
mov eax, 3
push 0
lea ecx, [ebp - 0x20]
push ecx
mov ecx, dword [ebp + 8]
push ecx
lea ecx, [ebp - 0x50]
push ecx
push eax
push 0
mov eax, dword [0x54bd10]
push eax
push edx
mov eax, dword [ebp - 0x24]
push eax
mov eax, dword [eax]
call dword [eax + 0x18]
test eax, eax
je 0x5314d6
lea edx, [ebp - 0x20]
call fcn.005317f4
mov ebx, dword [ebp - 0x30]
test ebx, ebx
je 0x5314f9
dec ebx
lea esi, [ebp + ebx*8 - 0x250]
mov edi, dword [esi + 4]
test edi, edi
je 0x5314f5
mov edx, edi
mov eax, dword [esi]
call fcn.004084e4
test ebx, ebx
jne 0x5314dd
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x531527
mov ebx, dword [ebp - 0x30]
test ebx, ebx
je 0x53151f
dec ebx
mov eax, dword [ebp + ebx*8 - 0x250]
push eax
call sub.KERNEL32.DLL_WriteFile
test ebx, ebx
jne 0x53150d
ret