Function at 0x407e10
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b8
call fcn.00408860
mov ebx, edx
mov edi, ecx
mov esi, dword [esp + 0x15cc]
lea eax, [esp + 0x34]
push 0x84
push 0
push eax
call fcn.004089a0
add esp, 0xc
cmp dword [esp + 0x15d4], 0
mov dword [esp + 0x20], ebx
je 0x407ecc
test esi, esi
mov ecx, esi
jle 0x4086d0
xor eax, eax
cmp ecx, 1
je 0x407e98
mov ecx, dword [esp + 0x15cc]
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
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 0x407e80
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x4086d0
mov ecx, dword [esp + 0x20]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
mov ecx, dword [esp + 0x15cc]
inc dword [esp + eax*4 + 0x34]
jmp 0x4086d0
lea eax, [ebx + ebx*8]
mov dword [esp + 0x18], eax
shl eax, 6
test esi, esi
mov dword [esp + 0x14], edi
mov dword [esp + 0x24], eax
jle 0x407fc9
cmp esi, 1
jne 0x40823d
xor eax, eax
xor ebx, ebx
mov ecx, dword [esp + 0x15cc]
test cl, 1
je 0x407f25
mov ecx, dword [esp + 0x24]
add ecx, edi
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407f25
mov word [esp + ebx*4 + 0x4b8], cx
mov word [esp + ebx*4 + 0x4ba], ax
inc ebx
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.004089a0
add esp, 0xc
test ebx, ebx
sete byte [esp + 7]
je 0x407fe0
xor eax, eax
cmp ebx, 1
je 0x407f9f
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0x4b8]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
movzx edx, word [esp + eax*4 + 0x4bc]
movzx esi, dl
inc dword [esp + esi*4 + 0x938]
shr edx, 8
inc dword [esp + edx*4 + 0xd38]
add eax, 2
cmp ecx, eax
jne 0x407f60
test bl, 1
je 0x407fc0
movzx eax, word [esp + eax*4 + 0x4b8]
movzx ecx, al
inc dword [esp + ecx*4 + 0x938]
shr eax, 8
inc dword [esp + eax*4 + 0xd38]
mov eax, dword [esp + 0xd38]
jmp 0x407fe9
lea eax, [esp + 0x938]
push 0x800
push 0
push eax
call fcn.004089a0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 7], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x30], eax
lea eax, [ebx - 1]
mov dword [esp + 0x10], eax
mov eax, ebx
and eax, 0xfffffffe
mov dword [esp + 0x1c], eax
lea ebp, [esp + 0x4b8]
lea edx, [esp + 0x1138]
xor ecx, ecx
lea eax, [esp + 0x938]
mov dword [esp + 0x28], 0
mov dword [esp], ebx
jmp 0x408053
mov esi, dword [esp + 0x28]
inc esi
add ecx, 8
add eax, 0x400
mov edx, dword [esp + 8]
mov dword [esp + 0x28], esi
cmp esi, dword [esp + 0x30]
mov ebp, dword [esp + 0xc]
je 0x40816e
mov esi, ebp
mov dword [esp + 0xc], edx
mov ebp, 3
xor edx, edx
mov dword [esp + ebp*4 + 0xac], edx
add edx, dword [eax + ebp*4 - 0xc]
mov dword [esp + ebp*4 + 0xb0], edx
add edx, dword [eax + ebp*4 - 8]
mov dword [esp + ebp*4 + 0xb4], edx
add edx, dword [eax + ebp*4 - 4]
mov dword [esp + ebp*4 + 0xb8], edx
add edx, dword [eax + ebp*4]
add ebp, 4
cmp ebp, 0x103
jne 0x408060
mov dword [esp + 8], esi
cmp byte [esp + 7], 0
jne 0x408030
mov dword [esp + 0x2c], eax
cmp dword [esp + 0x10], 0
je 0x40811f
xor ebp, ebp
nop
nop
mov eax, dword [esp + 8]
movzx edx, word [eax + ebp*4]
shr edx, cl
mov ebx, edx
xor ebx, 0x3fffff00
or edx, 0xff
and edx, ebx
mov ebx, dword [esp + edx*4 + 0xb8]
mov edi, dword [eax + ebp*4]
mov esi, dword [esp + 0xc]
mov dword [esi + ebx*4], edi
lea edi, [ebx + 1]
movzx ebx, word [eax + ebp*4 + 4]
shr ebx, cl
mov dword [esp + edx*4 + 0xb8], edi
mov edx, ebx
xor edx, 0x3fffff00
or ebx, 0xff
and ebx, edx
mov edx, dword [esp + ebx*4 + 0xb8]
lea edi, [edx + 1]
mov dword [esp + ebx*4 + 0xb8], edi
mov edi, dword [eax + ebp*4 + 4]
mov dword [esi + edx*4], edi
add ebp, 2
cmp dword [esp + 0x1c], ebp
jne 0x4080b0
jmp 0x408121
xor ebp, ebp
mov ebx, dword [esp]
test bl, 1
mov eax, dword [esp + 0x2c]
je 0x408030
mov esi, dword [esp + 8]
movzx edx, word [esi + ebp*4]
shr edx, cl
mov edi, edx
xor edi, 0x3fffff00
or edx, 0xff
and edx, edi
mov edi, dword [esp + edx*4 + 0xb8]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0xb8], ebx
mov ebx, dword [esp]
mov edx, dword [esi + ebp*4]
mov esi, dword [esp + 0xc]
mov dword [esi + edi*4], edx
jmp 0x408030
test ebx, ebx
je 0x408587
cmp dword [esp], 1
jne 0x408187
mov word [ebp], 1
jmp 0x40844d
movzx eax, word [ebp + 4]
add word [ebp], ax
cmp dword [esp + 0x10], 2
jl 0x4082a5
mov eax, 2
mov ecx, 2
sub ecx, dword [esp]
mov dword [esp + 8], ecx
xor edx, edx
mov esi, 1
jmp 0x4081e2
movzx ecx, word [ebx + edx*4]
mov edi, ebx
add word [edi + esi*4], cx
mov word [edi + edx*4], si
inc edx
mov ebp, edi
mov ecx, dword [esp + 8]
add ecx, esi
inc ecx
inc esi
cmp ecx, 1
je 0x4082c3
movzx ecx, word [ebp + edx*4]
mov edi, dword [esp]
cmp eax, edi
mov ebx, ebp
jge 0x4081f9
movzx ebp, word [ebx + eax*4]
cmp cx, bp
jae 0x408210
mov word [ebx + esi*4], cx
mov word [ebx + edx*4], si
inc edx
cmp eax, edi
jge 0x4081c0
jmp 0x408219
inc eax
mov word [ebx + esi*4], bp
cmp eax, edi
jge 0x4081c0
cmp edx, esi
jge 0x408230
movzx ecx, word [ebx + edx*4]
mov edi, ebx
movzx ebp, word [ebx + eax*4]
cmp cx, bp
jb 0x4081c6
jmp 0x408236
mov edi, ebx
movzx ebp, word [ebx + eax*4]
inc eax
add word [edi + esi*4], bp
jmp 0x4081cf
mov ecx, esi
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebx, ebx
jmp 0x40826b
add eax, 2
cmp ecx, eax
je 0x407ef3
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408286
mov word [esp + ebx*4 + 0x4b8], si
mov word [esp + ebx*4 + 0x4ba], ax
inc ebx
movzx esi, word [edx + eax*2]
test si, si
je 0x408260
mov word [esp + ebx*4 + 0x4b8], si
lea esi, [eax + 1]
mov word [esp + ebx*4 + 0x4ba], si
inc ebx
jmp 0x408260
mov ecx, dword [esp]
mov eax, ecx
or eax, 0x3ffffffd
and ecx, 0x3ffffffd
add ecx, eax
mov word [ebp + ecx*4 + 4], 0
jmp 0x40833f
mov edx, dword [esp]
mov eax, edx
or eax, 0x3ffffffd
mov ecx, edx
and ecx, 0x3ffffffd
add ecx, eax
mov word [ebp + ecx*4 + 4], 0
cmp edx, 3
jl 0x40833f
mov edx, dword [esp]
lea ecx, [edx - 3]
mov eax, ecx
test dl, 1
je 0x40830b
mov edx, dword [esp]
movzx eax, word [ebp + edx*4 - 0xc]
movzx eax, word [ebp + eax*4]
inc eax
mov word [ebp + edx*4 - 0xc], ax
lea eax, [ecx + ecx]
sub eax, edx
add eax, 2
test ecx, ecx
je 0x40833f
nop
movzx ecx, word [ebp + eax*4]
movzx ecx, word [ebp + ecx*4]
inc ecx
mov word [ebp + eax*4], cx
mov ecx, eax
not ecx
lea ecx, [ecx + eax*2]
movzx edx, word [ebp + ecx*4]
movzx edx, word [ebp + edx*4]
inc edx
mov word [ebp + ecx*4], dx
add ecx, ecx
sub ecx, eax
mov eax, ecx
jns 0x408310
mov eax, dword [esp]
lea ecx, [eax - 2]
xor edi, edi
mov esi, 1
mov edx, dword [esp + 0x10]
jmp 0x40836c
lea esi, [ebx + ebx]
inc edi
test ebx, ebx
jle 0x408443
test ecx, ecx
js 0x4083a0
lea ebx, [ecx + 1]
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov eax, dword [esp + 0xc]
movzx eax, word [eax + ecx*4]
cmp edi, eax
jne 0x4083b0
inc ebp
mov eax, ecx
not eax
lea ecx, [eax + ecx*2]
cmp ebx, ebp
jne 0x408380
mov ecx, 0xffffffff
jmp 0x4083b2
xor ebx, ebx
jmp 0x4083b6
mov ebx, ebp
mov ebp, dword [esp + 0xc]
mov eax, esi
sub eax, ebx
jle 0x408360
mov dword [esp + 8], eax
mov eax, ebx
not eax
add eax, esi
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 8]
and eax, 3
je 0x408407
mov dword [esp + 8], ebx
mov ebx, eax
lea eax, [edx*4]
add eax, ebp
xor ebp, ebp
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [eax], di
inc ebp
add eax, 0xfffffffc
cmp ebx, ebp
jne 0x4083f0
sub edx, ebp
sub esi, ebp
mov ebp, dword [esp + 0xc]
mov ebx, dword [esp + 8]
mov eax, dword [esp + 0x1c]
cmp eax, 3
jb 0x408360
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [ebp + edx*4], di
mov word [ebp + edx*4 - 4], di
mov word [ebp + edx*4 - 8], di
mov word [ebp + edx*4 - 0xc], di
add edx, 0xfffffffc
add esi, 0xfffffffc
cmp esi, ebx
jg 0x408420
jmp 0x408360
cmp dword [esp], 0
jle 0x408587
mov eax, dword [esp]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x10], 3
jb 0x40849b
mov edx, dword [esp]
and edx, 0xfffffffc
xor ecx, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx esi, word [ebp + ecx*4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 4]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 8]
inc dword [esp + esi*4 + 0x34]
movzx esi, word [ebp + ecx*4 + 0xc]
inc dword [esp + esi*4 + 0x34]
add ecx, 4
cmp edx, ecx
jne 0x408470
test eax, eax
je 0x4084bd
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 + 0x34]
inc edx
cmp eax, edx
jne 0x4084b0
cmp dword [esp], 2
jl 0x408587
mov edx, dword [esp + 0x15d0]
cmp edx, 0x20
jge 0x40853c
mov eax, dword [esp + edx*4 + 0x34]
mov esi, edx
neg edx
mov ecx, esi
and edx, 3
je 0x4084fc
nop
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 0x4084f0
lea edx, [esi - 0x1d]
cmp edx, 3
mov edx, esi
jb 0x408538
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 0x408510
test edx, edx
jle 0x408577
inc edx
xor ecx, ecx
xor eax, eax
nop
nop
nop
nop
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 0x408550
mov edx, 1
mov ecx, dword [esp + 0x15d0]
shl edx, cl
cmp eax, edx
jne 0x40881d
jmp 0x408587
mov ecx, edx
mov edx, 1
shl edx, cl
xor eax, eax
jmp 0x40881d
mov ebx, dword [esp + 0x18]
shl ebx, 5
mov edi, dword [esp + 0x14]
mov esi, ebx
lea eax, [edi + ebx]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.004089a0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, edi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.004089a0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
jle 0x4086c5
add ebp, 0xfffffffe
mov eax, 1
mov dword [esp + 0xc], ebp
mov dword [esp + 0x18], esi
jmp 0x408610
mov edi, ebp
mov ebp, dword [esp]
mov ebx, esi
mov esi, ebx
mov dword [esp], ebp
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15d0]
mov eax, ecx
mov ebp, edi
je 0x4086c5
mov ecx, dword [esp + eax*4 + 0x34]
test ecx, ecx
jle 0x4085f0
mov edx, ecx
and edx, 3
je 0x408660
mov dword [esp + 8], ecx
mov ecx, dword [esp + 0x14]
mov esi, dword [esp]
lea ebp, [ebp + esi*4]
xor esi, esi
movzx edi, word [ebp]
mov ebx, dword [esp + 0x18]
add ebx, ecx
mov byte [edi + ebx + 0x8f12], al
inc esi
add ebp, 0xfffffffc
cmp edx, esi
jne 0x408630
mov ecx, dword [esp + 8]
mov edx, ecx
sub edx, esi
sub dword [esp], esi
mov esi, dword [esp + 0x18]
jmp 0x408662
mov edx, ecx
cmp ecx, 4
mov ebp, dword [esp]
mov edi, dword [esp + 0xc]
mov ebx, esi
jb 0x4085f7
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebp*4]
mov esi, dword [esp + 0x14]
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 0x408680
jmp 0x4085f7
mov ecx, dword [esp + 0x15cc]
mov edi, dword [esp + 0x14]
mov dword [esp + 0x93c], 0
mov eax, dword [esp + 0x15d0]
cmp eax, 2
jl 0x40874d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x4086f8
xor eax, eax
mov edx, 2
jmp 0x408734
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 + 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 0x408710
add edx, 2
test cl, 1
mov ecx, dword [esp + 0x15cc]
je 0x40874d
add eax, dword [esp + edx*4 + 0x30]
add eax, eax
mov dword [esp + edx*4 + 0x938], eax
test ecx, ecx
jle 0x408812
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 + 0xc], ecx
jmp 0x40878a
mov ecx, dword [esp + 0xc]
mov word [ecx + eax*2 + 0x8852], bx
inc eax
cmp eax, dword [esp + 0x15cc]
je 0x408812
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x40877c
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 0x4087ef
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 0x4087c0
test edi, edi
je 0x408770
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 0x408800
jmp 0x408770
add esp, 0x15b8
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [esp + 0x15d0]
dec dword [esp + ecx*4 + 0x34]
nop
nop
nop
nop
nop
nop
nop
nop
cmp ecx, 2
jl 0x408848
mov esi, dword [esp + ecx*4 + 0x30]
dec ecx
test esi, esi
je 0x408830
dec esi
mov dword [esp + ecx*4 + 0x34], esi
add dword [esp + ecx*4 + 0x38], 2
dec eax
cmp eax, edx
jne 0x40881d
jmp 0x408587