Function at 0x408030
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b8
call fcn.00408a30
mov esi, edx
mov edi, ecx
mov ebx, dword [esp + 0x15cc]
lea eax, [esp + 0x34]
push 0x84
push 0
push eax
call fcn.00408bf0
add esp, 0xc
cmp dword [esp + 0x15d4], 0
mov dword [esp + 0x18], esi
je 0x4080e0
test ebx, ebx
mov esi, edi
jle 0x408811
mov edi, esi
xor eax, eax
cmp ebx, 1
je 0x4080b8
mov ecx, ebx
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
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x34]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x34]
add eax, 2
cmp ecx, eax
jne 0x4080a0
test bl, 1
mov esi, edi
je 0x408811
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, esi
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x34]
jmp 0x408811
lea ebp, [esi + esi*8]
mov eax, ebp
shl eax, 6
test ebx, ebx
mov dword [esp + 0x1c], edi
mov dword [esp + 0x10], ebp
mov dword [esp + 0x20], eax
jle 0x4081a4
mov ecx, ebx
mov ebx, edi
cmp ecx, 1
jne 0x40896d
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x40813f
mov ecx, dword [esp + 0x20]
add ecx, ebx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x40813f
mov word [esp + edi*4 + 0x4b8], cx
mov word [esp + edi*4 + 0x4ba], ax
inc edi
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408bf0
add esp, 0xc
test edi, edi
sete byte [esp + 7]
je 0x4081bb
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [esp + eax*4 + 0x4b8]
movzx edx, cl
inc dword [esp + edx*4 + 0x938]
shr ecx, 8
inc dword [esp + ecx*4 + 0xd38]
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
cmp eax, edi
jb 0x408170
mov eax, dword [esp + 0xd38]
jmp 0x4081c4
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.00408bf0
add esp, 0xc
xor edi, edi
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, edi
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x2c], eax
lea eax, [edi - 1]
mov dword [esp + 0x24], eax
mov dword [esp + 8], edi
mov edx, edi
and edx, 0xfffffffe
lea edi, [esp + 0x1138]
lea esi, [esp + 0x4b8]
xor ecx, ecx
lea eax, [esp + 0x938]
xor ebx, ebx
mov dword [esp + 0x14], edx
jmp 0x408232
mov ebx, dword [esp + 0x30]
inc ebx
mov edx, ecx
and edx, 8
xor ecx, 8
lea ecx, [ecx + edx*2]
add eax, 0x400
mov esi, dword [esp]
cmp ebx, dword [esp + 0x2c]
je 0x408335
mov dword [esp + 0x30], ebx
mov dword [esp], edi
mov edi, esi
mov ebx, 3
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + ebx*4 + 0xac], ebp
add ebp, dword [eax + ebx*4 - 0xc]
mov dword [esp + ebx*4 + 0xb0], ebp
add ebp, dword [eax + ebx*4 - 8]
mov dword [esp + ebx*4 + 0xb4], ebp
add ebp, dword [eax + ebx*4 - 4]
mov dword [esp + ebx*4 + 0xb8], ebp
add ebp, dword [eax + ebx*4]
add ebx, 4
cmp ebx, 0x103
jne 0x408250
cmp byte [esp + 7], 0
jne 0x408210
mov dword [esp + 0x28], eax
mov dword [esp + 0xc], edi
cmp dword [esp + 0x24], 0
je 0x4082f4
xor ebp, ebp
nop
nop
mov eax, dword [esp + 0xc]
movzx ebx, word [eax + ebp*4]
shr ebx, cl
movzx esi, bl
mov ebx, dword [esp + esi*4 + 0xb8]
lea edx, [ebx + 1]
mov dword [esp + esi*4 + 0xb8], edx
mov edx, dword [eax + ebp*4]
mov edi, dword [esp]
mov dword [edi + ebx*4], edx
movzx edx, word [eax + ebp*4 + 4]
shr edx, cl
movzx edx, dl
mov esi, dword [esp + edx*4 + 0xb8]
lea ebx, [esi + 1]
mov dword [esp + edx*4 + 0xb8], ebx
mov edx, dword [eax + ebp*4 + 4]
mov dword [edi + esi*4], edx
add ebp, 2
cmp dword [esp + 0x14], ebp
jne 0x4082a0
jmp 0x4082f6
xor ebp, ebp
test byte [esp + 8], 1
mov edi, dword [esp + 0xc]
mov eax, dword [esp + 0x28]
je 0x408210
movzx edx, word [edi + ebp*4]
shr edx, cl
movzx edx, dl
mov esi, dword [esp + edx*4 + 0xb8]
lea ebx, [esi + 1]
mov dword [esp + edx*4 + 0xb8], ebx
mov edx, dword [edi + ebp*4]
mov edi, dword [esp]
mov dword [edi + esi*4], edx
mov edi, dword [esp + 0xc]
jmp 0x408210
cmp dword [esp + 8], 0
je 0x4086e5
mov ebx, dword [esp + 8]
cmp ebx, 1
jne 0x408356
mov eax, dword [esp]
mov word [eax], 1
jmp 0x4085bd
mov ecx, dword [esp]
movzx eax, word [ecx + 4]
add word [ecx], ax
cmp ebx, 3
jl 0x408423
mov eax, 2
mov ecx, 2
sub ecx, ebx
mov edx, 1
xor edi, edi
jmp 0x4083a5
mov ebp, dword [esp]
movzx ebx, word [ebp + edi*4]
add word [ebp + edx*4], bx
mov word [ebp + edi*4], dx
inc edi
lea esi, [ecx + edx]
inc esi
inc edx
cmp esi, 1
mov ebx, dword [esp + 8]
je 0x408423
mov ebp, dword [esp]
movzx esi, word [ebp + edi*4]
cmp eax, ebx
jge 0x4083bb
movzx ebx, word [ebp + eax*4]
cmp si, bx
jae 0x4083e0
mov word [ebp + edx*4], si
mov esi, edi
mov word [ebp + edi*4], dx
and edi, 1
xor esi, 1
lea edi, [esi + edi*2]
cmp eax, dword [esp + 8]
jge 0x408380
jmp 0x4083ec
inc eax
mov word [ebp + edx*4], bx
cmp eax, dword [esp + 8]
jge 0x408380
cmp edi, edx
jge 0x408410
mov ebp, dword [esp]
movzx ebx, word [ebp + edi*4]
movzx esi, word [ebp + eax*4]
cmp bx, si
jb 0x408388
jmp 0x408418
mov ebp, dword [esp]
movzx esi, word [ebp + eax*4]
inc eax
add word [ebp + edx*4], si
jmp 0x408393
lea ecx, [ebx - 2]
mov edx, ebx
add edx, 0xfffffffd
mov eax, ebx
mov ebx, dword [esp]
mov ebp, eax
mov word [ebx + eax*4 - 8], 0
js 0x4084b1
mov edi, ecx
mov eax, edx
and edi, 3
je 0x408461
mov eax, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebx + eax*4]
movzx esi, word [ebx + esi*4]
inc esi
mov word [ebx + eax*4], si
dec eax
dec edi
jne 0x408450
cmp edx, 3
jb 0x4084b1
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [ebx + eax*4 - 4]
movzx edx, word [ebx + edx*4]
inc edx
mov word [ebx + eax*4 - 4], dx
movzx edx, word [ebx + eax*4 - 8]
movzx edx, word [ebx + edx*4]
inc edx
mov word [ebx + eax*4 - 8], dx
movzx edx, word [ebx + eax*4 - 0xc]
movzx edx, word [ebx + edx*4]
inc edx
mov word [ebx + eax*4 - 0xc], dx
movzx edx, word [ebx + eax*4 - 0x10]
movzx edx, word [ebx + edx*4]
inc edx
mov word [ebx + eax*4 - 0x10], dx
add eax, 0xfffffffc
jne 0x408470
mov eax, ebp
xor eax, 0xfffffffe
mov edx, dword [esp + 0x14]
lea eax, [eax + edx*2]
inc eax
mov edi, 1
xor edx, edx
jmp 0x4084f6
mov esi, ebp
and esi, 2
mov edi, ebp
or ebp, 2
imul ebp, esi
xor esi, 2
and edi, 0x7ffffffd
imul edi, esi
add ebp, edi
inc edx
mov edi, ebp
test ebp, ebp
jle 0x4085b2
test ecx, ecx
js 0x408520
lea ebp, [ecx + 1]
xor ebx, ebx
nop
mov esi, dword [esp]
movzx esi, word [esi + ecx*4]
cmp edx, esi
jne 0x408530
inc ebx
dec ecx
cmp ebp, ebx
jne 0x408500
mov ecx, 0xffffffff
jmp 0x408532
xor ebp, ebp
jmp 0x408532
mov ebp, ebx
mov ebx, edi
sub ebx, ebp
jle 0x4084d0
mov esi, ebp
not esi
add esi, edi
and ebx, 3
je 0x408577
mov dword [esp + 0x14], esi
mov dword [esp + 0xc], ebp
mov esi, dword [esp]
lea esi, [esi + eax*4]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi], dx
inc ebp
add esi, 0xfffffffc
cmp ebx, ebp
jne 0x408560
sub edi, ebp
sub eax, ebp
mov ebp, dword [esp + 0xc]
mov esi, dword [esp + 0x14]
cmp esi, 3
mov esi, dword [esp]
jb 0x4084d0
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [esi + eax*4], dx
mov word [esi + eax*4 - 4], dx
mov word [esi + eax*4 - 8], dx
mov word [esi + eax*4 - 0xc], dx
add eax, 0xfffffffc
add edi, 0xfffffffc
cmp edi, ebp
jg 0x408590
jmp 0x4084d0
cmp dword [esp + 8], 0
jle 0x4086e5
mov eax, dword [esp + 8]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x24], 3
mov edi, dword [esp]
jb 0x40860a
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 + 0x34]
movzx esi, word [edi + ecx*4 + 4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [edi + ecx*4 + 8]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [edi + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x34]
add ecx, 4
cmp edx, ecx
jne 0x4085e0
test eax, eax
je 0x40862d
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 + 0x34]
inc edx
cmp eax, edx
jne 0x408620
cmp dword [esp + 8], 2
jl 0x4086e5
mov edx, dword [esp + 0x15d0]
cmp edx, 0x20
jge 0x4086b0
mov eax, dword [esp + edx*4 + 0x34]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x40866c
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x38]
inc ecx
mov dword [esp + esi*4 + 0x34], eax
dec edx
jne 0x408660
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x4086a8
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + edx*4 + 0x34], eax
add eax, dword [esp + ecx*4 + 0x3c]
mov dword [esp + edx*4 + 0x34], eax
add eax, dword [esp + ecx*4 + 0x40]
mov dword [esp + edx*4 + 0x34], eax
add eax, dword [esp + ecx*4 + 0x44]
add ecx, 4
mov dword [esp + edx*4 + 0x34], eax
cmp ecx, 0x20
jne 0x408680
test edx, edx
jle 0x4089c5
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 + 0x30]
shl esi, cl
add eax, esi
dec edx
inc ecx
cmp edx, 1
ja 0x4086c0
mov edx, 1
mov ecx, dword [esp + 0x15d0]
shl edx, cl
cmp eax, edx
jne 0x4089d0
mov edi, dword [esp + 0x10]
shl edi, 5
mov esi, dword [esp + 0x1c]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408bf0
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408bf0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
jle 0x40880a
add dword [esp], 0xfffffffe
mov eax, 1
mov dword [esp + 0x10], edi
jmp 0x40875e
mov ebx, dword [esp + 8]
mov dword [esp + 8], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15d0]
mov eax, ecx
mov edi, dword [esp + 0x10]
je 0x40880a
mov ebx, dword [esp + eax*4 + 0x34]
test ebx, ebx
jle 0x408740
mov edx, ebx
and edx, 3
je 0x4087b0
mov dword [esp + 0xc], ebx
mov ecx, dword [esp + 8]
mov esi, dword [esp]
lea ebx, [esi + ecx*4]
mov ecx, edi
xor edi, edi
nop
movzx esi, word [ebx]
mov ebp, dword [esp + 0x1c]
add ebp, ecx
mov byte [esi + ebp + 0x8f12], al
mov esi, dword [esp + 0x1c]
inc edi
add ebx, 0xfffffffc
cmp edx, edi
jne 0x408780
sub dword [esp + 8], edi
mov ebx, dword [esp + 0xc]
mov edx, ebx
sub edx, edi
jmp 0x4087b2
mov edx, ebx
cmp ebx, 4
mov ebx, dword [esp + 8]
mov ebp, dword [esp]
jb 0x408744
dec edx
nop
movzx ecx, word [ebp + ebx*4]
mov edi, esi
mov esi, dword [esp + 0x10]
add esi, edi
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 4]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 8]
mov byte [ecx + esi + 0x8f12], al
movzx ecx, word [ebp + ebx*4 - 0xc]
mov byte [ecx + esi + 0x8f12], al
mov esi, edi
add ebx, 0xfffffffc
add edx, 0xfffffffc
cmp edx, 0xfffffffe
jb 0x4087c0
jmp 0x408744
mov ebx, dword [esp + 0x15cc]
mov dword [esp + 0x93c], 0
mov eax, dword [esp + 0x15d0]
cmp eax, 2
jl 0x40888d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40883e
xor eax, eax
mov edx, 2
test cl, 1
jne 0x408880
jmp 0x40888d
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 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add eax, dword [esp + edx*4 + 0x3c]
add eax, eax
mov dword [esp + edx*4 + 0x944], eax
add edx, 2
cmp ebx, edx
jne 0x408850
add edx, 2
mov ebx, dword [esp + 0x15cc]
test cl, 1
je 0x40888d
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
test ebx, ebx
jle 0x408962
xor eax, eax
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, esi
shl ecx, 6
add ecx, esi
mov dword [esp], ecx
jmp 0x4088d5
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15cc]
mov ecx, eax
and ecx, 1
xor eax, 1
lea eax, [eax + ecx*2]
cmp eax, ebx
jge 0x408962
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x4088c2
mov ebp, dword [esp + ecx*4 + 0x938]
lea edi, [ebp + 1]
mov dword [esp + ecx*4 + 0x938], edi
mov edi, ecx
and edi, 3
xor ebx, ebx
cmp cl, 4
jb 0x40893f
and ecx, 0xfffffffc
xor ebx, ebx
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 0x408910
test edi, edi
je 0x4088b0
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 0x408950
jmp 0x4088b0
add esp, 0x15b8
pop esi
pop edi
pop ebx
pop ebp
ret
and ecx, 0xfffffffe
lea edx, [eax + ebx]
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x40898b
add eax, 2
cmp ecx, eax
je 0x40810d
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x4089a6
mov word [esp + edi*4 + 0x4b8], si
mov word [esp + edi*4 + 0x4ba], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x408980
mov word [esp + edi*4 + 0x4b8], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0x4ba], si
inc edi
jmp 0x408980
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
mov ecx, dword [esp + 0x15d0]
dec ecx
jmp 0x4089f3
dec esi
mov dword [esp + edi*4 + 0x34], esi
add dword [esp + edi*4 + 0x38], 2
dec eax
cmp eax, edx
je 0x4086e5
mov esi, dword [esp + 0x15d0]
dec dword [esp + esi*4 + 0x34]
cmp esi, 2
jl 0x4089ea
mov edi, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edi*4 + 0x34]
test esi, esi
jne 0x4089e0
mov esi, edi
not esi
lea edi, [esi + edi*2]
test edi, edi
jg 0x408a10
jmp 0x4089ea