Function at 0x10125ecc
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 0x10126219
mov eax, 0x666e7469
cmp dword [esi], eax
jne 0x10126219
test edi, edi
je 0x10126219
cmp dword [edi], eax
jne 0x10126219
test byte [esi + 0x224], 2
je 0x10126219
test byte [edi + 0x224], 1
je 0x10126219
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.10125a72
mov dword [ebp - 0x10], eax
test eax, eax
je 0x10126219
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 0x10125fc4
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 0x10126219
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.10125ab0
mov ecx, dword [esi + 0x21c]
mov edx, eax
test edx, edx
jne 0x10126048
mov eax, dword [ebp - 8]
mov dword [ecx + eax + 0x14], edx
jmp 0x101260b8
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 0x10126057
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 0x10126219
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 0x101260ee
test byte [edi + 0x224], 1
je 0x101260ee
mov eax, dword [edi + 0x218]
mov ecx, dword [ebp + 0xc]
cmp ecx, dword [eax + 0xc]
jae 0x101260ee
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.10126702
test eax, eax
je 0x10126219
mov edx, dword [ebp + 0xc]
mov ecx, edi
call fcn.10125af6
mov dword [ebp - 8], eax
test eax, eax
je 0x101261cc
xor eax, eax
mov edx, eax
mov ecx, eax
cmp dword [esi + 0x230], eax
je 0x10126162
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 0x10126157
mov edx, dword [edi + ecx*8 + 4]
inc ecx
cmp ecx, eax
jb 0x1012614d
mov edi, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x18]
mov eax, dword [esi + 0x21c]
test edx, edx
jne 0x101261c6
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.10126702
test eax, eax
je 0x10126219
mov eax, dword [esi + 0x218]
inc dword [eax + 0x10]
jmp 0x101261d8
mov dword [eax + ebx + 0x1c], edx
jmp 0x101261d8
mov eax, dword [esi + 0x21c]
xor ecx, ecx
mov dword [ebx + eax + 0x1c], ecx
mov edx, dword [ebp + 0xc]
mov ecx, edi
call fcn.10125b3c
mov edx, dword [esi + 0x21c]
test eax, eax
je 0x1012620e
mov ecx, dword [esi + 0x220]
mov dword [ebx + edx + 0x20], ecx
mov edx, eax
mov ecx, esi
call fcn.10126702
test eax, eax
je 0x10126219
mov eax, dword [esi + 0x218]
inc dword [eax + 0x14]
jmp 0x10126214
xor eax, eax
mov dword [ebx + edx + 0x20], eax
xor eax, eax
inc eax
jmp 0x1012621b
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 8