Function at 0x403eac
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff0
push esi
push edi
push ebx
sub esp, 0x64
mov ebx, edx
mov edi, dword [0x587700]
lea edx, [esp + 0x60]
mov dword [esp + 0x24], ecx
lea ecx, [esp + 0x30]
mov dword [esp + 0x20], edi
mov dword [esp + 0x30], 0
mov dword [esp + 0x60], 0x58b728
push 0x20
push edx
push 0x559510
push 0x8384ff01
mov edi, dword [eax]
push edi
push ecx
mov esi, dword [0x5876c4]
call fcn.004e7090
add esp, 0x18
test eax, eax
jne 0x403f68
mov dword [esp + 0x58], 0x58b734
lea eax, [esp + 0x58]
push eax
push 0x559518
lea edx, [esp + 0x38]
push edx
call fcn.004e8930
add esp, 0xc
test eax, eax
jne 0x403f68
mov dword [esp + 0x50], 0x58b744
lea eax, [esp + 0x50]
push eax
push 0x559520
lea edx, [esp + 0x38]
push edx
call fcn.004e8930
add esp, 0xc
test eax, eax
jne 0x403f68
mov dword [esp + 0x28], 0x58b748
lea eax, [esp + 0x28]
push eax
push 0x559528
lea edx, [esp + 0x38]
push edx
call fcn.004e8930
add esp, 0xc
test eax, eax
jle 0x403f7e
mov dword [ebx], 0xffffffeb
add esp, 0x64
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [0x58b734]
cmp eax, dword [0x5876c4]
jg 0x403f9c
test eax, eax
jle 0x403f9c
mov eax, dword [0x58b744]
cmp eax, dword [0x587700]
jle 0x403fae
mov dword [ebx], 0xffffffea
add esp, 0x64
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0x10
test eax, eax
jle 0x403f9c
xor eax, eax
test esi, esi
mov ecx, dword [esp + 0x24]
cmovle esi, eax
mov dword [esp + 0x30], eax
lea eax, [esp + 0x18]
mov dword [esp + 0x1c], ecx
lea edx, [esi*4]
mov dword [esp + 0x18], edx
push 0x20
push eax
push 0x559530
push 0x8384ff01
push edi
lea edx, [esp + 0x44]
push edx
call fcn.004e7090
add esp, 0x18
test eax, eax
jg 0x403f6c
mov ecx, dword [esp + 0x20]
xor edx, edx
test ecx, ecx
cmovle ecx, edx
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x30], edx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x14], eax
lea edx, [ecx*4]
mov dword [esp + 0x10], edx
lea eax, [esp + 0x10]
push 0x20
push eax
push 0x559538
push 0x8384ff01
push edi
lea edi, [esp + 0x44]
push edi
call fcn.004e7090
add esp, 0x18
test eax, eax
jg 0x403f6c
test esi, esi
jle 0x40420c
mov edi, dword [esp + 0x24]
and edi, 0xf
je 0x404068
test edi, 3
jne 0x40479a
neg edi
add edi, 0x10
shr edi, 2
lea eax, [edi + 4]
cmp esi, eax
jl 0x40479a
mov eax, esi
mov ecx, 0x80000000
sub eax, edi
and eax, 3
neg eax
add eax, esi
test edi, edi
jbe 0x4040a2
mov dword [esp + 8], ebx
xor edx, edx
mov ebx, dword [esp + 0x24]
cmp ecx, dword [ebx + edx*4]
jg 0x404099
mov ecx, dword [ebx + edx*4]
inc edx
cmp edx, edi
jb 0x404091
mov ebx, dword [esp + 8]
movd xmm0, ecx
pshufd xmm0, xmm0, 0
mov edx, dword [esp + 0x24]
movdqa xmm1, xmmword [edx + edi*4]
add edi, 4
movdqa xmm2, xmm1
pxor xmm1, xmm0
pcmpgtd xmm2, xmm0
cmp edi, eax
pand xmm2, xmm1
pxor xmm0, xmm2
jb 0x4040af
movdqa xmm1, xmm0
movdqa xmm2, xmm0
psrldq xmm1, 8
pcmpgtd xmm2, xmm1
pxor xmm0, xmm1
pand xmm2, xmm0
pxor xmm2, xmm1
movdqa xmm0, xmm2
movdqa xmm3, xmm2
psrldq xmm0, 4
pcmpgtd xmm3, xmm0
pxor xmm2, xmm0
pand xmm3, xmm2
pxor xmm3, xmm0
movd edx, xmm3
cmp eax, esi
jae 0x404122
mov ecx, dword [esp + 0x24]
cmp edx, dword [ecx + eax*4]
jg 0x40411d
mov edx, dword [ecx + eax*4]
inc eax
cmp eax, esi
jb 0x404115
mov ecx, dword [esp + 0x24]
and ecx, 0xf
je 0x40413c
test cl, 3
jne 0x40478e
neg ecx
add ecx, 0x10
shr ecx, 2
lea eax, [ecx + 4]
cmp esi, eax
jl 0x40478e
mov eax, esi
mov edi, 0x7fffffff
sub eax, ecx
and eax, 3
neg eax
add eax, esi
test ecx, ecx
jbe 0x404186
mov dword [esp + 4], 0
mov dword [esp], esi
mov dword [esp + 8], ebx
mov ebx, dword [esp + 4]
mov esi, dword [esp + 0x24]
cmp edi, dword [esi + ebx*4]
jle 0x40417a
mov edi, dword [esi + ebx*4]
inc ebx
cmp ebx, ecx
jb 0x404172
mov esi, dword [esp]
mov ebx, dword [esp + 8]
movd xmm0, edi
pshufd xmm0, xmm0, 0
mov edi, dword [esp + 0x24]
movdqa xmm1, xmmword [edi + ecx*4]
add ecx, 4
movdqa xmm2, xmm1
cmp ecx, eax
pcmpgtd xmm2, xmm0
pxor xmm0, xmm1
pand xmm2, xmm0
movdqa xmm0, xmm1
pxor xmm0, xmm2
jb 0x404193
movdqa xmm1, xmm0
movdqa xmm2, xmm0
psrldq xmm1, 8
pcmpgtd xmm2, xmm1
pxor xmm1, xmm0
pand xmm2, xmm1
pxor xmm2, xmm0
movdqa xmm0, xmm2
movdqa xmm3, xmm2
psrldq xmm0, 4
pcmpgtd xmm3, xmm0
pxor xmm0, xmm2
pand xmm3, xmm0
pxor xmm3, xmm2
movd ecx, xmm3
cmp eax, esi
jae 0x404216
mov edi, dword [esp + 0x24]
cmp ecx, dword [edi + eax*4]
jle 0x404205
mov ecx, dword [edi + eax*4]
inc eax
cmp eax, esi
jb 0x4041fd
jmp 0x404216
mov edx, 0x80000000
mov ecx, 0x7fffffff
mov eax, dword [0x58b734]
cmp edx, eax
mov dword [esp + 0xc], eax
jg 0x403f9c
neg eax
cmp ecx, eax
jl 0x403f9c
cmp dword [esp + 0x20], 0
jle 0x4043f5
mov edx, dword [ebp + 0x14]
and edx, 0xf
je 0x404255
test dl, 3
jne 0x4047a6
neg edx
add edx, 0x10
shr edx, 2
lea eax, [edx + 4]
cmp eax, dword [esp + 0x20]
jg 0x4047a6
mov eax, dword [esp + 0x20]
mov ecx, eax
sub ecx, edx
and ecx, 3
neg ecx
add ecx, eax
mov eax, 0x80000000
test edx, edx
jbe 0x40428c
mov edi, dword [ebp + 0x14]
xor esi, esi
cmp eax, dword [edi + esi*4]
jg 0x404287
mov eax, dword [edi + esi*4]
inc esi
cmp esi, edx
jb 0x40427f
movd xmm0, eax
pshufd xmm0, xmm0, 0
mov eax, dword [ebp + 0x14]
movdqa xmm1, xmmword [eax + edx*4]
add edx, 4
movdqa xmm2, xmm1
pxor xmm1, xmm0
pcmpgtd xmm2, xmm0
cmp edx, ecx
pand xmm2, xmm1
pxor xmm0, xmm2
jb 0x404298
movdqa xmm1, xmm0
movdqa xmm2, xmm0
psrldq xmm1, 8
pcmpgtd xmm2, xmm1
pxor xmm0, xmm1
pand xmm2, xmm0
pxor xmm2, xmm1
movdqa xmm0, xmm2
movdqa xmm3, xmm2
psrldq xmm0, 4
pcmpgtd xmm3, xmm0
pxor xmm2, xmm0
pand xmm3, xmm2
pxor xmm3, xmm0
movd eax, xmm3
cmp ecx, dword [esp + 0x20]
jae 0x404310
mov edx, dword [esp + 0x20]
mov esi, dword [ebp + 0x14]
cmp eax, dword [esi + ecx*4]
jg 0x40430b
mov eax, dword [esi + ecx*4]
inc ecx
cmp ecx, edx
jb 0x404303
mov edi, dword [ebp + 0x14]
and edi, 0xf
je 0x40432c
test edi, 3
jne 0x4047b2
neg edi
add edi, 0x10
shr edi, 2
lea edx, [edi + 4]
cmp edx, dword [esp + 0x20]
jg 0x4047b2
mov ecx, dword [esp + 0x20]
mov edx, ecx
sub edx, edi
mov esi, 0x7fffffff
and edx, 3
neg edx
add edx, ecx
test edi, edi
jbe 0x40436b
mov dword [esp + 8], ebx
xor ecx, ecx
mov ebx, dword [ebp + 0x14]
cmp esi, dword [ebx + ecx*4]
jle 0x404362
mov esi, dword [ebx + ecx*4]
inc ecx
cmp ecx, edi
jb 0x40435a
mov ebx, dword [esp + 8]
movd xmm0, esi
pshufd xmm0, xmm0, 0
mov ecx, dword [ebp + 0x14]
movdqa xmm1, xmmword [ecx + edi*4]
add edi, 4
movdqa xmm2, xmm1
cmp edi, edx
pcmpgtd xmm2, xmm0
pxor xmm0, xmm1
pand xmm2, xmm0
movdqa xmm0, xmm1
pxor xmm0, xmm2
jb 0x404377
movdqa xmm1, xmm0
movdqa xmm2, xmm0
psrldq xmm1, 8
pcmpgtd xmm2, xmm1
pxor xmm1, xmm0
pand xmm2, xmm1
pxor xmm2, xmm0
movdqa xmm0, xmm2
movdqa xmm3, xmm2
psrldq xmm0, 4
pcmpgtd xmm3, xmm0
pxor xmm0, xmm2
pand xmm3, xmm0
pxor xmm3, xmm2
movd ecx, xmm3
cmp edx, dword [esp + 0x20]
jae 0x4043ff
mov esi, dword [esp + 0x20]
mov edi, dword [ebp + 0x14]
cmp ecx, dword [edi + edx*4]
jle 0x4043ee
mov ecx, dword [edi + edx*4]
inc edx
cmp edx, esi
jb 0x4043e6
jmp 0x4043ff
mov eax, 0x80000000
mov ecx, 0x7fffffff
cmp eax, 1
jg 0x403f9c
test ecx, ecx
jl 0x403f9c
mov eax, dword [0x587700]
test eax, eax
jle 0x404637
mov edx, 0x587a60
and edx, 0xf
mov ecx, edx
neg ecx
add ecx, 0x10
shr ecx, 2
test edx, edx
cmovne edx, ecx
lea esi, [edx + 4]
cmp eax, esi
jl 0x404764
mov ecx, eax
xor esi, esi
sub ecx, edx
xor edi, edi
and ecx, 3
neg ecx
add ecx, eax
mov dword [esp], ecx
test edx, edx
jbe 0x404499
mov dword [esp + 8], ebx
xor ecx, ecx
mov dword [esp + 0x20], edx
mov dword [esp + 4], eax
mov ebx, dword [ebp + 0x14]
cmp dword [ebx + ecx*4], 0
jle 0x4047be
mov eax, dword [ecx*4 + 0x587a60]
inc esi
cdq
xor eax, edx
sub eax, edx
mov dword [ecx*4 + 0x587a60], eax
add edi, eax
inc ecx
cmp ecx, dword [esp + 0x20]
jb 0x404466
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 4]
mov ebx, dword [esp + 8]
mov ecx, dword [ebp + 0x14]
movd xmm2, esi
movd xmm3, edi
lea esi, [ecx + edx*4]
test esi, 0xf
je 0x404538
mov ecx, dword [esp]
mov esi, dword [ebp + 0x14]
movdqu xmm1, xmmword [esi + edx*4]
movdqa xmm6, xmmword [edx*4 + 0x587a60]
pxor xmm5, xmm5
pxor xmm4, xmm4
pcmpgtd xmm5, xmm6
movdqa xmm0, xmm6
pcmpgtd xmm1, xmm4
pxor xmm0, xmm5
movdqa xmm7, xmm1
psubd xmm0, xmm5
pandn xmm7, xmm6
pand xmm0, xmm1
psubd xmm2, xmm1
por xmm0, xmm7
pxor xmm4, xmm4
pcmpgtd xmm4, xmm0
movdqa xmm6, xmm0
pxor xmm0, xmm4
pxor xmm5, xmm5
psubd xmm0, xmm4
pand xmm6, xmm1
psubd xmm5, xmm0
paddd xmm3, xmm6
pandn xmm1, xmm5
por xmm6, xmm1
movdqa xmmword [edx*4 + 0x587a60], xmm6
add edx, 4
cmp edx, ecx
jb 0x4044b9
jmp 0x4045b8
mov ecx, dword [esp]
mov esi, dword [ebp + 0x14]
movdqa xmm6, xmmword [edx*4 + 0x587a60]
pxor xmm5, xmm5
pxor xmm4, xmm4
movdqa xmm1, xmmword [esi + edx*4]
pcmpgtd xmm5, xmm6
movdqa xmm0, xmm6
pcmpgtd xmm1, xmm4
pxor xmm0, xmm5
movdqa xmm7, xmm1
psubd xmm0, xmm5
pandn xmm7, xmm6
pand xmm0, xmm1
psubd xmm2, xmm1
por xmm0, xmm7
pxor xmm4, xmm4
pcmpgtd xmm4, xmm0
movdqa xmm6, xmm0
pxor xmm0, xmm4
pxor xmm5, xmm5
psubd xmm0, xmm4
pand xmm6, xmm1
psubd xmm5, xmm0
paddd xmm3, xmm6
pandn xmm1, xmm5
por xmm6, xmm1
movdqa xmmword [edx*4 + 0x587a60], xmm6
add edx, 4
cmp edx, ecx
jb 0x40453e
mov dword [esp], ecx
movdqa xmm0, xmm3
psrldq xmm0, 8
paddd xmm3, xmm0
movdqa xmm1, xmm3
psrldq xmm1, 4
paddd xmm3, xmm1
movd ecx, xmm3
movdqa xmm3, xmm2
psrldq xmm3, 8
paddd xmm2, xmm3
movdqa xmm4, xmm2
psrldq xmm4, 4
paddd xmm2, xmm4
movd esi, xmm2
cmp eax, dword [esp]
jbe 0x40463b
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov edi, dword [esp]
mov ebx, dword [ebp + 0x14]
cmp dword [ebx + edi*4], 0
jle 0x404776
mov eax, dword [edi*4 + 0x587a60]
inc esi
cdq
xor eax, edx
sub eax, edx
mov dword [edi*4 + 0x587a60], eax
add ecx, eax
inc edi
cmp edi, dword [esp + 4]
jb 0x40460a
mov ebx, dword [esp + 8]
jmp 0x40463b
xor esi, esi
xor ecx, ecx
cmp esi, dword [0x58b744]
jne 0x403f9c
cmp ecx, dword [0x58b748]
jne 0x403f9c
mov eax, dword [0x5876c4]
test eax, eax
mov dword [esp + 4], eax
jle 0x404753
mov edi, dword [esp + 0x24]
and edi, 0xf
je 0x404681
test edi, 3
jne 0x404770
neg edi
add edi, 0x10
shr edi, 2
lea eax, [edi + 8]
cmp eax, dword [esp + 4]
jg 0x404770
mov edx, dword [esp + 4]
mov eax, edx
sub eax, edi
xor esi, esi
and eax, 7
neg eax
add eax, edx
test edi, edi
jbe 0x4046cb
mov dword [esp + 8], ebx
xor ecx, ecx
mov dword [esp], eax
mov edx, 1
mov ebx, dword [esp + 0x24]
mov eax, dword [ebx + ecx*4]
test eax, eax
cmovne eax, edx
inc ecx
add esi, eax
cmp ecx, edi
jb 0x4046b5
mov eax, dword [esp]
mov ebx, dword [esp + 8]
movdqa xmm0, xmmword [0x559540]
movd xmm2, esi
mov edx, dword [esp + 0x24]
pxor xmm1, xmm1
movdqa xmm3, xmmword [edx + edi*4]
movdqa xmm4, xmmword [edx + edi*4 + 0x10]
pcmpeqd xmm3, xmm1
pandn xmm3, xmm0
pcmpeqd xmm4, xmm1
add edi, 8
paddd xmm2, xmm3
pandn xmm4, xmm0
cmp edi, eax
paddd xmm2, xmm4
jb 0x4046df
movdqa xmm0, xmm2
psrldq xmm0, 8
paddd xmm2, xmm0
movdqa xmm1, xmm2
psrldq xmm1, 4
paddd xmm2, xmm1
movd ecx, xmm2
cmp eax, dword [esp + 4]
jae 0x404755
mov dword [esp + 8], ebx
mov edx, 1
mov esi, dword [esp + 4]
mov edi, dword [esp + 0x24]
mov ebx, dword [edi + eax*4]
test ebx, ebx
cmovne ebx, edx
inc eax
add ecx, ebx
cmp eax, esi
jb 0x40473e
mov ebx, dword [esp + 8]
jmp 0x404755
xor ecx, ecx
cmp ecx, dword [esp + 0xc]
jne 0x403f9c
jmp 0x403f72
xor esi, esi
xor ecx, ecx
mov dword [esp], ecx
jmp 0x4045f7
xor ecx, ecx
xor eax, eax
jmp 0x404727
mov eax, dword [edi*4 + 0x587a60]
cdq
xor eax, edx
sub edx, eax
mov dword [edi*4 + 0x587a60], edx
jmp 0x40462a
mov ecx, 0x7fffffff
xor eax, eax
jmp 0x4041f5
mov edx, 0x80000000
xor eax, eax
jmp 0x40410d
mov eax, 0x80000000
xor ecx, ecx
jmp 0x4042f6
mov ecx, 0x7fffffff
xor edx, edx
jmp 0x4043d9
mov eax, dword [ecx*4 + 0x587a60]
cdq
xor eax, edx
sub edx, eax
mov dword [ecx*4 + 0x587a60], edx
jmp 0x404486