Function at 0x4085c0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00409050
mov esi, edx
mov edi, ecx
mov ebx, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.004091a0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x1c], esi
je 0x40866e
test ebx, ebx
jle 0x408ea0
xor eax, eax
cmp ebx, 1
je 0x408648
mov ecx, ebx
and ecx, 0xfffffffe
mov eax, dword [esp + 0x1c]
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
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 0x408630
test bl, 1
je 0x408ea0
mov ecx, dword [esp + 0x1c]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x408ea0
lea eax, [esi + esi*8]
mov dword [esp + 0x10], eax
mov ecx, ebx
mov ebx, eax
shl ebx, 6
test ecx, ecx
mov dword [esp + 0x14], edi
jle 0x40876b
cmp ecx, 1
jne 0x4089eb
xor eax, eax
xor ebp, ebp
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x4086c7
mov ecx, dword [esp + 0x14]
add ecx, ebx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4086c7
mov word [esp + ebp*4 + 0xb4], cx
mov word [esp + ebp*4 + 0xb6], ax
inc ebp
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.004091a0
add esp, 0xc
test ebp, ebp
sete byte [esp + 0xf]
je 0x408782
mov ecx, ebp
xor eax, eax
cmp ebp, 1
je 0x40873f
mov ecx, ebp
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
movzx edx, word [esp + eax*4 + 0xb8]
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 0x408700
mov edx, ebp
test dl, 1
je 0x408762
movzx eax, word [esp + eax*4 + 0xb4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x934]
shr eax, 8
inc dword [esp + eax*4 + 0xd34]
mov eax, dword [esp + 0xd34]
jmp 0x40878b
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.004091a0
add esp, 0xc
xor edx, edx
mov byte [esp + 0xf], 1
xor eax, eax
mov dword [esp + 0x28], ebx
xor ecx, ecx
cmp eax, edx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x2c], eax
lea eax, [edx - 1]
mov dword [esp + 0x24], eax
mov dword [esp + 8], edx
and edx, 0xfffffffe
mov dword [esp + 0x18], edx
xor esi, esi
lea eax, [esp + 0xb4]
mov dword [esp], eax
lea edx, [esp + 0x1134]
lea eax, [esp + 0x938]
xor ecx, ecx
jmp 0x4087f9
mov esi, dword [esp + 0x20]
inc esi
add ecx, 8
add eax, 0x400
mov edx, ebx
cmp esi, dword [esp + 0x2c]
je 0x40890a
mov dword [esp + 0x20], esi
mov esi, dword [esp]
mov dword [esp + 4], esi
mov dword [esp], edx
xor edx, edx
xor esi, esi
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0x534], esi
mov ebx, dword [eax + edx*4 - 4]
mov edi, ebx
and edi, esi
xor ebx, esi
lea esi, [ebx + edi*2]
mov dword [esp + edx*4 + 0x538], esi
mov edi, dword [eax + edx*4]
mov ebx, edi
and ebx, esi
xor edi, esi
lea esi, [edi + ebx*2]
add edx, 2
cmp edx, 0x100
jne 0x408810
cmp byte [esp + 0xf], 0
mov ebx, dword [esp + 4]
jne 0x4087e0
cmp dword [esp + 0x24], 0
je 0x4088cd
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + 4]
movzx ebx, word [esi + edx*4]
shr ebx, cl
movzx esi, bl
mov edi, dword [esp + esi*4 + 0x534]
lea ebx, [edi + 1]
mov dword [esp + esi*4 + 0x534], ebx
mov esi, dword [esp + 4]
mov esi, dword [esi + edx*4]
mov ebp, dword [esp]
mov dword [ebp + edi*4], esi
mov esi, dword [esp + 4]
movzx ebx, word [esi + edx*4 + 4]
shr ebx, cl
movzx esi, bl
mov edi, dword [esp + esi*4 + 0x534]
lea ebx, [edi + 1]
mov dword [esp + esi*4 + 0x534], ebx
mov ebx, dword [esp + 4]
mov esi, dword [ebx + edx*4 + 4]
mov dword [ebp + edi*4], esi
add edx, 2
cmp dword [esp + 0x18], edx
jne 0x408860
test byte [esp + 8], 1
je 0x4087e0
jmp 0x4088da
xor edx, edx
test byte [esp + 8], 1
je 0x4087e0
mov esi, dword [esp + 4]
movzx ebx, word [esi + edx*4]
shr ebx, cl
movzx esi, bl
mov edi, dword [esp + esi*4 + 0x534]
lea ebx, [edi + 1]
mov dword [esp + esi*4 + 0x534], ebx
mov ebx, dword [esp + 4]
mov edx, dword [ebx + edx*4]
mov esi, dword [esp]
mov dword [esi + edi*4], edx
jmp 0x4087e0
cmp dword [esp + 8], 0
mov ebp, dword [esp + 0x10]
je 0x408d50
mov edx, dword [esp + 8]
cmp edx, 1
jne 0x40892f
mov eax, dword [esp]
mov word [eax], 1
jmp 0x408c1d
mov esi, dword [esp]
movzx eax, word [esi + 4]
add word [esi], ax
cmp edx, 2
jle 0x408a45
lea eax, [edx - 2]
mov dword [esp + 4], eax
mov eax, 2
mov ebx, 2
sub ebx, edx
mov ebp, 1
xor esi, esi
mov edi, dword [esp]
jmp 0x40898f
movzx edx, word [edi + esi*4]
add word [edi + ebp*4], dx
mov word [edi + esi*4], bp
inc esi
lea ecx, [ebx + ebp]
inc ecx
inc ebp
cmp ecx, 1
mov edx, dword [esp + 8]
je 0x408a66
movzx ecx, word [edi + esi*4]
cmp eax, edx
jge 0x4089a0
movzx edx, word [edi + eax*4]
cmp cx, dx
jae 0x4089c0
mov word [edi + ebp*4], cx
mov word [edi + esi*4], bp
inc esi
cmp eax, dword [esp + 8]
jge 0x408970
jmp 0x4089cb
inc eax
mov word [edi + ebp*4], dx
cmp eax, dword [esp + 8]
jge 0x408970
cmp esi, ebp
jge 0x4089e0
movzx edx, word [edi + esi*4]
movzx ecx, word [edi + eax*4]
cmp dx, cx
jb 0x408974
jmp 0x4089e4
movzx ecx, word [edi + eax*4]
inc eax
add word [edi + ebp*4], cx
jmp 0x40897d
and ecx, 0xfffffffe
lea edx, [ebx + edi]
add edx, 0x8194
xor eax, eax
xor ebp, ebp
jmp 0x408a0b
add eax, 2
cmp ecx, eax
je 0x408695
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408a26
mov word [esp + ebp*4 + 0xb4], si
mov word [esp + ebp*4 + 0xb6], ax
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0x408a00
mov word [esp + ebp*4 + 0xb4], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0xb6], si
inc ebp
jmp 0x408a00
mov eax, edx
xor eax, 0x3ffffffd
mov ecx, edx
and ecx, 0x1ffffffd
lea eax, [eax + ecx*2]
mov word [esi + eax*4 + 4], 0
lea edi, [edx - 2]
jmp 0x408b11
mov eax, edx
xor eax, 0x3ffffffd
mov ecx, edx
and ecx, 0x1ffffffd
lea eax, [eax + ecx*2]
mov edi, dword [esp]
mov word [edi + eax*4 + 4], 0
add edx, 0xfffffffd
mov esi, dword [esp + 4]
mov eax, edx
and esi, 3
je 0x408ab1
mov eax, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + eax*4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + eax*4], cx
dec eax
dec esi
jne 0x408aa0
cmp edx, 3
mov ebp, dword [esp + 0x10]
jae 0x408ac4
mov edx, dword [esp + 8]
mov edi, dword [esp + 4]
jmp 0x408b11
inc eax
mov edx, dword [esp + 8]
mov esi, dword [esp]
mov edi, dword [esp + 4]
movzx ecx, word [esi + eax*4 - 4]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 4], cx
movzx ecx, word [esi + eax*4 - 8]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 8], cx
movzx ecx, word [esi + eax*4 - 0xc]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 0xc], cx
movzx ecx, word [esi + eax*4 - 0x10]
movzx ecx, word [esi + ecx*4]
inc ecx
mov word [esi + eax*4 - 0x10], cx
add eax, 0xfffffffc
jne 0x408ad0
mov eax, edx
or eax, 0xfffffffe
mov ecx, dword [esp + 0x18]
add eax, ecx
inc eax
mov esi, 1
xor edx, edx
jmp 0x408b3c
lea esi, [ebx + ebx]
inc edx
test ebx, ebx
jle 0x408c12
test edi, edi
js 0x408b70
lea ebx, [edi + 1]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, dword [esp]
movzx ecx, word [ecx + edi*4]
cmp edx, ecx
jne 0x408b80
inc ebp
dec edi
cmp ebx, ebp
jne 0x408b50
mov edi, 0xffffffff
jmp 0x408b82
xor ebx, ebx
jmp 0x408b86
mov ebx, ebp
mov ebp, dword [esp + 0x10]
mov ecx, esi
sub ecx, ebx
jle 0x408b30
mov ebp, ecx
mov ecx, ebx
not ecx
add ecx, esi
and ebp, 3
mov dword [esp + 0x18], ebp
mov dword [esp + 4], ebx
je 0x408bda
mov dword [esp + 0x20], ecx
mov ecx, dword [esp]
lea ebp, [ecx + eax*4]
xor ecx, ecx
mov ebx, dword [esp + 0x18]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp], dx
inc ecx
add ebp, 0xfffffffc
cmp ebx, ecx
jne 0x408bc0
sub esi, ecx
sub eax, ecx
mov ebp, dword [esp + 0x10]
mov ecx, dword [esp + 0x20]
jmp 0x408bde
mov ebp, dword [esp + 0x10]
cmp ecx, 3
mov ecx, dword [esp]
mov ebx, dword [esp + 4]
jb 0x408b30
nop
nop
mov word [ecx + eax*4], dx
mov word [ecx + eax*4 - 4], dx
mov word [ecx + eax*4 - 8], dx
mov word [ecx + eax*4 - 0xc], dx
add eax, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebx
jg 0x408bf0
jmp 0x408b30
cmp dword [esp + 8], 0
jle 0x408d50
mov eax, dword [esp + 8]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x24], 3
mov edi, dword [esp]
jb 0x408c6a
mov edx, dword [esp + 8]
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 0x408c40
test eax, eax
je 0x408c8d
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 0x408c80
cmp dword [esp + 8], 2
jl 0x408d50
mov edx, dword [esp + 0x15cc]
cmp edx, 0x1f
jg 0x408d10
mov eax, dword [esp + edx*4 + 0x30]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x408ccc
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 0x408cc0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408d08
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 0x408ce0
test edx, edx
jle 0x408ffd
mov ebx, edx
not edx
xor eax, eax
mov esi, edx
mov ebp, ebx
nop
nop
nop
nop
nop
nop
mov edi, ebp
and edi, edx
mov ecx, esi
and ecx, ebx
sub ecx, edi
mov edi, dword [esp + ebp*4 + 0x30]
shl edi, cl
add eax, edi
inc esi
cmp ebp, 1
lea ebp, [ebp - 1]
ja 0x408d20
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
mov ebp, dword [esp + 0x10]
jne 0x409019
shl ebp, 5
mov edi, dword [esp + 0x14]
mov esi, ebp
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.004091a0
add esp, 0xc
mov eax, dword [esp + 0x28]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.004091a0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x408e95
add dword [esp], 0xfffffffe
mov eax, 1
mov dword [esp + 0x10], esi
jmp 0x408dce
mov ebx, dword [esp + 8]
mov ebp, esi
mov esi, ebp
mov dword [esp + 8], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
je 0x408e95
mov ecx, dword [esp + eax*4 + 0x30]
test ecx, ecx
jle 0x408db0
mov edx, ecx
and edx, 3
je 0x408e30
mov dword [esp + 4], ecx
mov ecx, dword [esp + 8]
mov esi, dword [esp]
lea ebp, [esi + ecx*4]
xor esi, esi
mov ecx, dword [esp + 0x14]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp]
mov ebx, dword [esp + 0x10]
add ebx, ecx
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x408e00
mov ecx, dword [esp + 4]
mov edx, ecx
sub edx, esi
sub dword [esp + 8], esi
mov esi, dword [esp + 0x10]
jmp 0x408e32
mov edx, ecx
cmp ecx, 4
mov ebx, dword [esp + 8]
mov edi, dword [esp]
mov ebp, esi
jb 0x408db6
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x14]
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 0x408e50
jmp 0x408db6
mov ebx, dword [esp + 0x15c8]
mov edi, dword [esp + 0x14]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x408f1d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x408ecd
xor eax, eax
mov edx, 2
test cl, 1
jne 0x408f10
jmp 0x408f1d
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x93c], eax
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add edx, 2
cmp ebx, edx
jne 0x408ee0
add edx, 2
mov ebx, dword [esp + 0x15c8]
test cl, 1
je 0x408f1d
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
test ebx, ebx
jle 0x408ff2
xor eax, eax
mov ecx, dword [esp + 0x1c]
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 0x408f5c
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c8]
inc eax
cmp eax, ebx
je 0x408ff2
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408f53
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 0x408fcf
and ecx, 0xfffffffc
xor ebx, ebx
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 0x408fa0
test edi, edi
je 0x408f40
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 0x408fe0
jmp 0x408f40
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x409019
dec eax
cmp eax, edx
je 0x408d50
mov ecx, dword [esp + 0x15cc]
dec dword [esp + ecx*4 + 0x30]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x409010
mov esi, dword [esp + ecx*4 + 0x2c]
dec ecx
test esi, esi
je 0x409030
dec esi
mov dword [esp + ecx*4 + 0x30], esi
add dword [esp + ecx*4 + 0x34], 2
jmp 0x409010