Function at 0x4081d0
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15ac
call fcn.00408be0
mov edi, edx
mov dword [esp + 8], ecx
mov ebx, dword [esp + 0x15c4]
mov esi, dword [esp + 0x15c0]
lea eax, [esp + 0x28]
push 0x84
push 0
push eax
call fcn.00408c90
add esp, 0xc
cmp dword [esp + 0x15c8], 0
mov dword [esp + 0x18], edi
je 0x40829e
test esi, esi
mov ecx, esi
jle 0x4089e7
xor eax, eax
cmp ecx, 1
je 0x408268
mov ecx, dword [esp + 0x15c0]
and ecx, 0x7ffffffe
mov eax, dword [esp + 0x18]
lea eax, [eax + eax*8]
shl eax, 5
mov edx, dword [esp + 8]
add edx, eax
add edx, 0x8f13
xor eax, eax
nop
nop
movzx esi, byte [edx + eax - 1]
inc dword [esp + esi*4 + 0x28]
movzx esi, byte [edx + eax]
inc dword [esp + esi*4 + 0x28]
add eax, 2
cmp ecx, eax
jne 0x408250
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x4089e7
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, dword [esp + 8]
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15c0]
inc dword [esp + eax*4 + 0x28]
jmp 0x4089e7
lea eax, [edi + edi*8]
mov dword [esp + 0x1c], eax
mov ebx, eax
shl ebx, 6
test esi, esi
mov dword [esp + 0x20], ebx
jle 0x40839b
cmp esi, 1
jne 0x40884a
xor eax, eax
xor edi, edi
mov ecx, dword [esp + 0x15c0]
test cl, 1
je 0x4082f9
mov ecx, dword [esp + 8]
add ecx, ebx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x4082f9
mov edx, edi
mov word [esp + edi*4 + 0xac], cx
mov word [esp + edi*4 + 0xae], ax
inc edx
mov edi, edx
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.00408c90
add esp, 0xc
test edi, edi
sete byte [esp + 0xc]
je 0x4083b2
mov ecx, edi
xor eax, eax
cmp edi, 1
je 0x40836f
mov ecx, edi
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xac]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
movzx edx, word [esp + eax*4 + 0xb0]
movzx esi, dl
inc dword [esp + esi*4 + 0x52c]
shr edx, 8
inc dword [esp + edx*4 + 0x92c]
add eax, 2
cmp ecx, eax
jne 0x408330
mov edx, edi
test dl, 1
je 0x408392
movzx eax, word [esp + eax*4 + 0xac]
movzx ecx, al
inc dword [esp + ecx*4 + 0x52c]
shr eax, 8
inc dword [esp + eax*4 + 0x92c]
mov eax, dword [esp + 0x92c]
jmp 0x4083bb
lea eax, [esp + 0x52c]
push 0x800
push 0
push eax
call fcn.00408c90
add esp, 0xc
xor edx, edx
mov byte [esp + 0xc], 1
xor eax, eax
xor ecx, ecx
mov dword [esp], edx
cmp eax, edx
setne cl
inc ecx
mov dword [esp + 0x24], ecx
lea ebp, [esp + 0xac]
lea eax, [esp + 0x112c]
xor ecx, ecx
lea esi, [esp + 0x52c]
xor edx, edx
jmp 0x408412
mov edx, dword [esp + 4]
inc edx
add ecx, 8
mov esi, dword [esp + 0x10]
add esi, 0x400
mov eax, edi
cmp edx, dword [esp + 0x24]
mov ebp, dword [esp + 0x14]
je 0x4084bd
mov dword [esp + 4], edx
mov edi, ebp
mov ebx, eax
mov edx, 3
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + edx*4 + 0xd20], eax
add eax, dword [esi + edx*4 - 0xc]
mov dword [esp + edx*4 + 0xd24], eax
add eax, dword [esi + edx*4 - 8]
mov dword [esp + edx*4 + 0xd28], eax
add eax, dword [esi + edx*4 - 4]
mov dword [esp + edx*4 + 0xd2c], eax
add eax, dword [esi + edx*4]
add edx, 4
cmp edx, 0x103
jne 0x408430
mov dword [esp + 0x10], esi
cmp byte [esp + 0xc], 0
mov dword [esp + 0x14], ebx
jne 0x4083f0
xor edx, edx
nop
nop
nop
nop
nop
movzx eax, word [edi + edx*4]
shr eax, cl
movzx eax, al
mov ebp, dword [esp + eax*4 + 0xd2c]
mov ebx, dword [edi + edx*4]
mov esi, edi
mov edi, dword [esp + 0x14]
mov dword [edi + ebp*4], ebx
mov edi, esi
mov ebx, ebp
and ebp, 1
xor ebx, 1
lea ebx, [ebx + ebp*2]
mov dword [esp + eax*4 + 0xd2c], ebx
mov eax, dword [esp]
inc edx
cmp eax, edx
jne 0x408480
jmp 0x4083f0
cmp dword [esp], 0
mov ebx, dword [esp + 0x15c4]
mov edi, dword [esp + 0x1c]
je 0x4088c5
mov ecx, dword [esp]
cmp ecx, 1
jne 0x4084e5
mov word [ebp], 1
jmp 0x408731
movzx eax, word [ebp + 4]
add word [ebp], ax
lea eax, [ecx - 1]
mov dword [esp + 0x10], eax
cmp eax, 2
jl 0x408597
mov ecx, 2
mov eax, 2
sub eax, dword [esp]
mov dword [esp + 4], eax
xor edx, edx
mov esi, 1
jmp 0x408533
inc ecx
add word [ebp + esi*4], ax
mov eax, dword [esp + 4]
add eax, esi
inc eax
inc esi
cmp eax, 1
je 0x408597
movzx eax, word [ebp + edx*4]
cmp ecx, dword [esp]
jge 0x408547
movzx edi, word [ebp + ecx*4]
cmp ax, di
jae 0x408570
mov word [ebp + esi*4], ax
mov word [ebp + edx*4], si
inc edx
cmp ecx, dword [esp]
jge 0x40857b
movzx eax, word [ebp + ecx*4]
cmp edx, esi
jge 0x408520
movzx edi, word [ebp + edx*4]
cmp di, ax
jae 0x408520
jmp 0x408580
inc ecx
mov word [ebp + esi*4], di
cmp ecx, dword [esp]
jl 0x408557
movzx edi, word [ebp + edx*4]
add word [ebp + esi*4], di
mov eax, edx
mov word [ebp + edx*4], si
and edx, 1
xor eax, 1
lea edx, [eax + edx*2]
jmp 0x408526
mov edx, dword [esp]
mov word [ebp + edx*4 - 8], 0
add edx, 0xfffffffd
js 0x408625
mov esi, dword [esp]
and esi, 3
xor esi, 2
mov ecx, edx
je 0x4085d4
mov ecx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx eax, word [ebp + ecx*4]
movzx eax, word [ebp + eax*4]
inc eax
mov word [ebp + ecx*4], ax
dec ecx
dec esi
jne 0x4085c0
cmp edx, 3
jb 0x408625
inc ecx
nop
nop
nop
nop
nop
nop
movzx eax, word [ebp + ecx*4 - 4]
movzx eax, word [ebp + eax*4]
inc eax
mov word [ebp + ecx*4 - 4], ax
movzx eax, word [ebp + ecx*4 - 8]
movzx eax, word [ebp + eax*4]
inc eax
mov word [ebp + ecx*4 - 8], ax
movzx eax, word [ebp + ecx*4 - 0xc]
movzx eax, word [ebp + eax*4]
inc eax
mov word [ebp + ecx*4 - 0xc], ax
movzx eax, word [ebp + ecx*4 - 0x10]
movzx eax, word [ebp + eax*4]
inc eax
mov word [ebp + ecx*4 - 0x10], ax
add ecx, 0xfffffffc
jne 0x4085e0
mov eax, dword [esp]
lea ecx, [eax - 2]
mov edi, 1
xor edx, edx
mov esi, dword [esp + 0x10]
jmp 0x40864c
lea edi, [eax + eax]
inc edx
test eax, eax
je 0x408723
test ecx, ecx
mov dword [esp + 4], edi
js 0x408680
lea eax, [ecx + 1]
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
mov ebx, eax
movzx eax, word [ebp + ecx*4]
cmp edx, eax
jne 0x408690
inc edi
dec ecx
mov eax, ebx
cmp ebx, edi
jne 0x408660
mov ecx, 0xffffffff
jmp 0x408692
xor eax, eax
sub edi, eax
jle 0x408640
jmp 0x4086a1
mov eax, edi
mov ebx, dword [esp + 0x15c4]
mov edi, dword [esp + 4]
sub edi, eax
jle 0x408640
and edi, 3
je 0x4086df
mov dword [esp + 0xc], eax
mov dword [esp + 0x10], esi
lea eax, [esi*4]
add eax, ebp
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
mov word [eax], dx
inc esi
add eax, 0xfffffffc
cmp edi, esi
jne 0x4086c0
mov edi, dword [esp + 4]
sub edi, esi
mov ebx, dword [esp + 0x10]
sub ebx, esi
mov esi, ebx
mov eax, dword [esp + 0xc]
jmp 0x4086e3
mov edi, dword [esp + 4]
mov ebx, eax
sub eax, dword [esp + 4]
cmp eax, 0xfffffffc
mov eax, ebx
mov ebx, dword [esp + 0x15c4]
ja 0x408640
nop
nop
nop
nop
nop
mov word [ebp + esi*4], dx
mov word [ebp + esi*4 - 4], dx
mov word [ebp + esi*4 - 8], dx
mov word [ebp + esi*4 - 0xc], dx
add esi, 0xfffffffc
add edi, 0xfffffffc
cmp edi, eax
jg 0x408700
jmp 0x408640
cmp dword [esp], 0
mov edi, dword [esp + 0x1c]
jle 0x4088c5
mov eax, dword [esp]
lea edx, [eax - 1]
and eax, 3
xor ecx, ecx
cmp edx, 3
jb 0x40877b
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x28]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x28]
add ecx, 4
cmp edx, ecx
jne 0x408750
test eax, eax
je 0x40879d
lea ecx, [ecx*4]
add ecx, ebp
xor edx, edx
nop
nop
nop
nop
nop
nop
movzx esi, word [ecx + edx*4]
inc dword [esp + esi*4 + 0x28]
inc edx
cmp eax, edx
jne 0x408790
cmp dword [esp], 2
jl 0x4088c5
cmp ebx, 0x20
jge 0x408810
mov eax, dword [esp + ebx*4 + 0x28]
mov edx, ebx
neg edx
mov ecx, ebx
and edx, 3
je 0x4087cc
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
inc ecx
mov dword [esp + ebx*4 + 0x28], eax
dec edx
jne 0x4087c0
lea edx, [ebx - 0x1d]
cmp edx, 3
jb 0x408808
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + ecx*4 + 0x2c]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x30]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x34]
mov dword [esp + ebx*4 + 0x28], eax
add eax, dword [esp + ecx*4 + 0x38]
add ecx, 4
mov dword [esp + ebx*4 + 0x28], eax
cmp ecx, 0x20
jne 0x4087e0
test ebx, ebx
jle 0x4088b5
xor eax, eax
mov edx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x28]
mov ecx, ebx
sub ecx, edx
shl esi, cl
add eax, esi
mov ecx, edx
not ecx
lea edx, [ecx + edx*2]
test edx, edx
jg 0x408820
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408b3d
jmp 0x4088c5
mov ecx, esi
and ecx, 0x7ffffffe
mov eax, dword [esp + 8]
lea edx, [ebx + eax]
add edx, 0x8194
xor eax, eax
xor edi, edi
jmp 0x40887b
add eax, 2
cmp ecx, eax
je 0x4082c3
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408896
mov word [esp + edi*4 + 0xac], si
mov word [esp + edi*4 + 0xae], ax
inc edi
movzx esi, word [edx + eax*2]
test si, si
je 0x408870
mov word [esp + edi*4 + 0xac], si
lea esi, [eax + 1]
mov word [esp + edi*4 + 0xae], si
inc edi
jmp 0x408870
mov edx, 1
mov ecx, ebx
shl edx, cl
xor eax, eax
jmp 0x408b3d
shl edi, 5
mov esi, dword [esp + 8]
lea eax, [esi + edi]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.00408c90
add esp, 0xc
mov eax, dword [esp + 0x20]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.00408c90
add esp, 0xc
test ebx, ebx
mov edx, dword [esp]
jle 0x4089e0
lea eax, [ebx + 1]
mov dword [esp + 4], eax
cmp eax, 3
jge 0x40891e
mov dword [esp + 4], 2
add ebp, 0xfffffffe
mov ecx, 1
add edi, dword [esp + 8]
mov dword [esp + 0x14], ebp
jmp 0x40893e
mov edx, dword [esp]
inc ecx
cmp ecx, dword [esp + 4]
je 0x4089e0
mov dword [esp], edx
mov edx, dword [esp + ecx*4 + 0x28]
test edx, edx
jle 0x408930
mov esi, edx
and esi, 3
je 0x408990
mov eax, dword [esp]
lea eax, [eax*4]
add eax, ebp
mov ebp, edi
xor edi, edi
movzx ebx, word [eax]
mov byte [ebx + ebp + 0x8f12], cl
inc edi
add eax, 0xfffffffc
cmp esi, edi
jne 0x408960
sub dword [esp], edi
mov esi, edx
sub esi, edi
mov ebx, dword [esp + 0x15c4]
mov edi, ebp
mov ebp, dword [esp + 0x14]
jmp 0x408992
mov esi, edx
cmp edx, 4
mov edx, dword [esp]
jb 0x408933
dec esi
nop
nop
nop
nop
nop
movzx eax, word [ebp + edx*4]
mov byte [eax + edi + 0x8f12], cl
movzx eax, word [ebp + edx*4 - 4]
mov byte [eax + edi + 0x8f12], cl
movzx eax, word [ebp + edx*4 - 8]
mov byte [eax + edi + 0x8f12], cl
movzx eax, word [ebp + edx*4 - 0xc]
add edx, 0xfffffffc
mov byte [eax + edi + 0x8f12], cl
add esi, 0xfffffffc
cmp esi, 0xfffffffe
jb 0x4089a0
jmp 0x408933
mov ecx, dword [esp + 0x15c0]
mov dword [esp + 0x530], 0
cmp ebx, 2
jl 0x408a5d
lea ecx, [ebx - 1]
cmp ebx, 2
jne 0x408a08
xor eax, eax
mov edx, 2
jmp 0x408a44
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x534], eax
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x538], eax
add edx, 2
cmp ebx, edx
jne 0x408a20
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15c0]
je 0x408a5d
add eax, dword [esp + edx*4 + 0x24]
add eax, eax
mov dword [esp + edx*4 + 0x52c], eax
test ecx, ecx
jle 0x408b32
xor eax, eax
mov edx, dword [esp + 0x18]
lea edi, [edx + edx*8]
mov edx, edi
shl edx, 5
mov esi, dword [esp + 8]
add edx, esi
shl edi, 6
add edi, esi
mov dword [esp], edi
jmp 0x408aab
mov ecx, dword [esp]
mov word [ecx + eax*2 + 0x8852], di
mov ecx, dword [esp + 0x15c0]
inc eax
cmp eax, ecx
je 0x408b32
movzx ebx, byte [eax + edx + 0x8f12]
test ebx, ebx
je 0x408aa2
mov ecx, dword [esp + ebx*4 + 0x52c]
lea edi, [ecx + 1]
mov dword [esp + ebx*4 + 0x52c], edi
xor edi, edi
cmp bl, 4
jb 0x408b0f
mov ebp, ebx
and ebp, 0xfffffffc
xor edi, edi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
shl esi, 2
lea esi, [esi + edi*8]
mov edi, ecx
and edi, 2
or edi, esi
mov esi, ecx
shr esi, 2
and esi, 1
or esi, edi
mov edi, ecx
shr edi, 3
and edi, 1
lea edi, [edi + esi*2]
shr ecx, 4
add ebp, 0xfffffffc
jne 0x408ae0
and ebx, 3
je 0x408a90
nop
nop
nop
nop
nop
nop
nop
nop
mov esi, ecx
and esi, 1
lea edi, [esi + edi*2]
shr ecx, 1
dec ebx
jne 0x408b20
jmp 0x408a90
add esp, 0x15ac
pop esi
pop edi
pop ebx
pop ebp
ret
dec dword [esp + ebx*4 + 0x28]
mov ecx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408b68
mov esi, dword [esp + ecx*4 + 0x24]
dec ecx
test esi, esi
je 0x408b50
dec esi
mov dword [esp + ecx*4 + 0x28], esi
add dword [esp + ecx*4 + 0x2c], 2
dec eax
cmp eax, edx
jne 0x408b3d
jmp 0x4088c5