Function at 0x4085c0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00409030
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.004090e0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x18], ebx
je 0x408685
test esi, esi
mov ebx, dword [esp + 0x15cc]
jle 0x408e17
xor eax, eax
cmp dword [esp + 0x15c8], 1
je 0x408658
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
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 0x408640
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408e17
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x408e17
mov dword [esp + 0x14], edi
lea ebp, [ebx + ebx*8]
mov eax, ebp
shl eax, 6
test esi, esi
mov dword [esp + 0x24], eax
jle 0x40879c
cmp esi, 1
jne 0x408f4d
mov dword [esp], 0
xor eax, eax
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x4086eb
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x14]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4086eb
mov edx, dword [esp]
mov word [esp + edx*4 + 0x4b4], cx
mov word [esp + edx*4 + 0x4b6], ax
inc edx
mov dword [esp], edx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.004090e0
add esp, 0xc
mov ecx, dword [esp]
test ecx, ecx
sete byte [esp + 0xf]
je 0x4087b3
xor eax, eax
cmp ecx, 1
je 0x40876f
mov ecx, dword [esp]
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
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 0x408730
mov edx, dword [esp]
test dl, 1
je 0x408793
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 0x4087bc
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.004090e0
add esp, 0xc
xor edx, edx
mov byte [esp + 0xf], 1
xor eax, eax
xor ecx, ecx
cmp eax, edx
sete cl
mov edi, 2
sub edi, ecx
lea eax, [edx - 1]
mov dword [esp + 0x1c], eax
mov dword [esp], edx
and edx, 0xfffffffe
lea eax, [esp + 0x4b4]
mov dword [esp + 8], eax
lea eax, [esp + 0x1134]
xor ecx, ecx
lea esi, [esp + 0x934]
mov dword [esp + 0x2c], 0
mov dword [esp + 0x10], ebp
mov dword [esp + 0x28], edi
mov dword [esp + 0x20], edx
jmp 0x40882e
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 0x408945
mov edx, dword [esp + 8]
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov eax, 3
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
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 0x408850
cmp byte [esp + 0xf], 0
jne 0x408810
cmp dword [esp + 0x1c], 0
je 0x4088fc
xor eax, eax
mov edi, dword [esp + 8]
mov ebp, dword [esp + 4]
nop
nop
nop
movzx edx, word [ebp + 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 edx, dword [esp + 4]
mov edx, dword [edx + eax*4]
mov dword [edi + ebx*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 0x4088a0
jmp 0x4088fe
xor eax, eax
test byte [esp], 1
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x28]
je 0x408810
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 + 0x10]
mov eax, dword [edi + eax*4]
mov edi, dword [esp + 0x28]
mov edx, dword [esp + 8]
mov dword [edx + ebx*4], eax
jmp 0x408810
cmp dword [esp], 0
mov ebx, dword [esp + 0x15cc]
je 0x408cd0
mov ecx, dword [esp]
cmp ecx, 1
jne 0x40896c
mov eax, dword [esp + 8]
mov word [eax], 1
jmp 0x408bbe
mov edi, dword [esp + 8]
movzx eax, word [edi + 4]
add word [edi], ax
cmp ecx, 3
jl 0x408a2b
mov eax, 2
mov ecx, 2
sub ecx, dword [esp]
mov dword [esp + 4], ecx
mov edx, 1
xor esi, esi
jmp 0x4089d0
movzx edi, word [ecx + esi*4]
movzx ebx, word [ecx + edx*4]
mov ebp, ebx
and ebp, edi
xor ebx, edi
lea edi, [ebx + ebp*2]
mov ebp, dword [esp + 0x10]
mov word [ecx + edx*4], di
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 edi, dword [esp + 8]
je 0x408a2b
mov ecx, edi
movzx edi, word [edi + esi*4]
cmp eax, dword [esp]
jge 0x4089e4
movzx ebx, word [ecx + eax*4]
cmp di, bx
jae 0x408a00
mov word [ecx + edx*4], di
mov word [ecx + esi*4], dx
inc esi
cmp eax, dword [esp]
jge 0x4089a0
jmp 0x408a0a
inc eax
mov word [ecx + edx*4], bx
cmp eax, dword [esp]
jge 0x4089a0
cmp esi, edx
jge 0x408a20
movzx edi, word [ecx + esi*4]
movzx ebx, word [ecx + eax*4]
cmp di, bx
jb 0x4089a4
jmp 0x408a24
movzx ebx, word [ecx + eax*4]
inc eax
add word [ecx + edx*4], bx
jmp 0x4089be
mov edx, dword [esp]
mov word [edi + edx*4 - 8], 0
mov ecx, edx
add ecx, 0xfffffffd
js 0x408ab1
add edx, 2
mov eax, ecx
and edx, 3
je 0x408a61
mov eax, ecx
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 0x408a50
cmp ecx, 3
mov edx, dword [esp]
jb 0x408ab1
inc eax
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 0x408a70
lea ecx, [edx - 2]
mov esi, 1
xor edx, edx
mov eax, dword [esp + 0x1c]
jmp 0x408ae7
mov ebx, dword [esp + 4]
lea esi, [ebx + ebx]
inc edx
test ebx, ebx
mov ebx, dword [esp + 0x15cc]
jle 0x408bb4
test ecx, ecx
js 0x408b20
lea edi, [ecx + 1]
mov dword [esp + 4], edi
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebx, dword [esp + 8]
movzx ebx, word [ebx + ecx*4]
cmp edx, ebx
jne 0x408b30
inc edi
add ecx, 0xffffffff
jb 0x408b00
mov ecx, 0xffffffff
jmp 0x408b34
mov dword [esp + 4], 0
jmp 0x408b38
mov dword [esp + 4], edi
mov edi, dword [esp + 8]
mov ebx, esi
sub ebx, dword [esp + 4]
jle 0x408ad0
mov ebp, ebx
mov ebx, dword [esp + 4]
not ebx
add ebx, esi
and ebp, 3
je 0x408b77
mov dword [esp + 0x20], ebx
lea ebx, [edi + eax*4]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebx], dx
inc edi
add ebx, 0xfffffffc
cmp ebp, edi
jne 0x408b60
sub eax, edi
sub esi, edi
mov edi, dword [esp + 8]
mov ebx, dword [esp + 0x20]
mov ebp, dword [esp + 0x10]
cmp ebx, 3
jb 0x408ad0
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 esi, 0xfffffffc
cmp esi, dword [esp + 4]
jg 0x408b90
jmp 0x408ad0
cmp dword [esp], 0
jle 0x408cd0
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
mov edi, dword [esp + 8]
jb 0x408c0a
mov edx, dword [esp]
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 0x408be0
test eax, eax
je 0x408c2d
lea ecx, [edi + ecx*4]
xor edx, edx
nop
nop
nop
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 0x408c20
cmp dword [esp], 2
jl 0x408cd0
cmp ebx, 0x20
jge 0x408ca0
mov eax, dword [esp + ebx*4 + 0x30]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x408c5c
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
inc ecx
mov dword [esp + ebx*4 + 0x30], eax
dec edx
jne 0x408c50
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x408c98
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 0x408c70
test ebx, ebx
jle 0x408fc1
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
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 0x408cb0
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408fcc
shl ebp, 5
mov edi, dword [esp + 0x14]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.004090e0
add esp, 0xc
mov eax, dword [esp + 0x24]
mov esi, edi
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.004090e0
add esp, 0xc
test ebx, ebx
jle 0x408e15
add dword [esp + 8], 0xfffffffe
mov eax, 1
mov dword [esp + 0x10], ebp
jmp 0x408d52
mov ebx, dword [esp]
mov ebp, esi
mov esi, ebp
mov dword [esp], ebx
lea ecx, [eax + 1]
mov ebx, dword [esp + 0x15cc]
cmp eax, ebx
mov eax, ecx
mov ebp, dword [esp + 0x10]
je 0x408e15
mov edi, dword [esp + eax*4 + 0x30]
test edi, edi
jle 0x408d30
mov edx, edi
and edx, 3
je 0x408db0
mov dword [esp + 4], edi
mov ecx, dword [esp]
mov esi, dword [esp + 8]
lea edi, [esi + ecx*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 + 0x14]
add ebp, ecx
mov byte [ebx + ebp + 0x8f12], al
mov ebp, ecx
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x408d80
sub dword [esp], esi
mov edi, dword [esp + 4]
mov edx, edi
sub edx, esi
mov esi, dword [esp + 0x14]
jmp 0x408db2
mov edx, edi
cmp edi, 4
mov ebx, dword [esp]
mov edi, dword [esp + 8]
mov ebp, esi
jb 0x408d35
dec edx
nop
nop
nop
nop
nop
nop
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 0x408dd0
jmp 0x408d35
mov edi, esi
mov dword [esp + 0x938], 0
cmp ebx, 2
jl 0x408e5e
mov eax, 2
xor ecx, ecx
nop
nop
mov edx, eax
or edx, 0x3ffffffe
mov esi, eax
and esi, 0x3ffffffe
add esi, edx
add ecx, dword [esp + esi*4 + 0x34]
add ecx, ecx
mov dword [esp + eax*4 + 0x934], ecx
mov edx, eax
and edx, 1
xor eax, 1
lea eax, [eax + edx*2]
cmp eax, ebx
jle 0x408e30
cmp dword [esp + 0x15c8], 0
jle 0x408f42
xor eax, eax
mov ecx, dword [esp + 0x18]
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 0x408eaa
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15c8]
je 0x408f42
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408e9c
mov ebp, dword [esp + ecx*4 + 0x934]
mov edi, ebp
and edi, 1
mov ebx, ebp
xor ebx, 1
lea edi, [ebx + edi*2]
mov dword [esp + ecx*4 + 0x934], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x408f1f
and ecx, 0xfffffffc
xor ebx, ebx
nop
nop
nop
nop
nop
nop
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 0x408ef0
test edi, edi
je 0x408e90
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 0x408f30
jmp 0x408e90
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, esi
and ecx, 0xfffffffe
mov edx, dword [esp + 0x14]
add edx, eax
add edx, 0x8194
mov dword [esp], 0
xor eax, eax
jmp 0x408f7b
add eax, 2
cmp ecx, eax
je 0x4086af
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408f9c
mov ebx, dword [esp]
mov word [esp + ebx*4 + 0x4b4], si
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
mov dword [esp], ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408f70
mov ebx, dword [esp]
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
mov dword [esp], ebx
jmp 0x408f70
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
mov esi, ebx
or esi, 0xfffffffe
mov edi, ebx
and edi, 0xfffffffe
lea ecx, [esi + edi]
inc ecx
add esi, edi
add esi, 2
jmp 0x40900a
dec ebx
mov dword [esp + edi*4 + 0x2c], ebx
add dword [esp + edi*4 + 0x30], 2
dec eax
cmp eax, edx
mov ebx, dword [esp + 0x15cc]
je 0x408cd0
dec dword [esp + ebx*4 + 0x30]
test ecx, ecx
jle 0x408ffa
mov edi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ebx, dword [esp + edi*4 + 0x2c]
test ebx, ebx
jne 0x408ff0
dec edi
cmp edi, 1
jg 0x409020
jmp 0x408ffa