Function at 0x1012862f
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 0x10128956
mov eax, 0x666e7469
cmp dword [esi], eax
jne 0x10128956
test edi, edi
je 0x10128956
cmp dword [edi], eax
jne 0x10128956
test byte [esi + 0x224], 2
je 0x10128956
test byte [edi + 0x224], 1
je 0x10128956
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.101281c8
mov edx, eax
mov dword [ebp - 0xc], edx
test edx, edx
je 0x10128956
mov ecx, dword [esi + 0x21c]
mov eax, dword [esi + 0x220]
push 0
mov dword [ebx + ecx + 0x10], eax
lea eax, [ebp - 4]
push eax
push edx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [eax*2 + 2]
push eax
push dword [ebp - 0xc]
push dword [esi + 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10128956
mov eax, dword [ebp - 4]
add eax, 3
add eax, dword [esi + 0x220]
push 0
and eax, 0xfffffffc
push 0
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 - 0xc], eax
mov dword [esi + 0x220], eax
call fcn.10128206
mov ecx, dword [esi + 0x21c]
mov dword [ebp - 0x10], eax
test eax, eax
jne 0x1012879c
mov eax, dword [ebp - 8]
and dword [ecx + eax + 0x14], 0
jmp 0x101287fb
mov edx, dword [ebp - 0xc]
mov dword [ecx + ebx + 0x14], edx
lea ecx, [ebp - 4]
push 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [eax*2 + 2]
push eax
push dword [ebp - 0x10]
push dword [esi + 0x214]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10128956
mov eax, dword [ebp - 4]
add eax, 3
add eax, dword [esi + 0x220]
push 0
and eax, 0xfffffffc
push 0
push eax
push dword [esi + 0x214]
mov dword [esi + 0x220], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [esi + 0x220], eax
xor edx, edx
cmp dword [edi], 0x666e7469
jne 0x1012882f
test byte [edi + 0x224], 1
je 0x1012882f
mov eax, dword [edi + 0x218]
mov ecx, dword [ebp + 0xc]
cmp ecx, dword [eax + 0xc]
jae 0x1012882f
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.10128e11
test eax, eax
je 0x10128956
mov edx, dword [ebp + 0xc]
mov ecx, edi
call fcn.1012824c
mov dword [ebp - 0xc], eax
test eax, eax
je 0x1012890b
xor ecx, ecx
xor edx, edx
cmp dword [esi + 0x230], ecx
je 0x101288a1
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 0x10128896
mov edx, dword [edi + ecx*8 + 4]
inc ecx
cmp ecx, eax
jb 0x1012888c
mov edi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x18]
mov eax, dword [esi + 0x21c]
test edx, edx
jne 0x10128905
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 - 0xc]
mov dword [ebx + ecx + 0x1c], eax
mov ecx, esi
call fcn.10128e11
test eax, eax
je 0x10128956
mov eax, dword [esi + 0x218]
inc dword [eax + 0x10]
jmp 0x10128916
mov dword [eax + ebx + 0x1c], edx
jmp 0x10128916
mov eax, dword [esi + 0x21c]
and dword [ebx + eax + 0x1c], 0
mov edx, dword [ebp + 0xc]
mov ecx, edi
call fcn.10128292
mov edx, dword [esi + 0x21c]
test eax, eax
je 0x1012894c
mov ecx, dword [esi + 0x220]
mov dword [ebx + edx + 0x20], ecx
mov edx, eax
mov ecx, esi
call fcn.10128e11
test eax, eax
je 0x10128956
mov eax, dword [esi + 0x218]
inc dword [eax + 0x14]
jmp 0x10128951
and dword [ebx + edx + 0x20], 0
xor eax, eax
inc eax
jmp 0x10128958
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8