Function at 0x408830
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00409200
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00409460
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x18], ebx
je 0x4088ec
test esi, esi
mov ecx, esi
jle 0x40904e
xor eax, eax
cmp ecx, 1
je 0x4088b8
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
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 0x4088a0
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x40904e
mov ecx, dword [esp + 0x18]
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 0x40904e
lea eax, [ebx + ebx*8]
mov dword [esp + 0x10], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x2c], edi
mov dword [esp + 0x24], eax
jle 0x4089e9
cmp esi, 1
jne 0x408c38
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408945
mov ecx, dword [esp + 0x24]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408945
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.00409460
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x408a00
xor eax, eax
cmp ebx, 1
je 0x4089bf
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 0x408980
test bl, 1
je 0x4089e0
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 0x408a09
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00409460
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 + 0x1c], eax
mov eax, ebx
and eax, 0xfffffffe
mov dword [esp + 0x20], eax
xor edi, edi
lea eax, [esp + 0x4b4]
mov dword [esp + 8], eax
lea edx, [esp + 0x1134]
lea eax, [esp + 0x934]
xor ecx, ecx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x28], ebp
jmp 0x408a64
inc edi
add ecx, 8
add eax, 0x400
mov edx, dword [esp]
cmp edi, ebp
je 0x408b89
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 0x408a80
cmp byte [esp + 7], 0
jne 0x408a50
mov dword [esp + 0x14], edi
cmp dword [esp + 0x1c], 0
je 0x408b38
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 + 0x20], esi
jne 0x408ae0
jmp 0x408b3a
xor esi, esi
mov ebx, dword [esp + 0xc]
test bl, 1
mov ebp, dword [esp + 0x28]
mov edi, dword [esp + 0x14]
je 0x408a50
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 + 0x28]
mov esi, dword [esp + 8]
mov dword [esi + edi*4], edx
mov edi, dword [esp + 0x14]
jmp 0x408a50
test ebx, ebx
je 0x408f05
cmp ebx, 1
jne 0x408ba4
mov eax, dword [esp + 8]
mov word [eax], 1
jmp 0x408e1a
mov edi, dword [esp + 8]
movzx eax, word [edi + 4]
add word [edi], ax
cmp ebx, 3
jl 0x408c95
mov eax, 2
mov ecx, 2
sub ecx, ebx
mov dword [esp], ecx
mov edx, 1
xor esi, esi
jmp 0x408be5
inc eax
add word [edi + edx*4], bp
mov ecx, dword [esp]
add ecx, edx
inc ecx
inc edx
cmp ecx, 1
je 0x408ca7
movzx ecx, word [edi + esi*4]
cmp eax, ebx
jge 0x408bf6
movzx ebp, word [edi + eax*4]
cmp cx, bp
jae 0x408c20
mov word [edi + edx*4], cx
mov word [edi + esi*4], dx
inc esi
cmp eax, ebx
jge 0x408c29
movzx ebp, word [edi + eax*4]
cmp esi, edx
jge 0x408bd0
movzx ecx, word [edi + esi*4]
cmp cx, bp
jae 0x408bd0
jmp 0x408c2d
inc eax
mov word [edi + edx*4], bp
cmp eax, ebx
jl 0x408c03
movzx ecx, word [edi + esi*4]
add word [edi + edx*4], cx
mov word [edi + esi*4], dx
inc esi
jmp 0x408bd5
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x408c5b
add eax, 2
cmp ecx, eax
je 0x408913
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408c76
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 0x408c50
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
jmp 0x408c50
lea eax, [ebx - 2]
mov dword [esp], eax
mov word [edi + ebx*4 - 8], 0
jmp 0x408d21
mov word [edi + ebx*4 - 8], 0
lea edx, [ebx - 3]
lea ecx, [ebx + 2]
mov eax, edx
and ecx, 3
je 0x408cd1
mov eax, edx
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 ecx
jne 0x408cc0
lea ecx, [ebx - 2]
mov dword [esp], ecx
cmp edx, 3
jb 0x408d21
inc eax
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 0x408ce0
xor edx, edx
mov esi, 1
mov eax, dword [esp + 0x1c]
jmp 0x408d41
mov ebx, dword [esp + 0xc]
mov esi, ebp
add esi, ebp
inc edx
test ebp, ebp
jle 0x408e12
mov ecx, dword [esp]
test ecx, ecx
js 0x408d80
lea ebx, [ecx + 1]
xor ebp, ebp
mov edi, ecx
nop
mov ecx, dword [esp + 8]
movzx ecx, word [ecx + edi*4]
cmp edx, ecx
jne 0x408d90
inc ebp
dec edi
cmp ebx, ebp
jne 0x408d50
mov dword [esp], 0xffffffff
mov edi, dword [esp + 8]
mov ebp, ebx
jmp 0x408d97
xor ebp, ebp
jmp 0x408d97
mov dword [esp], edi
mov edi, dword [esp + 8]
mov ebx, esi
sub ebx, ebp
jle 0x408d30
mov ecx, ebp
not ecx
add ecx, esi
and ebx, 3
je 0x408ddb
mov dword [esp + 0x14], ecx
mov dword [esp + 0x20], 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 0x408dc0
sub eax, ebp
sub esi, ebp
mov edi, dword [esp + 8]
mov ebp, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov ebx, dword [esp + 0xc]
cmp ecx, 3
jb 0x408d34
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 0x408df0
jmp 0x408d34
test ebx, ebx
jle 0x408f05
mov eax, ebx
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
mov edi, dword [esp + 8]
jb 0x408e6a
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 0x408e40
test eax, eax
je 0x408e8d
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 0x408e80
cmp ebx, 2
jl 0x408f05
mov ecx, dword [esp + 0x15cc]
cmp ecx, 0x20
jge 0x408ed7
lea eax, [ecx + 1]
mov esi, dword [esp + ecx*4 + 0x30]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add esi, dword [esp + eax*4 + 0x30]
mov dword [esp + ecx*4 + 0x30], esi
mov edx, eax
and edx, 1
xor eax, 1
lea eax, [eax + edx*2]
mov ecx, dword [esp + 0x15cc]
cmp eax, 0x21
jl 0x408eb0
test ecx, ecx
jle 0x40918e
lea edx, [ecx + 1]
xor ecx, ecx
xor eax, eax
nop
nop
mov esi, dword [esp + edx*4 + 0x2c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408ee0
mov edi, 1
mov ecx, dword [esp + 0x15cc]
shl edi, cl
cmp eax, edi
jne 0x409197
mov ebx, dword [esp + 0x10]
shl ebx, 5
mov edi, dword [esp + 0x2c]
lea eax, [edi + ebx]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00409460
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.00409460
add esp, 0xc
cmp dword [esp + 0x15cc], 0
mov edi, dword [esp + 8]
jle 0x409045
add edi, 0xfffffffe
mov eax, 1
mov dword [esp + 8], edi
mov dword [esp + 0x10], ebx
jmp 0x408f8e
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 0x409045
mov ebp, dword [esp + eax*4 + 0x30]
test ebp, ebp
jle 0x408f70
mov edx, ebp
and edx, 3
je 0x408fe0
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 + 0x10]
add ebx, ecx
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x408fb0
sub dword [esp + 0xc], esi
mov ebp, dword [esp]
mov edx, ebp
sub edx, esi
mov esi, ecx
jmp 0x408fe2
mov edx, ebp
cmp ebp, 4
mov ebp, dword [esp + 0xc]
mov edi, dword [esp + 8]
mov ebx, esi
jb 0x408f76
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 + 0x10]
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 0x409000
jmp 0x408f76
mov ecx, dword [esp + 0x15c8]
mov edi, esi
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x4090bd
lea ecx, [eax - 1]
cmp eax, 2
jne 0x409076
xor eax, eax
mov edx, 2
jmp 0x4090a4
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
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 0x409080
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c8]
je 0x4090bd
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
test ecx, ecx
jle 0x409183
xor eax, eax
mov edx, dword [esp + 0x18]
lea edx, [edx + edx*8]
mov esi, edx
shl esi, 5
add esi, edi
mov dword [esp], esi
shl edx, 6
add edx, edi
mov dword [esp + 0x10], edx
jmp 0x409108
mov ecx, dword [esp + 0x10]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c8]
inc eax
cmp eax, ecx
je 0x409183
mov edx, dword [esp]
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x409103
mov edx, dword [esp + ebx*4 + 0x934]
lea edi, [edx + 1]
mov dword [esp + ebx*4 + 0x934], edi
xor edi, edi
cmp bl, 1
je 0x40916b
mov ebp, ebx
and ebp, 0xfffffffe
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, edx
not esi
or esi, 1
add esi, edx
mov ecx, edx
shr ecx, 1
shl edi, 2
add esi, esi
add esi, 2
or esi, edi
mov edi, ecx
not edi
or edi, 1
add edi, ecx
inc edi
or edi, esi
shr edx, 2
add ebp, 0xfffffffe
jne 0x409140
test bl, 1
je 0x4090f0
add edi, edi
mov ecx, edx
not ecx
or ecx, 1
add ecx, edx
inc ecx
or edi, ecx
jmp 0x4090f0
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov edi, 1
shl edi, cl
xor eax, eax
mov ecx, dword [esp + 0x15cc]
add ecx, ecx
jmp 0x4091b9
dec eax
cmp eax, edi
je 0x408f05
mov ebp, dword [esp + 0x15cc]
dec dword [esp + ebp*4 + 0x30]
mov esi, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ebp, 2
jl 0x4091b0
dec ebp
mov edx, dword [esp + esi*2 + 0x2c]
add esi, 0xfffffffe
test edx, edx
je 0x4091d0
dec edx
mov dword [esp + esi*2 + 0x30], edx
and esi, 2
xor ebp, 1
add ebp, esi
add dword [esp + ebp*4 + 0x30], 2
jmp 0x4091b0