Function at 0x10145a52
Capabilities:
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
mov esi, ecx
mov edi, edx
mov dword [ebp - 0x14], edi
test esi, esi
je 0x10145d9f
mov eax, 0x666e7469
cmp dword [esi], eax
jne 0x10145d9f
test edi, edi
je 0x10145d9f
cmp dword [edi], eax
jne 0x10145d9f
test byte [esi + 0x224], 2
je 0x10145d9f
test byte [edi + 0x224], 1
je 0x10145d9f
mov ecx, dword [ebp + 8]
mov eax, dword [esi + 0x21c]
imul ebx, ecx, 0x24
push 0x24
pop edx
mov dword [ebp - 0x18], ebx
mov dword [ebx + eax], 0x43455246
mov eax, dword [esi + 0x21c]
mov word [ebx + eax + 4], dx
mov eax, dword [esi + 0x21c]
mov word [ebx + eax + 6], cx
imul eax, dword [ebp + 0xc], 0x24
mov ecx, dword [esi + 0x21c]
mov dword [ebp - 8], eax
mov eax, dword [edi + 0x21c]
mov edx, dword [ebp - 8]
mov ax, word [edx + eax + 8]
mov word [ebx + ecx + 8], ax
mov eax, dword [edi + 0x21c]
mov ecx, dword [esi + 0x21c]
mov ax, word [edx + eax + 0xa]
mov word [ebx + ecx + 0xa], ax
mov eax, dword [edi + 0x21c]
mov ecx, dword [esi + 0x21c]
mov eax, dword [edx + eax + 0xc]
mov edx, dword [ebp + 0xc]
mov dword [ebx + ecx + 0xc], eax
mov ecx, edi
call fcn.101455c8
mov dword [ebp - 0x10], eax
test eax, eax
je 0x10145d9f
mov edx, dword [esi + 0x21c]
mov ecx, dword [esi + 0x220]
and dword [ebp - 0xc], 0
mov dword [ebx + edx + 0x10], ecx
mov ecx, eax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0xc]
jne 0x10145b4a
xor eax, eax
sub ecx, edx
push eax
sar ecx, 1
lea eax, [ebp - 4]
push eax
lea eax, [ecx*2 + 2]
push eax
push dword [ebp - 0x10]
push dword [esi + 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10145d9f
mov eax, dword [ebp - 4]
xor ecx, ecx
add eax, 3
add eax, dword [esi + 0x220]
push ecx
and eax, 0xfffffffc
push ecx
push eax
push dword [esi + 0x214]
mov dword [esi + 0x220], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0xc]
mov ecx, edi
mov dword [ebp - 0x10], eax
mov dword [esi + 0x220], eax
call fcn.1014560c
mov ecx, dword [esi + 0x21c]
mov edx, eax
test edx, edx
jne 0x10145bce
mov eax, dword [ebp - 8]
mov dword [ecx + eax + 0x14], edx
jmp 0x10145c3e
mov eax, dword [ebp - 0x10]
mov dword [ecx + ebx + 0x14], eax
mov ecx, edx
lea eax, [ecx + 2]
mov dword [ebp - 0x10], eax
mov ax, word [ecx]
add ecx, 2
cmp ax, word [ebp - 0xc]
jne 0x10145bdd
sub ecx, dword [ebp - 0x10]
xor eax, eax
push eax
sar ecx, 1
lea eax, [ebp - 4]
push eax
lea eax, [ecx*2 + 2]
push eax
push edx
push dword [esi + 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10145d9f
mov eax, dword [ebp - 4]
xor ecx, ecx
add eax, 3
add eax, dword [esi + 0x220]
push ecx
and eax, 0xfffffffc
push ecx
push eax
push dword [esi + 0x214]
mov dword [esi + 0x220], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esi + 0x220], eax
xor eax, eax
cmp dword [edi], 0x666e7469
mov edx, eax
jne 0x10145c74
test byte [edi + 0x224], 1
je 0x10145c74
mov eax, dword [edi + 0x218]
mov ecx, dword [ebp + 0xc]
cmp ecx, dword [eax + 0xc]
jae 0x10145c74
mov eax, dword [edi + 0x21c]
mov ecx, dword [ebp - 8]
mov edx, dword [ecx + eax + 0x18]
add edx, dword [edi + 0x228]
mov ecx, dword [esi + 0x21c]
mov eax, dword [esi + 0x220]
mov dword [ebx + ecx + 0x18], eax
mov ecx, esi
call fcn.1014629a
test eax, eax
je 0x10145d9f
mov edx, dword [ebp + 0xc]
mov ecx, edi
call fcn.10145658
mov dword [ebp - 8], eax
test eax, eax
je 0x10145d52
xor eax, eax
mov edx, eax
mov ecx, eax
cmp dword [esi + 0x230], eax
je 0x10145ce8
mov eax, dword [esi + 0x21c]
mov edi, dword [esi + 0x22c]
movzx eax, word [ebx + eax + 8]
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0x230]
mov ebx, dword [ebp - 0x10]
cmp word [edi + ecx*8], bx
jne 0x10145cdd
mov edx, dword [edi + ecx*8 + 4]
inc ecx
cmp ecx, eax
jb 0x10145cd3
mov edi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x18]
mov eax, dword [esi + 0x21c]
test edx, edx
jne 0x10145d4c
mov edx, dword [esi + 0x230]
mov ecx, dword [esi + 0x22c]
mov ax, word [eax + ebx + 8]
mov word [ecx + edx*8], ax
mov edx, dword [esi + 0x230]
mov ecx, dword [esi + 0x22c]
mov eax, dword [esi + 0x220]
mov dword [ecx + edx*8 + 4], eax
mov ecx, dword [esi + 0x21c]
inc dword [esi + 0x230]
mov eax, dword [esi + 0x220]
mov edx, dword [ebp - 8]
mov dword [ebx + ecx + 0x1c], eax
mov ecx, esi
call fcn.1014629a
test eax, eax
je 0x10145d9f
mov eax, dword [esi + 0x218]
inc dword [eax + 0x10]
jmp 0x10145d5e
mov dword [eax + ebx + 0x1c], edx
jmp 0x10145d5e
mov eax, dword [esi + 0x21c]
xor ecx, ecx
mov dword [ebx + eax + 0x1c], ecx
mov edx, dword [ebp + 0xc]
mov ecx, edi
call fcn.101456a4
mov edx, dword [esi + 0x21c]
test eax, eax
je 0x10145d94
mov ecx, dword [esi + 0x220]
mov dword [edx + ebx + 0x20], ecx
mov edx, eax
mov ecx, esi
call fcn.1014629a
test eax, eax
je 0x10145d9f
mov eax, dword [esi + 0x218]
inc dword [eax + 0x14]
jmp 0x10145d9a
xor eax, eax
mov dword [edx + ebx + 0x20], eax
xor eax, eax
inc eax
jmp 0x10145da1
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 8