Function at 0x4084e0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408f30
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408fe0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x14], ebx
je 0x40859c
test esi, esi
mov ecx, esi
jle 0x408d60
xor eax, eax
cmp ecx, 1
je 0x408568
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x14]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
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 0x408550
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408d60
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c8]
inc dword [esp + eax*4 + 0x30]
jmp 0x408d60
lea ebp, [ebx + ebx*8]
mov eax, ebp
shl eax, 6
test esi, esi
mov dword [esp + 0x10], edi
mov dword [esp + 0x24], eax
jle 0x408699
cmp esi, 1
jne 0x408bca
xor ebx, ebx
xor eax, eax
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x4085f3
mov ecx, dword [esp + 0x24]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4085f3
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.00408fe0
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xb]
je 0x4086b0
mov ecx, ebx
xor eax, eax
cmp ebx, 1
je 0x40866f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
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 0x408630
test bl, 1
je 0x408690
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 0x4086b9
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408fe0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov edi, 2
sub edi, ecx
lea eax, [ebx - 1]
mov dword [esp + 0x18], eax
mov edx, ebx
and edx, 0xfffffffe
lea eax, [esp + 0x4b4]
mov dword [esp], eax
lea eax, [esp + 0x1134]
xor ecx, ecx
lea esi, [esp + 0x934]
mov dword [esp + 0x2c], 0
mov dword [esp + 0x1c], ebp
mov dword [esp + 0xc], ebx
mov dword [esp + 0x28], edi
mov dword [esp + 0x20], edx
jmp 0x40872e
mov ebx, dword [esp + 0x2c]
inc ebx
add ecx, 8
add esi, 0x400
mov eax, dword [esp + 4]
mov dword [esp + 0x2c], ebx
cmp ebx, edi
je 0x408835
mov edx, dword [esp]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, 3
xor edx, edx
nop
mov dword [esp + eax*4 + 0xa8], edx
add edx, dword [esi + eax*4 - 0xc]
mov dword [esp + eax*4 + 0xac], edx
add edx, dword [esi + eax*4 - 8]
mov dword [esp + eax*4 + 0xb0], edx
add edx, dword [esi + eax*4 - 4]
mov dword [esp + eax*4 + 0xb4], edx
add edx, dword [esi + eax*4]
add eax, 4
cmp eax, 0x103
jne 0x408740
cmp byte [esp + 0xb], 0
jne 0x408710
cmp dword [esp + 0x18], 0
je 0x4087ec
xor eax, eax
mov edi, dword [esp]
mov ebp, dword [esp + 4]
nop
nop
nop
nop
movzx edx, word [ebp + eax*4]
shr edx, cl
movzx edx, dl
mov ebp, dword [esp + edx*4 + 0xb4]
lea ebx, [ebp + 1]
mov dword [esp + edx*4 + 0xb4], ebx
mov edx, dword [esp + 4]
mov edx, dword [edx + eax*4]
mov dword [edi + ebp*4], edx
mov edx, dword [esp + 4]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov ebp, dword [esp + 4]
mov edx, dword [ebp + eax*4 + 4]
mov dword [edi + ebx*4], edx
mov edx, dword [esp + 0x20]
add eax, 2
cmp edx, eax
jne 0x408790
jmp 0x4087ee
xor eax, eax
test byte [esp + 0xc], 1
mov ebp, dword [esp + 0x1c]
mov edi, dword [esp + 0x28]
je 0x408710
mov edi, dword [esp + 4]
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], ebp
mov ebp, dword [esp + 0x1c]
mov eax, dword [edi + eax*4]
mov edi, dword [esp + 0x28]
mov edx, dword [esp]
mov dword [edx + ebx*4], eax
jmp 0x408710
cmp dword [esp + 0xc], 0
je 0x408c35
mov ebx, dword [esp + 0xc]
cmp ebx, 1
jne 0x408856
mov eax, dword [esp]
mov word [eax], 1
jmp 0x408a9d
mov edi, dword [esp]
movzx eax, word [edi + 4]
add word [edi], ax
cmp ebx, 3
jl 0x40890b
mov eax, 2
mov ecx, 2
sub ecx, ebx
mov dword [esp + 4], ecx
mov edx, 1
xor esi, esi
jmp 0x4088b2
movzx ebx, word [ecx + esi*4]
add word [ecx + edx*4], bx
mov word [ecx + esi*4], dx
inc esi
mov ecx, dword [esp + 4]
lea edi, [ecx + edx]
inc edi
inc edx
cmp edi, 1
mov ebx, dword [esp + 0xc]
mov edi, dword [esp]
je 0x40890b
cmp eax, ebx
jge 0x4088d0
movzx ebx, word [edi + eax*4]
movzx ecx, word [edi + esi*4]
cmp cx, bx
jb 0x4088d4
inc eax
mov word [edi + edx*4], bx
jmp 0x4088dd
movzx ecx, word [edi + esi*4]
mov word [edi + edx*4], cx
mov word [edi + esi*4], dx
inc esi
mov ecx, edi
cmp eax, dword [esp + 0xc]
jge 0x408890
cmp esi, edx
jge 0x408900
movzx ebx, word [ecx + esi*4]
movzx edi, word [ecx + eax*4]
cmp bx, di
jb 0x408894
jmp 0x408904
movzx edi, word [ecx + eax*4]
inc eax
add word [ecx + edx*4], di
jmp 0x40889d
mov word [edi + ebx*4 - 8], 0
mov ecx, ebx
add ecx, 0xfffffffd
js 0x408991
lea edx, [ebx + 2]
mov eax, ecx
and edx, 3
je 0x408941
mov eax, ecx
nop
nop
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 0x408930
cmp ecx, 3
jb 0x408991
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 0x408950
lea ecx, [ebx - 2]
mov ebx, 1
xor edx, edx
mov eax, dword [esp + 0x18]
jmp 0x4089d5
mov edi, esi
mov ebx, edi
and ebx, 0xfffffffd
mov esi, edi
and edi, 2
or esi, 2
imul esi, edi
xor edi, 2
imul edi, ebx
add esi, edi
inc edx
mov ebx, esi
test esi, esi
jle 0x408a92
test ecx, ecx
mov edi, dword [esp]
js 0x408a10
lea esi, [ecx + 1]
mov dword [esp + 4], esi
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [edi + ecx*4]
cmp edx, edi
jne 0x408a12
inc esi
add ecx, 0xffffffff
mov edi, dword [esp]
jb 0x4089f0
mov ecx, 0xffffffff
mov esi, dword [esp + 4]
jmp 0x408a12
xor esi, esi
mov edi, ebx
sub edi, esi
jle 0x4089b0
mov dword [esp + 4], esi
not esi
add esi, ebx
and edi, 3
je 0x408a58
mov dword [esp + 0x20], esi
mov esi, dword [esp]
lea ebp, [esi + eax*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp], dx
inc esi
add ebp, 0xfffffffc
cmp edi, esi
jne 0x408a40
sub eax, esi
sub ebx, esi
mov ebp, dword [esp + 0x1c]
mov esi, dword [esp + 0x20]
cmp esi, 3
mov esi, dword [esp]
mov edi, dword [esp + 4]
jb 0x4089b2
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi + eax*4], dx
mov word [esi + eax*4 - 4], dx
mov word [esi + eax*4 - 8], dx
mov word [esi + eax*4 - 0xc], dx
add eax, 0xfffffffc
add ebx, 0xfffffffc
cmp ebx, edi
jg 0x408a70
jmp 0x4089b2
cmp dword [esp + 0xc], 0
jle 0x408c35
mov ebx, dword [esp + 0xc]
mov eax, ebx
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x18], 3
mov edi, dword [esp]
jb 0x408aea
mov edx, ebx
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
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 0x408ac0
test eax, eax
je 0x408b0d
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 0x408b00
cmp ebx, 2
jl 0x408c35
mov ebx, dword [esp + 0x15cc]
cmp ebx, 0x20
jge 0x408b90
mov eax, dword [esp + ebx*4 + 0x30]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x408b4c
nop
nop
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 + ebx*4 + 0x30], eax
dec edx
jne 0x408b40
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x408b88
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x3c]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x40]
add ecx, 4
mov dword [esp + ebx*4 + 0x30], eax
cmp ecx, 0x20
jne 0x408b60
test ebx, ebx
jle 0x408c25
xor eax, eax
mov edx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x30]
mov ecx, ebx
sub ecx, edx
shl esi, cl
add eax, esi
mov ecx, edx
not ecx
lea edx, [ecx + edx*2]
test edx, edx
jg 0x408ba0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408edd
jmp 0x408c35
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor ebx, ebx
xor eax, eax
jmp 0x408beb
add eax, 2
cmp ecx, eax
je 0x4085c1
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408c06
mov word [esp + ebx*4 + 0x4b4], si
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408be0
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
jmp 0x408be0
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x408edd
shl ebp, 5
mov esi, dword [esp + 0x10]
lea eax, [esi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408fe0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408fe0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov ebx, dword [esp + 0xc]
jle 0x408d55
add dword [esp], 0xfffffffe
mov eax, 1
jmp 0x408ca2
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
je 0x408d55
mov edi, dword [esp + eax*4 + 0x30]
test edi, edi
jle 0x408c90
mov edx, edi
and edx, 3
je 0x408d00
mov dword [esp + 4], edi
mov dword [esp + 0xc], ebx
mov ecx, dword [esp]
lea edi, [ecx + ebx*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [edi]
mov ecx, ebp
mov ebp, dword [esp + 0x10]
add ebp, ecx
mov byte [ebx + ebp + 0x8f12], al
mov ebp, ecx
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x408cd0
mov ebx, dword [esp + 0xc]
sub ebx, esi
mov edi, dword [esp + 4]
mov edx, edi
sub edx, esi
jmp 0x408d02
mov edx, edi
cmp edi, 4
mov edi, dword [esp]
jb 0x408c90
dec edx
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
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
add ebx, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408d10
jmp 0x408c90
mov ecx, dword [esp + 0x15c8]
mov edi, dword [esp + 0x10]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x408e03
lea ecx, [eax - 1]
cmp eax, 2
jne 0x408d8c
mov eax, 2
xor edx, edx
jmp 0x408dda
mov dword [esp + 0x10], edi
mov ebx, ecx
and ebx, 0xfffffffe
xor edx, edx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + eax*4 + 0x34]
mov edi, dword [esp + eax*4 + 0x38]
mov ebp, esi
and ebp, edx
xor esi, edx
lea edx, [esi + ebp*2]
add edx, edx
mov dword [esp + eax*4 + 0x93c], edx
mov esi, edi
and esi, edx
xor edx, edi
lea edx, [edx + esi*2]
add edx, edx
mov dword [esp + eax*4 + 0x940], edx
add eax, 2
cmp ebx, eax
jne 0x408da0
add eax, 2
mov edi, dword [esp + 0x10]
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x408e03
mov ecx, dword [esp + eax*4 + 0x2c]
mov esi, ecx
and esi, edx
xor ecx, edx
lea ecx, [ecx + esi*2]
add ecx, ecx
mov dword [esp + eax*4 + 0x934], ecx
mov ecx, dword [esp + 0x15c8]
test ecx, ecx
jle 0x408ed2
xor eax, eax
mov ecx, dword [esp + 0x14]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, edi
shl ecx, 6
add ecx, edi
mov dword [esp + 4], ecx
jmp 0x408e4a
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15c8]
je 0x408ed2
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408e3c
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 0x408eaf
and ecx, 0xfffffffc
xor ebx, ebx
nop
nop
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 0x408e80
test edi, edi
je 0x408e30
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 0x408ec0
jmp 0x408e30
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ebx, dword [esp + 0x15cc]
mov ecx, dword [esp + ebx*4 + 0x30]
mov esi, ecx
not esi
lea ecx, [esi + ecx*2]
mov dword [esp + ebx*4 + 0x30], ecx
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408f18
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x408f00
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
dec eax
cmp eax, edx
jne 0x408edd
jmp 0x408c35