Function at 0x4081d0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.00408c30
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.00408ce0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x20], ebx
je 0x408295
test esi, esi
mov ebx, dword [esp + 0x15cc]
jle 0x408ab7
xor eax, eax
cmp dword [esp + 0x15c8], 1
je 0x408268
mov ecx, dword [esp + 0x15c8]
and ecx, 0xfffffffe
mov eax, dword [esp + 0x20]
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
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 0x408250
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408ab7
mov ecx, dword [esp + 0x20]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x408ab7
mov dword [esp + 0x1c], edi
lea ebp, [ebx + ebx*8]
mov eax, ebp
shl eax, 6
test esi, esi
mov dword [esp + 0x28], eax
jle 0x4083af
cmp esi, 1
jne 0x4083db
mov dword [esp], 0
xor eax, eax
mov ebx, dword [esp + 0x15cc]
mov ecx, dword [esp + 0x15c8]
test cl, 1
je 0x408302
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x1c]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x408302
mov edx, dword [esp]
mov word [esp + edx*4 + 0x4b4], cx
mov word [esp + edx*4 + 0x4b6], ax
inc edx
mov dword [esp], edx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408ce0
add esp, 0xc
mov ecx, dword [esp]
test ecx, ecx
sete byte [esp + 0xb]
je 0x408453
xor eax, eax
cmp ecx, 1
je 0x40837f
mov ecx, dword [esp]
and ecx, 0xfffffffe
xor eax, eax
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 0x408340
mov edx, dword [esp]
test dl, 1
je 0x4083a3
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 0x40845c
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.00408ce0
add esp, 0xc
xor edx, edx
mov byte [esp + 0xb], 1
xor eax, eax
mov ebx, dword [esp + 0x15cc]
jmp 0x40845c
mov ecx, esi
and ecx, 0xfffffffe
mov edx, dword [esp + 0x1c]
add edx, eax
add edx, 0x8194
mov dword [esp], 0
xor eax, eax
mov edi, dword [esp + 0x15cc]
jmp 0x40840d
mov ebx, edi
add eax, 2
cmp ecx, eax
je 0x4082c6
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x40842e
mov ebx, dword [esp]
mov word [esp + ebx*4 + 0x4b4], si
mov word [esp + ebx*4 + 0x4b6], ax
inc ebx
mov dword [esp], ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408400
mov ebx, dword [esp]
mov word [esp + ebx*4 + 0x4b4], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4b6], si
inc ebx
mov dword [esp], ebx
jmp 0x408400
xor edx, edx
mov byte [esp + 0xb], 1
xor eax, eax
xor ecx, ecx
cmp eax, edx
sete cl
mov edi, 2
sub edi, ecx
lea eax, [edx - 1]
mov dword [esp + 0x24], eax
mov dword [esp], edx
and edx, 0xfffffffe
mov dword [esp + 0x14], edx
lea eax, [esp + 0x4b4]
mov dword [esp + 0xc], eax
xor ecx, ecx
lea eax, [esp + 0x1134]
lea edx, [esp + 0x934]
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], ebp
mov dword [esp + 0x2c], edi
jmp 0x4084d6
mov esi, dword [esp + 0x18]
inc esi
mov eax, ecx
and eax, 8
xor ecx, 8
lea ecx, [ecx + eax*2]
add edx, 0x400
mov eax, dword [esp + 4]
mov dword [esp + 0x18], esi
cmp esi, edi
je 0x4085f1
mov esi, dword [esp + 0xc]
mov dword [esp + 4], esi
mov dword [esp + 0xc], eax
mov esi, 3
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + esi*4 + 0xa8], eax
add eax, dword [edx + esi*4 - 0xc]
mov dword [esp + esi*4 + 0xac], eax
add eax, dword [edx + esi*4 - 8]
mov dword [esp + esi*4 + 0xb0], eax
add eax, dword [edx + esi*4 - 4]
mov dword [esp + esi*4 + 0xb4], eax
add eax, dword [edx + esi*4]
add esi, 4
cmp esi, 0x103
jne 0x4084f0
cmp byte [esp + 0xb], 0
jne 0x4084b0
cmp dword [esp + 0x24], 0
je 0x40859a
xor esi, esi
mov edi, dword [esp + 0xc]
mov ebp, dword [esp + 4]
nop
nop
movzx eax, word [ebp + esi*4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xb4], ebp
mov eax, dword [esp + 4]
mov eax, dword [eax + esi*4]
mov dword [edi + ebx*4], eax
mov eax, dword [esp + 4]
movzx eax, word [eax + esi*4 + 4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xb4], ebp
mov ebp, dword [esp + 4]
mov eax, dword [ebp + esi*4 + 4]
mov dword [edi + ebx*4], eax
add esi, 2
cmp dword [esp + 0x14], esi
jne 0x408540
jmp 0x40859c
xor esi, esi
test byte [esp], 1
mov ebx, dword [esp + 0x15cc]
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x2c]
je 0x4084b0
mov edi, dword [esp + 4]
movzx eax, word [edi + esi*4]
shr eax, cl
movzx eax, al
mov ebx, dword [esp + eax*4 + 0xb4]
lea ebp, [ebx + 1]
mov dword [esp + eax*4 + 0xb4], ebp
mov ebp, dword [esp + 0x10]
mov eax, dword [edi + esi*4]
mov edi, dword [esp + 0x2c]
mov esi, dword [esp + 0xc]
mov dword [esi + ebx*4], eax
mov ebx, dword [esp + 0x15cc]
jmp 0x4084b0
cmp dword [esp], 0
je 0x408970
mov edx, dword [esp]
cmp edx, 1
jne 0x408611
mov eax, dword [esp + 0xc]
mov word [eax], 1
jmp 0x408856
mov edi, dword [esp + 0xc]
movzx eax, word [edi + 4]
add word [edi], ax
cmp edx, 3
jl 0x4086ab
mov eax, 2
mov ecx, 2
sub ecx, edx
mov dword [esp + 4], ecx
mov edx, 1
xor esi, esi
jmp 0x40865f
movzx ebx, word [ecx + esi*4]
add word [ecx + edx*4], bx
mov word [ecx + esi*4], dx
inc esi
mov ecx, dword [esp + 4]
lea edi, [ecx + edx]
inc edi
inc edx
cmp edi, 1
mov edi, dword [esp + 0xc]
je 0x4086be
movzx ecx, word [edi + esi*4]
cmp eax, dword [esp]
jge 0x408671
movzx ebx, word [edi + eax*4]
cmp cx, bx
jae 0x408680
mov word [edi + edx*4], cx
mov word [edi + esi*4], dx
inc esi
jmp 0x408685
inc eax
mov word [edi + edx*4], bx
mov ecx, edi
cmp eax, dword [esp]
jge 0x408640
cmp esi, edx
jge 0x4086a0
movzx ebx, word [ecx + esi*4]
movzx edi, word [ecx + eax*4]
cmp bx, di
jb 0x408644
jmp 0x4086a4
movzx edi, word [ecx + eax*4]
inc eax
add word [ecx + edx*4], di
jmp 0x40864d
lea eax, [edx - 2]
mov dword [esp + 0x14], eax
mov word [edi + edx*4 - 8], 0
jmp 0x408751
mov eax, dword [esp]
mov word [edi + eax*4 - 8], 0
lea edx, [eax - 3]
lea ecx, [eax + 2]
mov eax, edx
and ecx, 3
je 0x4086f1
mov eax, edx
nop
nop
nop
nop
nop
nop
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 0x4086e0
mov ecx, dword [esp]
lea esi, [ecx - 2]
cmp edx, 3
mov dword [esp + 0x14], esi
jb 0x408751
inc eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
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 0x408710
mov ecx, 1
xor edx, edx
mov eax, dword [esp + 0x24]
jmp 0x40876e
mov ebx, esi
lea ecx, [ebx + ebx]
inc edx
test ebx, ebx
jle 0x408845
mov ebx, dword [esp + 0x14]
test ebx, ebx
js 0x4087a0
lea esi, [ebx + 1]
mov dword [esp + 4], esi
xor esi, esi
nop
movzx edi, word [edi + ebx*4]
cmp edx, edi
jne 0x4087b0
inc esi
add ebx, 0xffffffff
mov edi, dword [esp + 0xc]
jb 0x408780
mov dword [esp + 0x14], 0xffffffff
mov esi, dword [esp + 4]
jmp 0x4087b8
xor esi, esi
jmp 0x4087b8
mov dword [esp + 0x14], ebx
mov edi, dword [esp + 0xc]
mov ebx, ecx
sub ebx, esi
jle 0x408760
mov ebp, esi
not ebp
add ebp, ecx
mov dword [esp + 0x18], ebp
and ebx, 3
mov dword [esp + 4], esi
je 0x4087f9
lea esi, [ecx + 2]
mov ebp, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov edi, ecx
mov word [ebp + eax*4], dx
dec eax
not ecx
lea ecx, [ecx + edi*2]
dec esi
dec ebx
jne 0x4087e0
add edi, edi
sub edi, esi
mov ecx, edi
mov edi, ebp
mov esi, dword [esp + 0x18]
mov ebp, dword [esp + 0x10]
cmp esi, 3
mov ebx, dword [esp + 4]
jb 0x408762
lea esi, [ecx + ecx]
nop
nop
nop
nop
nop
nop
nop
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 ecx, 0xfffffffc
add esi, 0xfffffff8
cmp ecx, ebx
jg 0x408820
jmp 0x408762
cmp dword [esp], 0
mov ebx, dword [esp + 0x15cc]
jle 0x408970
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x24], 3
mov edi, dword [esp + 0xc]
jb 0x4088aa
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
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 0x408880
test eax, eax
je 0x4088cd
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 0x4088c0
cmp dword [esp], 2
jl 0x408970
cmp ebx, 0x20
jge 0x408940
mov eax, dword [esp + ebx*4 + 0x30]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x4088fc
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
inc ecx
mov dword [esp + ebx*4 + 0x30], eax
dec edx
jne 0x4088f0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x408938
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x38]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x3c]
mov dword [esp + ebx*4 + 0x30], eax
add eax, dword [esp + ecx*4 + 0x40]
add ecx, 4
mov dword [esp + ebx*4 + 0x30], eax
cmp ecx, 0x20
jne 0x408910
test ebx, ebx
jle 0x408bcd
lea edx, [ebx + 1]
xor ecx, ecx
xor eax, eax
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 0x408950
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408bd8
shl ebp, 5
mov edi, dword [esp + 0x1c]
lea eax, [edi + ebp]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408ce0
add esp, 0xc
mov eax, dword [esp + 0x28]
mov esi, edi
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408ce0
add esp, 0xc
test ebx, ebx
jle 0x408ab5
add dword [esp + 0xc], 0xfffffffe
mov eax, 1
mov dword [esp + 0x10], ebp
jmp 0x4089f2
mov ebx, dword [esp]
mov ebp, esi
mov esi, ebp
mov dword [esp], ebx
lea ecx, [eax + 1]
mov ebx, dword [esp + 0x15cc]
cmp eax, ebx
mov eax, ecx
mov ebp, dword [esp + 0x10]
je 0x408ab5
mov edi, dword [esp + eax*4 + 0x30]
test edi, edi
jle 0x4089d0
mov edx, edi
and edx, 3
je 0x408a50
mov dword [esp + 4], edi
mov ecx, dword [esp]
mov esi, dword [esp + 0xc]
lea edi, [esi + ecx*4]
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, word [edi]
mov ecx, ebp
mov ebp, dword [esp + 0x1c]
add ebp, ecx
mov byte [ebx + ebp + 0x8f12], al
mov ebp, ecx
inc esi
add edi, 0xfffffffc
cmp edx, esi
jne 0x408a20
sub dword [esp], esi
mov edi, dword [esp + 4]
mov edx, edi
sub edx, esi
mov esi, dword [esp + 0x1c]
jmp 0x408a52
mov edx, edi
cmp edi, 4
mov ebx, dword [esp]
mov edi, dword [esp + 0xc]
mov ebp, esi
jb 0x4089d5
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x10]
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 0x408a70
jmp 0x4089d5
mov edi, esi
mov dword [esp + 0x938], 0
cmp ebx, 2
jl 0x408aec
mov eax, 2
xor ecx, ecx
nop
nop
add ecx, dword [esp + eax*4 + 0x2c]
add ecx, ecx
mov dword [esp + eax*4 + 0x934], ecx
mov edx, eax
and edx, 1
xor eax, 1
lea eax, [eax + edx*2]
cmp eax, ebx
jle 0x408ad0
cmp dword [esp + 0x15c8], 0
jle 0x408bc2
xor eax, eax
mov ecx, dword [esp + 0x20]
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 0x408b3a
mov ecx, dword [esp + 4]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15c8]
je 0x408bc2
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x408b2c
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 0x408b9f
and ecx, 0xfffffffc
xor ebx, ebx
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 0x408b70
test edi, edi
je 0x408b20
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 0x408bb0
jmp 0x408b20
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
lea ecx, [ebx + ebx]
jmp 0x408bf6
mov esi, eax
not esi
lea eax, [esi + eax*2]
cmp eax, edx
mov ebx, dword [esp + 0x15cc]
je 0x408970
dec dword [esp + ebx*4 + 0x30]
mov esi, ecx
mov edi, ebx
nop
nop
cmp edi, 2
jl 0x408be0
dec edi
mov ebx, dword [esp + esi*2 + 0x2c]
add esi, 0xfffffffe
test ebx, ebx
je 0x408c00
dec ebx
mov dword [esp + esi*2 + 0x30], ebx
and esi, 2
xor edi, 1
add edi, esi
add dword [esp + edi*4 + 0x30], 2
jmp 0x408be0