Function at 0x408030
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15a4
call fcn.00408a00
mov esi, dword [esp + 0x15c0]
mov ebx, dword [esp + 0x15bc]
mov edi, dword [esp + 0x15b8]
lea eax, [esp + 0x20]
push 0x84
push 0
push eax
call fcn.00408bb0
add esp, 0xc
cmp dword [esp + 0x15c8], 0
je 0x4080e8
test esi, esi
mov ecx, esi
jle 0x4085e4
xor eax, eax
cmp ecx, 1
je 0x4080b8
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
lea eax, [ebx + ebx*8]
shl eax, 5
lea edx, [eax + edi]
add edx, 0x8f13
xor eax, eax
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x20]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x20]
add eax, 2
cmp ecx, eax
jne 0x4080a0
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x4085e4
lea ecx, [ebx + ebx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x20]
jmp 0x4085e4
lea eax, [ebx + ebx*8]
mov dword [esp + 0x10], eax
mov ebp, eax
shl ebp, 6
test esi, esi
mov dword [esp + 0xc], ebp
jle 0x4081ac
cmp esi, 1
jne 0x408447
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x408142
mov ecx, dword [esp + 0x15b8]
add ecx, ebp
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408142
mov word [esp + ebx*4 + 0xa4], cx
mov word [esp + ebx*4 + 0xa6], ax
inc ebx
lea eax, [esp + 0x924]
push 0x800
push 0
push eax
call fcn.00408bb0
add esp, 0xc
test ebx, ebx
sete byte [esp + 3]
je 0x4081c3
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0xa4]
movzx edx, cl
mov esi, dword [esp + edx*4 + 0x924]
mov edi, esi
and edi, 1
xor esi, 1
lea esi, [esi + edi*2]
mov dword [esp + edx*4 + 0x924], esi
shr ecx, 8
inc dword [esp + ecx*4 + 0xd24]
inc eax
cmp ebx, eax
jne 0x408170
mov eax, dword [esp + 0xd24]
jmp 0x4081cc
lea eax, [esp + 0x924]
push 0x800
push 0
push eax
call fcn.00408bb0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 3], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
setne cl
inc ecx
mov dword [esp + 0x18], ecx
mov edx, ebx
and edx, 0xfffffffe
lea esi, [esp + 0xa4]
lea eax, [esp + 0x1124]
xor ecx, ecx
xor edi, edi
mov dword [esp + 0x14], ebx
mov dword [esp + 8], edx
jmp 0x408218
mov edi, dword [esp + 0x1c]
inc edi
add ecx, 8
mov eax, esi
cmp edi, dword [esp + 0x18]
mov esi, dword [esp + 4]
je 0x408303
mov dword [esp + 4], eax
mov dword [esp + 0x1c], edi
mov eax, edi
shl eax, 0xa
lea ebp, [esp + eax]
add ebp, 0x924
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0x524], eax
add eax, dword [ebp + edx*4]
mov edi, edx
and edi, 1
xor edx, 1
lea edx, [edx + edi*2]
cmp edx, 0x100
jb 0x408240
cmp byte [esp + 3], 0
jne 0x408200
xor ebp, ebp
cmp ebx, 1
mov ebx, dword [esp + 4]
je 0x4082cd
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [esi + ebp*4]
shr eax, cl
movzx eax, al
mov edx, dword [esp + eax*4 + 0x524]
lea edi, [edx + 1]
mov dword [esp + eax*4 + 0x524], edi
mov eax, dword [esi + ebp*4]
mov dword [ebx + edx*4], eax
movzx eax, word [esi + ebp*4 + 4]
shr eax, cl
movzx eax, al
mov edx, dword [esp + eax*4 + 0x524]
lea edi, [edx + 1]
mov dword [esp + eax*4 + 0x524], edi
mov eax, dword [esi + ebp*4 + 4]
mov dword [ebx + edx*4], eax
mov edx, dword [esp + 8]
add ebp, 2
cmp edx, ebp
jne 0x408280
mov ebx, dword [esp + 0x14]
test bl, 1
je 0x408200
movzx eax, word [esi + ebp*4]
shr eax, cl
movzx eax, al
mov edx, dword [esp + eax*4 + 0x524]
lea edi, [edx + 1]
mov dword [esp + eax*4 + 0x524], edi
mov eax, dword [esi + ebp*4]
mov edi, dword [esp + 4]
mov dword [edi + edx*4], eax
jmp 0x408200
push ebx
push esi
call fcn.00408770
add esp, 8
test ebx, ebx
mov edi, dword [esp + 0x10]
mov ebp, dword [esp + 0xc]
jle 0x4084b5
mov eax, ebx
and eax, 3
xor ecx, ecx
mov ebp, ebx
cmp ebx, 4
mov ebx, dword [esp + 4]
jb 0x40836a
mov edx, ebp
and edx, 0x7ffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + ecx*4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [ebx + ecx*4 + 4]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [ebx + ecx*4 + 8]
inc dword [esp + esi*4 + 0x20]
movzx esi, word [ebx + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x20]
add ecx, 4
cmp edx, ecx
jne 0x408340
test eax, eax
je 0x40838d
mov edx, dword [esp + 4]
lea ecx, [edx + ecx*4]
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x20]
inc edx
cmp eax, edx
jne 0x408380
mov ebx, ebp
cmp ebp, 1
mov ebp, dword [esp + 0xc]
je 0x4084b5
mov edx, dword [esp + 0x15c4]
cmp edx, 0x20
jge 0x408410
mov eax, dword [esp + edx*4 + 0x20]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x4083cc
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x24]
inc ecx
mov dword [esp + esi*4 + 0x20], eax
dec edx
jne 0x4083c0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408408
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x24]
mov dword [esp + edx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x28]
mov dword [esp + edx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + edx*4 + 0x20], eax
add eax, dword [esp + ecx*4 + 0x30]
add ecx, 4
mov dword [esp + edx*4 + 0x20], eax
cmp ecx, 0x20
jne 0x4083e0
test edx, edx
jle 0x4084a5
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 + 0x1c]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x408420
mov edx, 1
mov ecx, dword [esp + 0x15c4]
shl edx, cl
cmp eax, edx
jne 0x40872d
jmp 0x4084b5
mov ecx, esi
and ecx, 0x7ffffffe
lea edx, [edi + ebp]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40846b
add eax, 2
cmp ecx, eax
je 0x40810d
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408486
mov word [esp + ebx*4 + 0xa4], si
mov word [esp + ebx*4 + 0xa6], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408460
mov word [esp + ebx*4 + 0xa4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0xa6], si
inc ebx
jmp 0x408460
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40872d
shl edi, 5
mov esi, dword [esp + 0x15b8]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408bb0
add esp, 0xc
lea eax, [esi + ebp]
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408bb0
add esp, 0xc
cmp dword [esp + 0x15c4], 0
mov esi, dword [esp + 4]
jle 0x4085cf
add esi, 0xfffffffe
mov eax, 1
add edi, dword [esp + 0x15b8]
mov dword [esp + 4], esi
jmp 0x408532
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15c4]
mov eax, ecx
je 0x4085cf
mov ecx, dword [esp + eax*4 + 0x20]
test ecx, ecx
jle 0x408520
mov edx, ecx
and edx, 3
je 0x408580
mov dword [esp + 8], ecx
mov ecx, ebx
lea ebp, [esi + ebx*4]
xor esi, esi
nop
nop
nop
nop
mov ecx, edi
movzx edi, word [ebp]
mov byte [edi + ecx + 0x8f12], al
mov edi, ecx
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x408550
sub ebx, esi
mov ecx, dword [esp + 8]
mov edx, ecx
sub edx, esi
mov esi, dword [esp + 4]
cmp ecx, 4
jb 0x408520
jmp 0x408587
mov edx, ecx
cmp ecx, 4
jb 0x408520
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esi + ebx*4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebx*4 - 4]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebx*4 - 8]
mov byte [ecx + edi + 0x8f12], al
movzx ecx, word [esi + ebx*4 - 0xc]
add ebx, 0xfffffffc
mov byte [ecx + edi + 0x8f12], al
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x408590
jmp 0x408520
mov ecx, dword [esp + 0x15c0]
mov edi, dword [esp + 0x15b8]
mov ebx, dword [esp + 0x15bc]
mov dword [esp + 0x928], 0
mov eax, dword [esp + 0x15c4]
cmp eax, 2
jl 0x40865f
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40860c
xor eax, eax
mov edx, 2
jmp 0x408646
mov esi, ebx
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x92c], eax
add eax, dword [esp + edx*4 + 0x28]
add eax, eax
mov dword [esp + edx*4 + 0x930], eax
add edx, 2
cmp ebx, edx
jne 0x408620
add edx, 2
mov ebx, esi
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x40865f
add eax, dword [esp + edx*4 + 0x1c]
add eax, eax
mov dword [esp + edx*4 + 0x924], eax
test ecx, ecx
jle 0x408722
xor eax, eax
lea esi, [ebx + ebx*8]
mov edx, esi
shl edx, 5
add eax, 0xe6c1fa01
push es
mov ecx, dword [esp + 0x15c4]
dec dword [esp + ecx*4 + 0x20]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408758
mov esi, dword [esp + ecx*4 + 0x1c]
dec ecx
test esi, esi
je 0x408740
dec esi
mov dword [esp + ecx*4 + 0x20], esi
add dword [esp + ecx*4 + 0x24], 2
dec eax
cmp eax, edx
jne 0x40872d
jmp 0x4084b5