Function at 0x10140130
Capabilities:
Write file on windows

Disassembly:
push ecx
push edi
mov edi, dword [esp + 0xc]
mov ecx, dword [edi + 0x38]
mov eax, dword [ecx]
mov dword [esp + 4], ecx
test al, 4
je 0x1014015b
cmp dword [ecx + 0x34], 0xffff0000
jbe 0x1014015b
mov dword [0x1018612c], 4
xor eax, eax
pop edi
pop ecx
ret
test al, 1
jne 0x1014016e
mov dword [0x1018612c], 0xa
xor eax, eax
pop edi
pop ecx
ret
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov edx, dword [esp + 0x20]
push ebx
mov ebx, dword [esp + 0x14]
push ebp
mov ebp, dword [esp + 0x1c]
push esi
mov esi, dword [esp + 0x30]
mov dword [edi + 0x18], ebx
mov dword [edi + 0x1c], ebp
mov dword [edi + 0x20], eax
mov dword [edi + 0x24], ecx
mov dword [edi + 0x28], edx
test esi, esi
je 0x101401c2
mov eax, dword [esi + 8]
mov ecx, dword [esi]
push eax
push ecx
call fcn.101403d0
add esp, 8
mov dword [edi + 0x2c], eax
test eax, eax
jne 0x101401c9
pop esi
pop ebp
pop ebx
mov dword [0x1018612c], 7
pop edi
pop ecx
ret
mov dword [edi + 0x2c], 0
mov eax, dword [edi + 0x38]
mov byte [esp + 0x18], 0x2c
mov ecx, dword [eax + 0x40]
test ecx, ecx
je 0x101401e7
push 1
lea edx, [esp + 0x1c]
push edx
push edi
call ecx
add esp, 0xc
jmp 0x101401fd
mov eax, dword [eax + 0x38]
push eax
push 1
lea ecx, [esp + 0x20]
push 1
push ecx
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
mov edx, edi
mov eax, ebx
call fcn.1013fa40
mov edx, edi
mov eax, ebp
call fcn.1013fa40
mov ebx, dword [esp + 0x24]
mov edx, edi
mov eax, ebx
call fcn.1013fa40
mov eax, dword [esp + 0x28]
mov edx, edi
call fcn.1013fa40
test esi, esi
je 0x10140231
mov eax, dword [esi + 4]
dec eax
jmp 0x10140233
xor eax, eax
mov ecx, dword [esp + 0x2c]
mov edx, esi
neg edx
sbb dl, dl
and dl, 0x80
neg ecx
sbb cl, cl
and cl, 0x40
or dl, cl
or dl, al
mov eax, dword [edi + 0x38]
mov byte [esp + 0x18], dl
mov ecx, dword [eax + 0x40]
test ecx, ecx
je 0x10140268
push 1
lea edx, [esp + 0x1c]
push edx
push edi
call ecx
add esp, 0xc
jmp 0x1014027e
mov eax, dword [eax + 0x38]
push eax
push 1
lea ecx, [esp + 0x20]
push 1
push ecx
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
test esi, esi
je 0x101402ea
xor ebp, ebp
cmp dword [esi], ebp
jle 0x101402ea
xor ebx, ebx
lea ebx, [ebx]
mov edx, dword [esi + 8]
mov cl, byte [ebx + edx]
lea eax, [ebx + edx]
mov byte [esp + 0x18], cl
mov dl, byte [eax + 1]
mov byte [esp + 0x19], dl
mov al, byte [eax + 2]
mov byte [esp + 0x1a], al
mov eax, dword [edi + 0x38]
mov ecx, dword [eax + 0x40]
test ecx, ecx
je 0x101402c4
push 3
lea edx, [esp + 0x1c]
push edx
push edi
call ecx
add esp, 0xc
jmp 0x101402da
mov eax, dword [eax + 0x38]
push eax
push 3
lea ecx, [esp + 0x20]
push 1
push ecx
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
cmp eax, 3
jne 0x10140308
inc ebp
add ebx, eax
cmp ebp, dword [esi]
jl 0x10140290
mov ebx, dword [esp + 0x24]
cmp dword [edi + 0x10], 0
jne 0x1014031a
cmp dword [edi + 0x2c], 0
jne 0x1014031a
pop esi
pop ebp
pop ebx
mov dword [0x1018612c], 5
xor eax, eax
pop edi
pop ecx
ret
pop esi
pop ebp
pop ebx
mov dword [0x1018612c], 2
xor eax, eax
pop edi
pop ecx
ret
imul ebx, dword [esp + 0x28]
mov eax, dword [esp + 0x10]
or dword [eax], 4
mov dword [eax + 0x34], ebx
call fcn.1013fef0
pop esi
pop ebp
pop ebx
mov eax, 1
pop edi
pop ecx
ret