Function at 0x408440
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408de0
mov esi, edx
mov edi, ecx
mov ebx, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408ea0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x14], esi
je 0x4084ee
mov ebp, edi
test ebx, ebx
jle 0x408cc0
xor eax, eax
cmp ebx, 1
je 0x4084c8
mov ecx, ebx
and ecx, 0xfffffffe
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + ebp]
add edx, 0x8f13
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x30]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x30]
add eax, 2
cmp ecx, eax
jne 0x4084b0
test bl, 1
je 0x408cc0
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, ebp
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x408cc0
lea eax, [esi + esi*8]
mov dword [esp + 0x2c], eax
shl eax, 6
test ebx, ebx
mov dword [esp + 0x10], edi
mov dword [esp + 0x20], eax
jle 0x4085e9
mov ebp, edi
cmp ebx, 1
jne 0x40883b
xor eax, eax
xor edi, edi
test bl, 1
mov ebx, edi
je 0x408544
mov ecx, dword [esp + 0x20]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408544
mov word [esp + ebx*4 + 0x4b4], cx
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408ea0
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x408600
xor eax, eax
cmp ebx, 1
je 0x4085bf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b4]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
add eax, 2
cmp ecx, eax
jne 0x408580
test bl, 1
je 0x4085e0
movzx eax, word [esp + eax*4 + 0x4b4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x934]
shr eax, 8
inc dword [esp + eax*4 + 0xd34]
mov eax, dword [esp + 0xd34]
jmp 0x408609
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408ea0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov esi, 2
sub esi, ecx
lea eax, [ebx - 1]
mov dword [esp + 0x18], eax
mov dword [esp + 8], ebx
and ebx, 0xfffffffe
mov dword [esp + 0x1c], ebx
lea eax, [esp + 0x4b4]
mov dword [esp], eax
lea eax, [esp + 0x1134]
xor edx, edx
lea ebp, [esp + 0x934]
xor ecx, ecx
mov dword [esp + 0x24], esi
jmp 0x408664
inc edx
add ecx, 8
add ebp, 0x400
mov eax, ebx
cmp edx, esi
je 0x408779
mov edi, dword [esp]
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov eax, 3
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0xa8], ebx
add ebx, dword [ebp + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], ebx
add ebx, dword [ebp + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], ebx
add ebx, dword [ebp + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], ebx
add ebx, dword [ebp + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x408680
cmp byte [esp + 7], 0
mov ebx, dword [esp + 0xc]
jne 0x408650
mov dword [esp + 0x28], edx
cmp dword [esp + 0x18], 0
je 0x408730
xor eax, eax
nop
nop
mov edx, dword [esp + 0xc]
movzx ebx, word [edx + eax*4]
shr ebx, cl
movzx ebx, bl
mov esi, dword [esp + ebx*4 + 0xb4]
lea edx, [esi + 1]
mov dword [esp + ebx*4 + 0xb4], edx
mov edx, dword [esp + 0xc]
mov edx, dword [edx + eax*4]
mov edi, dword [esp]
mov dword [edi + esi*4], edx
mov edx, dword [esp + 0xc]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov esi, dword [esp + edx*4 + 0xb4]
lea ebx, [esi + 1]
mov dword [esp + edx*4 + 0xb4], ebx
mov ebx, dword [esp + 0xc]
mov edx, dword [ebx + eax*4 + 4]
mov dword [edi + esi*4], edx
add eax, 2
cmp dword [esp + 0x1c], eax
jne 0x4086d0
jmp 0x408732
xor eax, eax
test byte [esp + 8], 1
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
je 0x408650
movzx edx, word [ebx + eax*4]
shr edx, cl
movzx edx, dl
mov esi, dword [esp + edx*4 + 0xb4]
lea ebx, [esi + 1]
mov dword [esp + edx*4 + 0xb4], ebx
mov ebx, dword [esp + 0xc]
mov eax, dword [ebx + eax*4]
mov edx, dword [esp]
mov dword [edx + esi*4], eax
mov esi, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
jmp 0x408650
cmp dword [esp + 8], 0
mov ebx, dword [esp + 0x10]
je 0x408b9b
mov ebx, dword [esp + 8]
cmp ebx, 1
jne 0x4087a2
mov eax, dword [esp]
mov word [eax], 1
mov ebx, dword [esp + 0x10]
jmp 0x408a44
mov edi, dword [esp]
movzx eax, word [edi + 4]
add word [edi], ax
cmp ebx, 3
jl 0x408895
mov eax, 2
mov ebp, 2
sub ebp, ebx
xor edx, edx
mov esi, 1
jmp 0x4087f2
movzx ebx, word [ecx + edx*4]
add word [ecx + esi*4], bx
mov word [ecx + edx*4], si
inc edx
lea edi, [esi + ebp]
inc edi
inc esi
cmp edi, 1
mov ebx, dword [esp + 8]
mov edi, dword [esp]
je 0x4088a1
movzx ecx, word [edi + edx*4]
cmp eax, ebx
jge 0x408803
movzx ebx, word [edi + eax*4]
cmp cx, bx
jae 0x408810
mov word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
jmp 0x408815
inc eax
mov word [edi + esi*4], bx
mov ecx, edi
cmp eax, dword [esp + 8]
jge 0x4087d0
cmp edx, esi
jge 0x408830
movzx ebx, word [ecx + edx*4]
movzx edi, word [ecx + eax*4]
cmp bx, di
jb 0x4087d4
jmp 0x408834
movzx edi, word [ecx + eax*4]
inc eax
add word [ecx + esi*4], di
jmp 0x4087dd
mov ecx, ebx
and ecx, 0xfffffffe
lea edx, [eax + ebp]
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x40885b
add eax, 2
cmp ecx, eax
je 0x408517
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408876
mov word [esp + edi*4 + 0x4b4], si
mov word [esp + edi*4 + 0x4b6], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x408850
mov word [esp + edi*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4b6], si
inc edi
jmp 0x408850
mov word [edi + ebx*4 - 8], 0
jmp 0x408921
lea edx, [ebx - 2]
mov word [edi + ebx*4 - 8], 0
lea ecx, [ebx - 3]
mov eax, ecx
and edx, 3
je 0x4088d1
mov eax, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [edi + eax*4]
movzx esi, word [edi + esi*4]
inc esi
mov word [edi + eax*4], si
dec eax
dec edx
jne 0x4088c0
cmp ecx, 3
jb 0x408921
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + eax*4 - 4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 4], cx
movzx ecx, word [edi + eax*4 - 8]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 8], cx
movzx ecx, word [edi + eax*4 - 0xc]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 0xc], cx
movzx ecx, word [edi + eax*4 - 0x10]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x4088e0
mov eax, ebx
xor eax, 0xfffffffd
mov ecx, ebx
and ecx, 0xfffffffd
lea ecx, [eax + ecx*2]
inc ecx
mov ebx, 1
xor edx, edx
mov eax, dword [esp + 0x18]
jmp 0x408966
mov esi, ebp
and esi, 2
mov edi, ebp
or ebp, 2
imul ebp, esi
xor esi, 2
and edi, 0x7ffffffd
imul edi, esi
add ebp, edi
inc edx
mov ebx, ebp
test ebp, ebp
jle 0x408a35
test ecx, ecx
js 0x4089a0
lea ebp, [ecx + 1]
xor esi, esi
mov edi, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [edi + ecx*4]
cmp edx, edi
jne 0x4089b0
inc esi
dec ecx
cmp ebp, esi
mov edi, dword [esp]
jne 0x408980
mov ecx, 0xffffffff
jmp 0x4089b5
xor ebp, ebp
jmp 0x4089b2
mov ebp, esi
mov edi, dword [esp]
mov esi, ebx
sub esi, ebp
jle 0x408940
mov dword [esp + 0xc], ebp
not ebp
add ebp, ebx
and esi, 3
je 0x4089f2
mov dword [esp + 0x1c], ebp
lea edi, [ebx + 2]
nop
mov ebp, ebx
mov ebx, dword [esp]
mov word [ebx + eax*4], dx
dec eax
mov ebx, ebp
not ebx
lea ebx, [ebx + ebp*2]
dec edi
dec esi
jne 0x4089d0
add ebp, ebp
sub ebp, edi
mov ebx, ebp
mov edi, dword [esp]
mov ebp, dword [esp + 0x1c]
cmp ebp, 3
mov ebp, dword [esp + 0xc]
jb 0x408940
lea esi, [ebx + ebx]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi + eax*4], dx
mov word [edi + eax*4 - 4], dx
mov word [edi + eax*4 - 8], dx
mov word [edi + eax*4 - 0xc], dx
add eax, 0xfffffffc
add ebx, 0xfffffffc
add esi, 0xfffffff8
cmp ebx, ebp
jg 0x408a10
jmp 0x408940
cmp dword [esp + 8], 0
mov ebx, dword [esp + 0x10]
jle 0x408b9b
mov eax, dword [esp + 8]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x18], 3
mov edi, dword [esp]
jb 0x408a8a
mov edx, dword [esp + 8]
and edx, 0xfffffffc
xor ecx, ecx
movzx esi, word [edi + ecx*4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x30]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x30]
add ecx, 4
cmp edx, ecx
jne 0x408a60
test eax, eax
je 0x408aad
mov edx, dword [esp]
lea ecx, [edx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x30]
inc edx
cmp eax, edx
jne 0x408aa0
cmp dword [esp + 8], 2
jl 0x408b9b
mov edx, dword [esp + 0x15cc]
cmp edx, 0x20
jge 0x408b2c
mov eax, dword [esp + edx*4 + 0x30]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x408aec
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
inc ecx
mov dword [esp + esi*4 + 0x30], eax
dec edx
jne 0x408ae0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408b28
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + edx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + edx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x3c]
mov dword [esp + edx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x40]
add ecx, 4
mov dword [esp + edx*4 + 0x30], eax
cmp ecx, 0x20
jne 0x408b00
test edx, edx
jle 0x408b5f
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x2c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408b40
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
jmp 0x408b6c
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x408b70
cmp eax, edx
je 0x408b9b
mov ecx, dword [esp + 0x15cc]
dec dword [esp + ecx*4 + 0x30]
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408b98
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x408b80
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec eax
jmp 0x408b6c
mov esi, dword [esp + 0x2c]
shl esi, 5
lea eax, [ebx + esi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408ea0
add esp, 0xc
mov eax, dword [esp + 0x20]
mov ebp, ebx
add eax, ebx
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408ea0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x408cb9
add dword [esp], 0xfffffffe
mov eax, 1
jmp 0x408c0e
mov ebx, dword [esp + 8]
mov ebp, dword [esp + 0x10]
mov dword [esp + 8], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
je 0x408cb9
mov edi, dword [esp + eax*4 + 0x30]
test edi, edi
jle 0x408bf0
mov edx, edi
and edx, 3
je 0x408c60
mov dword [esp + 0xc], edi
mov ecx, esi
mov esi, dword [esp + 8]
mov edi, dword [esp]
lea edi, [edi + esi*4]
xor esi, esi
nop
movzx ebx, word [edi]
mov ebp, dword [esp + 0x10]
add ebp, ecx
mov byte [ebx + ebp + 0x8f12], al
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x408c30
mov edi, dword [esp + 0xc]
mov edx, edi
sub edx, esi
sub dword [esp + 8], esi
mov esi, ecx
jmp 0x408c62
mov edx, edi
cmp edi, 4
mov ebx, dword [esp + 8]
mov edi, dword [esp]
jb 0x408bf4
dec edx
nop
movzx ecx, word [edi + ebx*4]
mov ebp, esi
mov esi, dword [esp + 0x10]
add esi, ebp
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebx*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
mov esi, ebp
add ebx, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408c70
jmp 0x408bf4
mov ebx, dword [esp + 0x15c8]
mov dword [esp + 0x938], 0
cmp dword [esp + 0x15cc], 2
jl 0x408d01
xor eax, eax
mov ecx, 2
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
add eax, eax
mov dword [esp + ecx*4 + 0x934], eax
mov edx, ecx
and edx, 1
xor ecx, 1
lea ecx, [ecx + edx*2]
cmp ecx, dword [esp + 0x15cc]
jle 0x408ce0
test ebx, ebx
jle 0x408dd2
xor eax, eax
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, ebp
shl ecx, 6
add ecx, ebp
mov dword [esp + 0xc], ecx
jmp 0x408d4c
mov ecx, dword [esp + 0xc]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c8]
inc eax
cmp eax, ebx
je 0x408dd2
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408d43
mov ebp, dword [esp + ecx*4 + 0x934]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x934], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x408daf
and ecx, 0xfffffffc
xor ebx, ebx
nop
nop
nop
nop
nop
nop
mov esi, ebp
and esi, 1
shl esi, 2
lea esi, [esi + ebx*8]
mov ebx, ebp
and ebx, 2
or ebx, esi
mov esi, ebp
shr esi, 2
and esi, 1
or esi, ebx
mov ebx, ebp
shr ebx, 3
and ebx, 1
lea ebx, [ebx + esi*2]
shr ebp, 4
add ecx, 0xfffffffc
jne 0x408d80
test edi, edi
je 0x408d30
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, ebp
and ecx, 1
lea ebx, [ecx + ebx*2]
shr ebp, 1
dec edi
jne 0x408dc0
jmp 0x408d30
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret