Function at 0x406f20
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
push ebx
mov eax, 0x121c
call fcn.00466f60
mov eax, dword [0x4f6e34]
xor eax, esp
mov dword [esp + 0x120c], eax
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
cmp dword [0x514be8], 0
je 0x407037
cmp dword [0x4f8df4], 0
je 0x407037
cmp edx, 1
je 0x40715a
test ecx, ecx
jle 0x407117
mov edx, ecx
shr edx, 1
je 0x40714f
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 0x406f90
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 0x4070ff
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 0x4070ff
cmp edx, 1
je 0x4072a1
test ecx, ecx
jle 0x407117
mov edx, ecx
shr edx, 1
je 0x407292
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 0x407070
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 0x4070ff
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 0x407117
mov eax, dword [ebp + 8]
lea ecx, [esp + 0xc]
push eax
push edx
push 1
push ecx
call fcn.0046b769
add esp, 0x10
cmp dword [0x4f8e04], 1
je 0x407281
mov ecx, dword [esp + 0x120c]
mov dword [esp + 0x120c], 0
xor ecx, esp
cmp ecx, dword [0x4f6e34]
jne 0x40727c
add esp, 0x121c
pop ebx
mov esp, ebp
pop ebp
ret
test ecx, ecx
jbe 0x407117
xor eax, eax
jmp 0x407002
test ecx, ecx
jle 0x407117
cmp ecx, 0x10
jl 0x407270
mov edx, dword [ebp + 0xc]
and edx, 0xf
je 0x40717f
test dl, 1
jne 0x407270
neg edx
add edx, 0x10
shr edx, 1
lea eax, [edx + 0x10]
cmp ecx, eax
jl 0x407270
mov eax, ecx
sub eax, edx
and eax, 0xf
neg eax
add eax, ecx
test edx, edx
jbe 0x4071c9
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 0x4071a8
mov ecx, dword [ebp + 0x10]
mov esi, dword [esp + 4]
mov edi, dword [esp + 8]
movdqu xmm0, xmmword [0x483440]
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 0x4071e0
add edx, edx
lea ebx, [eax + eax]
neg ebx
add ebx, edx
sub edx, ebx
cmp eax, ecx
jae 0x4070ff
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 0x40724e
mov edi, dword [esp + 8]
lea edx, [eax + eax]
jmp 0x4070ff
test ecx, ecx
jbe 0x407117
xor eax, eax
jmp 0x407247
call fcn.00466f40
mov eax, dword [ebp + 8]
push eax
call fcn.0046b1a0
add esp, 4
jmp 0x407124
test ecx, ecx
jbe 0x407117
xor eax, eax
jmp 0x4070d3
test ecx, ecx
jle 0x407117
cmp ecx, 0x10
jl 0x4073a6
mov edx, dword [ebp + 0xc]
and edx, 0xf
je 0x4072ca
test dl, 1
jne 0x4073a6
neg edx
add edx, 0x10
shr edx, 1
lea eax, [edx + 0x10]
cmp ecx, eax
jl 0x4073a6
mov eax, ecx
sub eax, edx
and eax, 0xf
neg eax
add eax, ecx
test edx, edx
jbe 0x407311
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 0x4072f3
mov edi, dword [esp + 8]
mov ecx, esi
mov esi, dword [esp + 4]
movdqu xmm0, xmmword [0x483440]
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 0x407320
add edx, edx
lea ebx, [eax + eax]
neg ebx
add ebx, edx
sub edx, ebx
cmp eax, ecx
jae 0x4070ff
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 0x40738a
lea edx, [eax + eax]
jmp 0x4070ff
test ecx, ecx
jbe 0x407117
xor eax, eax
jmp 0x407387