Function at 0x4087e0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00409240
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00409420
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x28], edi
mov dword [esp + 0x1c], ebx
je 0x40889c
test esi, esi
mov ecx, esi
jle 0x408fee
xor eax, eax
cmp ecx, 1
je 0x408868
mov ecx, dword [esp + 0x15c8]
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
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 0x408850
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408fee
mov ecx, dword [esp + 0x1c]
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 0x408fee
lea eax, [ebx + ebx*8]
mov dword [esp + 0x18], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x24], eax
jle 0x40895c
cmp esi, 1
jne 0x40916d
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x4088f1
mov ecx, dword [esp + 0x24]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4088f1
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.00409420
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x408973
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x4b4]
movzx edx, cl
inc dword [esp + edx*4 + 0x934]
shr ecx, 8
mov edx, dword [esp + ecx*4 + 0xd34]
mov esi, edx
and esi, 1
xor edx, 1
lea edx, [edx + esi*2]
mov dword [esp + ecx*4 + 0xd34], edx
inc eax
cmp ebx, eax
jne 0x408920
mov eax, dword [esp + 0xd34]
jmp 0x40897c
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409420
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov ebp, 2
sub ebp, ecx
lea eax, [ebx - 1]
mov dword [esp + 0x20], eax
mov eax, ebx
and eax, 0xfffffffe
mov dword [esp + 0x10], eax
lea eax, [esp + 0x4b4]
mov dword [esp + 8], eax
lea edx, [esp + 0x1134]
xor edi, edi
lea eax, [esp + 0x934]
xor ecx, ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x2c], ebp
jmp 0x4089e4
inc edi
add ecx, 8
add eax, 0x400
mov edx, dword [esp]
cmp edi, ebp
je 0x408b09
mov esi, dword [esp + 8]
mov dword [esp], esi
mov dword [esp + 8], edx
mov esi, 3
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + esi*4 + 0xa8], edx
add edx, dword [eax + esi*4 - 0xc]
mov dword [esp + esi*4 + 0xac], edx
add edx, dword [eax + esi*4 - 8]
mov dword [esp + esi*4 + 0xb0], edx
add edx, dword [eax + esi*4 - 4]
mov dword [esp + esi*4 + 0xb4], edx
add edx, dword [eax + esi*4]
add esi, 4
cmp esi, 0x103
jne 0x408a00
cmp byte [esp + 7], 0
jne 0x4089d0
mov dword [esp + 0x14], edi
cmp dword [esp + 0x20], 0
je 0x408ab8
xor esi, esi
mov ebp, dword [esp + 8]
mov ebx, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebx + esi*4]
shr edx, cl
movzx edx, dl
mov ebx, dword [esp + edx*4 + 0xb4]
lea edi, [ebx + 1]
mov dword [esp + edx*4 + 0xb4], edi
mov edx, dword [esp]
mov edx, dword [edx + esi*4]
mov dword [ebp + ebx*4], edx
mov edx, dword [esp]
movzx edx, word [edx + esi*4 + 4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb4]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb4], ebx
mov ebx, dword [esp]
mov edx, dword [ebx + esi*4 + 4]
mov dword [ebp + edi*4], edx
add esi, 2
cmp dword [esp + 0x10], esi
jne 0x408a60
jmp 0x408aba
xor esi, esi
mov ebx, dword [esp + 0xc]
test bl, 1
mov ebp, dword [esp + 0x2c]
mov edi, dword [esp + 0x14]
je 0x4089d0
mov ebp, dword [esp]
movzx edx, word [ebp + esi*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0xb4]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb4], ebx
mov ebx, dword [esp + 0xc]
mov edx, dword [ebp + esi*4]
mov ebp, dword [esp + 0x2c]
mov esi, dword [esp + 8]
mov dword [esi + edi*4], edx
mov edi, dword [esp + 0x14]
jmp 0x4089d0
test ebx, ebx
je 0x408ea5
cmp ebx, 1
jne 0x408b24
mov eax, dword [esp + 8]
mov word [eax], 1
jmp 0x408d7a
mov edi, dword [esp + 8]
movzx eax, word [edi + 4]
add word [edi], ax
cmp ebx, 3
jl 0x408bbb
mov eax, 2
mov ecx, 2
sub ecx, ebx
mov dword [esp], ecx
mov edx, 1
xor esi, esi
jmp 0x408b69
movzx ecx, word [edi + esi*4]
add word [edi + edx*4], cx
mov word [edi + esi*4], dx
inc esi
mov ecx, dword [esp]
add ecx, edx
inc ecx
inc edx
cmp ecx, 1
je 0x408bbb
movzx ecx, word [edi + esi*4]
cmp eax, ebx
jge 0x408b7a
movzx ebp, word [edi + eax*4]
cmp cx, bp
jae 0x408b90
mov word [edi + edx*4], cx
mov word [edi + esi*4], dx
inc esi
cmp eax, ebx
jge 0x408b50
jmp 0x408b99
inc eax
mov word [edi + edx*4], bp
cmp eax, ebx
jge 0x408b50
cmp esi, edx
jge 0x408bb0
movzx ecx, word [edi + esi*4]
movzx ebp, word [edi + eax*4]
cmp cx, bp
jb 0x408b54
jmp 0x408bb4
movzx ebp, word [edi + eax*4]
inc eax
add word [edi + edx*4], bp
jmp 0x408b5d
mov eax, ebx
xor eax, 0x3ffffffd
mov ecx, ebx
and ecx, 0xfffffffd
mov dword [esp], ecx
lea eax, [eax + ecx*2]
mov word [edi + eax*4 + 4], 0
mov eax, ebx
not eax
mov ecx, eax
and ecx, 3
mov esi, ebx
and esi, 0xfffffffc
sub esi, ecx
js 0x408c61
lea ebp, [ebx + 2]
mov edx, esi
and ebp, 3
je 0x408c11
mov edx, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + edx*4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + edx*4], cx
dec edx
dec ebp
jne 0x408c00
cmp esi, 3
jb 0x408c61
inc edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + edx*4 - 4]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + edx*4 - 4], cx
movzx ecx, word [edi + edx*4 - 8]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + edx*4 - 8], cx
movzx ecx, word [edi + edx*4 - 0xc]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + edx*4 - 0xc], cx
movzx ecx, word [edi + edx*4 - 0x10]
movzx ecx, word [edi + ecx*4]
inc ecx
mov word [edi + edx*4 - 0x10], cx
add edx, 0xfffffffc
jne 0x408c20
and eax, 2
sub dword [esp], eax
mov esi, 1
xor edx, edx
mov eax, dword [esp + 0x20]
jmp 0x408c91
mov ebx, dword [esp + 0xc]
mov esi, ebp
add esi, ebp
inc edx
test ebp, ebp
jle 0x408d72
mov ecx, dword [esp]
test ecx, ecx
js 0x408ce0
lea edi, [ecx + 1]
mov dword [esp + 0x10], edi
xor ebp, ebp
mov edi, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov ecx, dword [esp + 8]
movzx ecx, word [ecx + edi*4]
cmp edx, ecx
jne 0x408cf0
inc ebp
add edi, 0xffffffff
jb 0x408cb0
mov dword [esp], 0xffffffff
mov edi, dword [esp + 8]
mov ebp, dword [esp + 0x10]
jmp 0x408cf7
xor ebp, ebp
jmp 0x408cf7
mov dword [esp], edi
mov edi, dword [esp + 8]
mov ebx, esi
sub ebx, ebp
jle 0x408c80
mov ecx, ebp
not ecx
add ecx, esi
and ebx, 3
je 0x408d3b
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], ebp
lea ecx, [edi + eax*4]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ecx], dx
inc ebp
add ecx, 0xfffffffc
cmp ebx, ebp
jne 0x408d20
sub eax, ebp
sub esi, ebp
mov edi, dword [esp + 8]
mov ebp, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov ebx, dword [esp + 0xc]
cmp ecx, 3
jb 0x408c84
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, ebp
jg 0x408d50
jmp 0x408c84
test ebx, ebx
jle 0x408ea5
mov eax, ebx
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x20], 3
mov edi, dword [esp + 8]
jb 0x408dca
mov edx, ebx
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
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 0x408da0
test eax, eax
je 0x408ded
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 0x408de0
cmp ebx, 2
jl 0x408ea5
mov edx, dword [esp + 0x15cc]
lea eax, [edx + 1]
cmp eax, 0x21
jge 0x408e70
mov ecx, dword [esp + edx*4 + 0x30]
neg edx
mov esi, dword [esp + 0x15cc]
and edx, 3
je 0x408e2c
nop
nop
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + esi*4 + 0x30], ecx
inc eax
dec edx
jne 0x408e20
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408e68
add eax, 3
nop
nop
nop
nop
nop
nop
nop
add ecx, dword [esp + eax*4 + 0x24]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x28]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x2c]
mov dword [esp + edx*4 + 0x30], ecx
add ecx, dword [esp + eax*4 + 0x30]
mov dword [esp + edx*4 + 0x30], ecx
add eax, 4
cmp eax, 0x24
jne 0x408e40
test edx, edx
jle 0x4091d5
inc edx
xor ecx, ecx
xor eax, eax
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 0x408e80
mov edx, 1
mov ecx, dword [esp + 0x15cc]
shl edx, cl
cmp eax, edx
jne 0x4091e0
mov ebx, dword [esp + 0x18]
shl ebx, 5
mov edi, dword [esp + 0x28]
lea eax, [edi + ebx]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00409420
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.00409420
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov edi, dword [esp + 8]
jle 0x408fe5
add edi, 0xfffffffe
mov eax, 1
mov dword [esp + 8], edi
mov dword [esp + 0x18], ebx
jmp 0x408f2e
mov ebp, dword [esp + 0xc]
mov ebx, esi
mov esi, ebx
mov dword [esp + 0xc], ebp
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
je 0x408fe5
mov ebp, dword [esp + eax*4 + 0x30]
test ebp, ebp
jle 0x408f10
mov edx, ebp
and edx, 3
je 0x408f80
mov dword [esp], ebp
mov ecx, esi
mov esi, dword [esp + 0xc]
lea ebp, [edi + esi*4]
xor esi, esi
nop
nop
nop
nop
nop
movzx edi, word [ebp]
mov ebx, dword [esp + 0x18]
add ebx, ecx
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x408f50
mov ebp, dword [esp]
mov edx, ebp
sub edx, esi
sub dword [esp + 0xc], esi
mov esi, ecx
jmp 0x408f82
mov edx, ebp
cmp ebp, 4
mov ebp, dword [esp + 0xc]
mov edi, dword [esp + 8]
mov ebx, esi
jb 0x408f16
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebp*4]
mov esi, dword [esp + 0x18]
add esi, ebx
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebp*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebp*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [edi + ebp*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
add ebp, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408fa0
jmp 0x408f16
mov ecx, dword [esp + 0x15c8]
mov edi, esi
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x409093
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40901a
xor edx, edx
mov eax, 2
jmp 0x40906a
mov ebx, ecx
and ebx, 0xfffffffe
xor edx, edx
xor eax, eax
nop
nop
nop
nop
nop
nop
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 0x409030
add eax, 2
mov edi, dword [esp + 0x28]
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x409093
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 0x409162
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], ecx
jmp 0x4090d9
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15c8]
je 0x409162
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x4090cb
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 0x40913f
and ecx, 0xfffffffc
xor ebx, ebx
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 0x409110
test edi, edi
je 0x4090c0
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 0x409150
jmp 0x4090c0
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40919b
add eax, 2
cmp ecx, eax
je 0x4088bf
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4091b6
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 0x409190
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
jmp 0x409190
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
mov edi, dword [esp + 0x15cc]
mov esi, edi
or esi, 0xfffffffe
and edi, 0xfffffffe
lea ecx, [esi + edi]
inc ecx
add edi, esi
add edi, 2
jmp 0x409213
dec esi
mov dword [esp + ebp*4 + 0x2c], esi
add dword [esp + ebp*4 + 0x30], 2
dec eax
cmp eax, edx
je 0x408ea5
mov esi, dword [esp + 0x15cc]
dec dword [esp + esi*4 + 0x30]
test ecx, ecx
jle 0x40920a
mov ebp, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + ebp*4 + 0x2c]
test esi, esi
jne 0x409200
dec ebp
cmp ebp, 1
jg 0x409230
jmp 0x40920a