Function at 0x406ee0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
push ebx
mov eax, 0x121c
call fcn.00497d00
mov eax, dword [0x52cfb4]
xor eax, esp
mov dword [esp + 0x120c], eax
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
cmp dword [0x5410e8], 0
je 0x406ff7
cmp dword [0x52ef34], 0
je 0x406ff7
cmp edx, 1
je 0x40711a
test ecx, ecx
jle 0x4070d7
mov edx, ecx
shr edx, 1
je 0x40710f
mov dword [esp], edx
xor eax, eax
mov dword [esp + 4], esi
mov dword [esp + 8], edi
nop word [eax + eax]
mov esi, dword [ebp + 0xc]
movzx edx, word [esi + eax*4]
mov ebx, edx
movzx ecx, word [esi + eax*4 + 0x900]
shr ebx, 8
mov byte [esp + eax*8 + 0xc], bl
mov ebx, ecx
mov byte [esp + eax*8 + 0xd], dl
movzx edx, word [esi + eax*4 + 2]
mov byte [esp + eax*8 + 0xf], cl
shr ebx, 8
movzx ecx, word [esi + eax*4 + 0x902]
mov byte [esp + eax*8 + 0xe], bl
mov ebx, edx
mov byte [esp + eax*8 + 0x11], dl
mov edx, ecx
shr ebx, 8
shr edx, 8
mov byte [esp + eax*8 + 0x10], bl
mov byte [esp + eax*8 + 0x12], dl
mov byte [esp + eax*8 + 0x13], cl
inc eax
cmp eax, dword [esp]
jb 0x406f50
mov ecx, dword [ebp + 0x10]
lea edx, [eax*8]
mov esi, dword [esp + 4]
shl eax, 1
mov edi, dword [esp + 8]
cmp eax, ecx
jae 0x4070bf
mov ebx, dword [ebp + 0xc]
movzx ecx, word [ebx + eax*2]
movzx edx, word [ebx + eax*2 + 0x900]
mov ebx, ecx
mov byte [esp + eax*4 + 0xd], cl
mov ecx, edx
shr ebx, 8
shr ecx, 8
mov byte [esp + eax*4 + 0xc], bl
mov byte [esp + eax*4 + 0xe], cl
mov byte [esp + eax*4 + 0xf], dl
lea edx, [eax*4 + 4]
jmp 0x4070bf
cmp edx, 1
je 0x407261
test ecx, ecx
jle 0x4070d7
mov edx, ecx
shr edx, 1
je 0x407252
mov dword [esp + 4], esi
xor eax, eax
mov dword [esp], edx
mov dword [esp + 8], edi
mov esi, dword [ebp + 0xc]
nop dword [eax]
nop dword [eax]
movzx edx, word [esi + eax*4]
mov byte [esp + eax*8 + 0xc], dl
shr edx, 8
mov byte [esp + eax*8 + 0xd], dl
movzx ecx, word [esi + eax*4 + 0x900]
movzx edx, word [esi + eax*4 + 0x902]
movzx ebx, word [esi + eax*4 + 2]
mov byte [esp + eax*8 + 0xe], cl
shr ecx, 8
mov byte [esp + eax*8 + 0x10], bl
shr ebx, 8
mov byte [esp + eax*8 + 0x12], dl
shr edx, 8
mov byte [esp + eax*8 + 0xf], cl
mov byte [esp + eax*8 + 0x11], bl
mov byte [esp + eax*8 + 0x13], dl
inc eax
cmp eax, dword [esp]
jb 0x407030
mov ecx, dword [ebp + 0x10]
lea edx, [eax*8]
mov esi, dword [esp + 4]
shl eax, 1
mov edi, dword [esp + 8]
cmp eax, ecx
jae 0x4070bf
mov edx, dword [ebp + 0xc]
movzx ecx, word [edx + eax*2]
movzx ebx, word [edx + eax*2 + 0x900]
lea edx, [eax*4 + 4]
mov byte [esp + eax*4 + 0xc], cl
shr ecx, 8
mov byte [esp + eax*4 + 0xe], bl
shr ebx, 8
mov byte [esp + eax*4 + 0xd], cl
mov byte [esp + eax*4 + 0xf], bl
test edx, edx
jle 0x4070d7
mov eax, dword [ebp + 8]
lea ecx, [esp + 0xc]
push eax
push edx
push 1
push ecx
call fcn.0049c4ae
add esp, 0x10
cmp dword [0x52ef44], 1
je 0x407241
mov ecx, dword [esp + 0x120c]
mov dword [esp + 0x120c], 0
xor ecx, esp
cmp ecx, dword [0x52cfb4]
jne 0x40723c
add esp, 0x121c
pop ebx
mov esp, ebp
pop ebp
ret
test ecx, ecx
jbe 0x4070d7
xor eax, eax
jmp 0x406fc2
test ecx, ecx
jle 0x4070d7
cmp ecx, 0x10
jl 0x407230
mov edx, dword [ebp + 0xc]
and edx, 0xf
je 0x40713f
test dl, 1
jne 0x407230
neg edx
add edx, 0x10
shr edx, 1
lea eax, [edx + 0x10]
cmp ecx, eax
jl 0x407230
mov eax, ecx
sub eax, edx
and eax, 0xf
neg eax
add eax, ecx
test edx, edx
jbe 0x407189
xor ebx, ebx
mov dword [esp + 8], edi
mov dword [esp + 4], esi
mov esi, ebx
mov edi, dword [ebp + 0xc]
movzx ebx, word [edi + esi*2]
mov ecx, ebx
shr ecx, 8
mov byte [esp + esi*2 + 0xc], cl
mov byte [esp + esi*2 + 0xd], bl
inc esi
cmp esi, edx
jb 0x407168
mov ecx, dword [ebp + 0x10]
mov esi, dword [esp + 4]
mov edi, dword [esp + 8]
movdqu xmm0, xmmword [0x4b4480]
mov ebx, dword [ebp + 0xc]
nop dword [eax + eax]
nop dword [eax]
movdqu xmm3, xmmword [ebx + edx*2]
movdqu xmm2, xmmword [ebx + edx*2 + 0x10]
movdqa xmm5, xmm3
movdqa xmm1, xmm2
psraw xmm5, 8
psraw xmm1, 8
pand xmm5, xmm0
pand xmm1, xmm0
pand xmm3, xmm0
packuswb xmm5, xmm1
pand xmm2, xmm0
packuswb xmm3, xmm2
movdqa xmm4, xmm5
punpcklbw xmm4, xmm3
punpckhbw xmm5, xmm3
movdqu xmmword [esp + edx*2 + 0xc], xmm4
movdqu xmmword [esp + edx*2 + 0x1c], xmm5
add edx, 0x10
cmp edx, eax
jb 0x4071a0
add edx, edx
lea ebx, [eax + eax]
neg ebx
add ebx, edx
sub edx, ebx
cmp eax, ecx
jae 0x4070bf
mov dword [esp + 8], edi
mov edi, dword [ebp + 0xc]
movzx edx, word [edi + eax*2]
mov ebx, edx
shr ebx, 8
mov byte [esp + eax*2 + 0xc], bl
mov byte [esp + eax*2 + 0xd], dl
inc eax
cmp eax, ecx
jb 0x40720e
mov edi, dword [esp + 8]
lea edx, [eax + eax]
jmp 0x4070bf
test ecx, ecx
jbe 0x4070d7
xor eax, eax
jmp 0x407207
call fcn.00497ce0
mov eax, dword [ebp + 8]
push eax
call fcn.0049bee5
add esp, 4
jmp 0x4070e4
test ecx, ecx
jbe 0x4070d7
xor eax, eax
jmp 0x407093
test ecx, ecx
jle 0x4070d7
cmp ecx, 0x10
jl 0x407366
mov edx, dword [ebp + 0xc]
and edx, 0xf
je 0x40728a
test dl, 1
jne 0x407366
neg edx
add edx, 0x10
shr edx, 1
lea eax, [edx + 0x10]
cmp ecx, eax
jl 0x407366
mov eax, ecx
sub eax, edx
and eax, 0xf
neg eax
add eax, ecx
test edx, edx
jbe 0x4072d1
mov dword [esp + 8], edi
xor ebx, ebx
mov dword [esp + 4], esi
mov esi, ecx
mov edi, dword [ebp + 0xc]
movzx ecx, word [edi + ebx*2]
mov byte [esp + ebx*2 + 0xc], cl
shr ecx, 8
mov byte [esp + ebx*2 + 0xd], cl
inc ebx
cmp ebx, edx
jb 0x4072b3
mov edi, dword [esp + 8]
mov ecx, esi
mov esi, dword [esp + 4]
movdqu xmm0, xmmword [0x4b4480]
mov ebx, dword [ebp + 0xc]
nop dword [eax]
movdqu xmm3, xmmword [ebx + edx*2]
movdqa xmm5, xmm0
movdqu xmm2, xmmword [ebx + edx*2 + 0x10]
movdqa xmm1, xmm0
pand xmm5, xmm3
pand xmm1, xmm2
psraw xmm3, 8
psraw xmm2, 8
packuswb xmm5, xmm1
pand xmm3, xmm0
pand xmm2, xmm0
movdqa xmm4, xmm5
packuswb xmm3, xmm2
punpcklbw xmm4, xmm3
punpckhbw xmm5, xmm3
movdqu xmmword [esp + edx*2 + 0xc], xmm4
movdqu xmmword [esp + edx*2 + 0x1c], xmm5
add edx, 0x10
cmp edx, eax
jb 0x4072e0
add edx, edx
lea ebx, [eax + eax]
neg ebx
add ebx, edx
sub edx, ebx
cmp eax, ecx
jae 0x4070bf
mov ebx, dword [ebp + 0xc]
movzx edx, word [ebx + eax*2]
mov byte [esp + eax*2 + 0xc], dl
shr edx, 8
mov byte [esp + eax*2 + 0xd], dl
inc eax
cmp eax, ecx
jb 0x40734a
lea edx, [eax + eax]
jmp 0x4070bf
test ecx, ecx
jbe 0x4070d7
xor eax, eax
jmp 0x407347