Function at 0x407e50
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
mov eax, 0x15b4
call fcn.004088a0
mov esi, edx
mov edi, ecx
mov ebx, dword [esp + 0x15c8]
lea eax, [esp + 0x30]
push 0x84
push 0
push eax
call fcn.004089e0
add esp, 0xc
cmp dword [esp + 0x15d0], 0
mov dword [esp + 0x18], esi
je 0x407efe
test ebx, ebx
jle 0x408700
xor eax, eax
cmp ebx, 1
je 0x407ed8
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
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 0x407ec0
test bl, 1
je 0x408700
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
shl ecx, 5
add ecx, edi
movzx eax, byte [eax + ecx + 0x8f12]
inc dword [esp + eax*4 + 0x30]
jmp 0x408700
lea eax, [esi + esi*8]
mov dword [esp + 0x14], eax
shl eax, 6
test ebx, ebx
mov dword [esp + 0x10], edi
mov dword [esp + 0x24], eax
jle 0x407ff9
cmp ebx, 1
jne 0x4084d7
xor eax, eax
xor ebp, ebp
test bl, 1
mov ebx, ebp
mov edx, dword [esp + 0x10]
je 0x407f56
mov ecx, dword [esp + 0x24]
add ecx, edx
add ecx, 0x8192
movzx ecx, word [ecx + eax*2]
test cx, cx
je 0x407f56
mov word [esp + ebx*4 + 0xb4], cx
mov word [esp + ebx*4 + 0xb6], ax
inc ebx
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.004089e0
add esp, 0xc
test ebx, ebx
sete byte [esp + 0xf]
je 0x408010
xor eax, eax
cmp ebx, 1
je 0x407fcf
mov ecx, ebx
and ecx, 0xfffffffe
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [esp + eax*4 + 0xb4]
movzx esi, dl
inc dword [esp + esi*4 + 0x934]
shr edx, 8
inc dword [esp + edx*4 + 0xd34]
movzx edx, word [esp + eax*4 + 0xb8]
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 0x407f90
test bl, 1
je 0x407ff0
movzx eax, word [esp + eax*4 + 0xb4]
movzx ecx, al
inc dword [esp + ecx*4 + 0x934]
shr eax, 8
inc dword [esp + eax*4 + 0xd34]
mov eax, dword [esp + 0xd34]
jmp 0x408019
lea eax, [esp + 0x934]
push 0x800
push 0
push eax
call fcn.004089e0
add esp, 0xc
xor ebx, ebx
mov byte [esp + 0xf], 1
xor eax, eax
xor ecx, ecx
cmp eax, ebx
sete cl
mov eax, 2
sub eax, ecx
mov dword [esp + 0x28], eax
lea eax, [ebx - 1]
mov dword [esp + 0x1c], eax
mov dword [esp + 4], ebx
and ebx, 0xfffffffe
lea eax, [esp + 0xb4]
mov dword [esp], eax
lea eax, [esp + 0x1134]
xor ecx, ecx
lea esi, [esp + 0x938]
xor edx, edx
mov dword [esp + 0x20], ebx
jmp 0x408082
mov edx, dword [esp + 0x2c]
inc edx
mov eax, ecx
and eax, 8
xor ecx, 8
lea ecx, [ecx + eax*2]
add esi, 0x400
mov eax, edi
cmp edx, dword [esp + 0x28]
je 0x40819c
mov dword [esp + 0x2c], edx
mov edx, dword [esp]
mov dword [esp + 8], edx
mov dword [esp], eax
xor ebx, ebx
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov dword [esp + eax*4 + 0x534], ebx
mov edi, dword [esi + eax*4 - 4]
mov edx, edi
and edx, ebx
xor edi, ebx
lea edx, [edi + edx*2]
mov dword [esp + eax*4 + 0x538], edx
mov edi, dword [esi + eax*4]
mov ebx, edi
and ebx, edx
xor edi, edx
lea ebx, [edi + ebx*2]
add eax, 2
cmp eax, 0x100
jne 0x4080a0
cmp byte [esp + 0xf], 0
mov edi, dword [esp + 8]
jne 0x408060
cmp dword [esp + 0x1c], 0
je 0x40815f
xor eax, eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0x534]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0x534], ebx
mov edx, dword [esp + 8]
mov edx, dword [edx + eax*4]
mov ebp, dword [esp]
mov dword [ebp + edi*4], edx
mov edx, dword [esp + 8]
movzx edx, word [edx + eax*4 + 4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0x534]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0x534], ebx
mov edx, dword [esp + 8]
mov edx, dword [edx + eax*4 + 4]
mov dword [ebp + edi*4], edx
mov edi, dword [esp + 8]
mov ebx, dword [esp + 0x20]
add eax, 2
cmp ebx, eax
jne 0x4080f0
test byte [esp + 4], 1
je 0x408060
jmp 0x40816c
xor eax, eax
test byte [esp + 4], 1
je 0x408060
movzx edx, word [edi + eax*4]
shr edx, cl
movzx edx, dl
mov edi, dword [esp + edx*4 + 0x534]
lea ebx, [edi + 1]
mov dword [esp + edx*4 + 0x534], ebx
mov edx, dword [esp + 8]
mov eax, dword [edx + eax*4]
mov edx, dword [esp]
mov dword [edx + edi*4], eax
mov edi, dword [esp + 8]
jmp 0x408060
cmp dword [esp + 4], 0
je 0x4085b8
mov ecx, dword [esp + 4]
cmp ecx, 1
jne 0x4081bd
mov eax, dword [esp]
mov word [eax], 1
jmp 0x40843d
mov edx, dword [esp]
movzx eax, word [edx + 4]
add word [edx], ax
mov eax, ecx
xor eax, 0xfffffffe
lea edx, [ecx + ecx]
mov dword [esp + 8], edx
and edx, 0xfffffffc
lea esi, [eax + edx]
inc esi
cmp esi, 2
jl 0x40828e
add eax, edx
neg eax
xor esi, esi
mov edx, 2
mov ebp, 1
jmp 0x40821a
mov ecx, dword [esp]
movzx ebx, word [ecx + esi*4]
add word [ecx + ebp*4], bx
mov word [ecx + esi*4], bp
inc esi
lea edi, [eax + ebp]
inc edi
inc ebp
cmp edi, 1
je 0x40828e
mov ecx, dword [esp]
movzx edi, word [ecx + esi*4]
cmp edx, dword [esp + 4]
jge 0x408230
movzx ebx, word [ecx + edx*4]
cmp di, bx
jae 0x408250
mov word [ecx + ebp*4], di
mov edi, esi
mov word [ecx + esi*4], bp
and esi, 1
xor edi, 1
lea esi, [edi + esi*2]
cmp edx, dword [esp + 4]
jge 0x408200
jmp 0x40825b
inc edx
mov word [ecx + ebp*4], bx
cmp edx, dword [esp + 4]
jge 0x408200
cmp esi, ebp
jge 0x408280
mov ecx, dword [esp]
movzx ebx, word [ecx + esi*4]
movzx edi, word [ecx + edx*4]
cmp bx, di
jb 0x408207
jmp 0x408287
mov ecx, dword [esp]
movzx edi, word [ecx + edx*4]
inc edx
add word [ecx + ebp*4], di
jmp 0x408210
mov eax, dword [esp + 4]
mov ebx, dword [esp]
mov word [ebx + eax*4 - 8], 0
cmp eax, 3
jl 0x408321
mov eax, dword [esp + 4]
lea edx, [eax - 3]
lea esi, [eax + 2]
mov eax, edx
and esi, 3
je 0x4082d1
mov eax, edx
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebx + eax*4]
movzx edi, word [ebx + edi*4]
inc edi
mov word [ebx + eax*4], di
dec eax
dec esi
jne 0x4082c0
cmp edx, 3
jb 0x408321
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 0x4082e0
mov eax, dword [esp + 4]
xor eax, 0xfffffffd
mov ecx, dword [esp + 8]
and ecx, 0xfffffffa
add ecx, eax
inc ecx
mov esi, 1
xor edx, edx
mov eax, dword [esp + 0x1c]
jmp 0x408368
mov ebp, edi
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 esi, ebp
test ebp, ebp
jle 0x408432
test ecx, ecx
js 0x4083a0
lea edi, [ecx + 1]
mov dword [esp + 8], edi
xor ebx, ebx
mov ebp, dword [esp]
nop
nop
nop
nop
nop
nop
nop
nop
movzx edi, word [ebp + ecx*4]
cmp edx, edi
jne 0x4083b0
inc ebx
add ecx, 0xffffffff
jb 0x408380
mov ecx, 0xffffffff
mov edi, dword [esp + 8]
jmp 0x4083b2
xor edi, edi
jmp 0x4083b2
mov edi, ebx
mov ebp, esi
sub ebp, edi
jle 0x408340
mov dword [esp + 8], edi
not edi
add edi, esi
and ebp, 3
je 0x4083f3
mov dword [esp + 0x20], edi
mov edi, dword [esp]
lea edi, [edi + eax*4]
xor ebx, ebx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
mov word [edi], dx
inc ebx
add edi, 0xfffffffc
cmp ebp, ebx
jne 0x4083e0
sub eax, ebx
sub esi, ebx
mov edi, dword [esp + 0x20]
cmp edi, 3
mov edi, dword [esp]
mov ebp, dword [esp + 8]
jb 0x408342
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 esi, 0xfffffffc
cmp esi, ebp
jg 0x408410
jmp 0x408342
cmp dword [esp + 4], 0
jle 0x4085b8
mov eax, dword [esp + 4]
and eax, 3
xor ecx, ecx
cmp dword [esp + 0x1c], 3
mov edi, dword [esp]
jb 0x40848a
mov edx, dword [esp + 4]
and edx, 0xfffffffc
xor ecx, ecx
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 0x408460
test eax, eax
je 0x4084ad
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 + 0x30]
inc edx
cmp eax, edx
jne 0x4084a0
cmp dword [esp + 4], 2
jl 0x4085b8
mov ecx, dword [esp + 0x15cc]
cmp ecx, 0x20
jge 0x408584
mov ebp, dword [esp + ecx*4 + 0x30]
mov edi, ecx
test cl, 1
jne 0x408535
mov eax, ecx
jmp 0x408549
mov ecx, ebx
and ecx, 0xfffffffe
lea edx, [eax + edi]
add edx, 0x8194
xor eax, eax
xor ebp, ebp
jmp 0x4084fb
add eax, 2
cmp ecx, eax
je 0x407f25
movzx esi, word [edx + eax*2 - 2]
test si, si
je 0x408516
mov word [esp + ebp*4 + 0xb4], si
mov word [esp + ebp*4 + 0xb6], ax
inc ebp
movzx esi, word [edx + eax*2]
test si, si
je 0x4084f0
mov word [esp + ebp*4 + 0xb4], si
lea esi, [eax + 1]
mov word [esp + ebp*4 + 0xb6], si
inc ebp
jmp 0x4084f0
lea eax, [ecx + 1]
mov edx, dword [esp + ecx*4 + 0x34]
mov esi, edx
and esi, ebp
xor edx, ebp
lea ebp, [edx + esi*2]
mov dword [esp + ecx*4 + 0x30], ebp
cmp edi, 0x1f
je 0x40857a
nop
nop
mov edx, dword [esp + eax*4 + 0x34]
mov esi, edx
and esi, ebp
xor edx, ebp
lea ecx, [edx + esi*2]
mov dword [esp + edi*4 + 0x30], ecx
mov edx, dword [esp + eax*4 + 0x38]
add eax, 2
mov esi, edx
and esi, ecx
xor edx, ecx
lea ebp, [edx + esi*2]
mov dword [esp + edi*4 + 0x30], ebp
cmp eax, 0x20
jne 0x408550
test edi, edi
mov ecx, edi
jle 0x40884d
mov edx, ecx
xor eax, eax
mov ebx, ecx
nop
nop
nop
nop
nop
nop
mov esi, dword [esp + edx*4 + 0x30]
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 0x408590
mov edx, 1
mov ecx, ebx
shl edx, cl
cmp eax, edx
jne 0x408856
mov ebx, dword [esp + 0x14]
shl ebx, 5
mov esi, dword [esp + 0x10]
mov dword [esp + 0x14], ebx
lea eax, [esi + ebx]
add eax, 0x8f12
push 0x120
push 0
push eax
call fcn.004089e0
add esp, 0xc
mov eax, dword [esp + 0x24]
add eax, esi
add eax, 0x8852
push 0x240
push 0
push eax
call fcn.004089e0
add esp, 0xc
cmp dword [esp + 0x15cc], 0
jle 0x4086f5
add dword [esp], 0xfffffffe
mov eax, 1
jmp 0x40863a
mov ebx, dword [esp + 4]
mov dword [esp + 4], ebx
lea ecx, [eax + 1]
cmp eax, dword [esp + 0x15cc]
mov eax, ecx
je 0x4086f5
mov ecx, dword [esp + eax*4 + 0x30]
test ecx, ecx
jle 0x408620
mov edx, ecx
and edx, 3
je 0x408690
mov dword [esp + 8], ecx
mov ecx, dword [esp + 4]
mov esi, dword [esp]
lea ebx, [esi + ecx*4]
xor esi, esi
mov ecx, dword [esp + 0x14]
nop
nop
nop
movzx edi, word [ebx]
mov ebp, dword [esp + 0x10]
add ebp, ecx
mov byte [edi + ebp + 0x8f12], al
inc esi
add ebx, 0xfffffffc
cmp edx, esi
jne 0x408660
sub dword [esp + 4], esi
mov ecx, dword [esp + 8]
mov edx, ecx
sub edx, esi
jmp 0x408692
mov edx, ecx
cmp ecx, 4
mov ebx, dword [esp + 4]
mov edi, dword [esp]
mov ebp, dword [esp + 0x10]
jb 0x408624
dec edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ecx, word [edi + ebx*4]
mov esi, dword [esp + 0x14]
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 0x4086b0
jmp 0x408624
mov ebx, dword [esp + 0x15c8]
mov edi, dword [esp + 0x10]
mov dword [esp + 0x938], 0
mov eax, dword [esp + 0x15cc]
cmp eax, 2
jl 0x40877d
lea ecx, [eax - 1]
cmp eax, 2
jne 0x40872d
xor eax, eax
mov edx, 2
test cl, 1
jne 0x408770
jmp 0x40877d
mov ebx, ecx
and ebx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
add eax, dword [esp + edx*4 + 0x34]
add eax, eax
mov dword [esp + edx*4 + 0x93c], eax
add eax, dword [esp + edx*4 + 0x38]
add eax, eax
mov dword [esp + edx*4 + 0x940], eax
add edx, 2
cmp ebx, edx
jne 0x408740
add edx, 2
mov ebx, dword [esp + 0x15c8]
test cl, 1
je 0x40877d
add eax, dword [esp + edx*4 + 0x2c]
add eax, eax
mov dword [esp + edx*4 + 0x934], eax
test ebx, ebx
jle 0x408842
xor eax, eax
mov ecx, dword [esp + 0x18]
lea ecx, [ecx + ecx*8]
mov edx, ecx
shl edx, 5
add edx, edi
shl ecx, 6
add ecx, edi
mov dword [esp + 8], ecx
jmp 0x4087bc
mov ecx, dword [esp + 8]
mov word [ecx + eax*2 + 0x8852], bx
mov ebx, dword [esp + 0x15c8]
inc eax
cmp eax, ebx
je 0x408842
movzx ecx, byte [eax + edx + 0x8f12]
test ecx, ecx
je 0x4087b3
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 0x40881f
and ecx, 0xfffffffc
xor ebx, ebx
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 0x4087f0
test edi, edi
je 0x4087a0
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 0x408830
jmp 0x4087a0
add esp, 0x15b4
pop esi
pop edi
pop ebx
pop ebp
ret
mov edx, 1
shl edx, cl
xor eax, eax
mov ecx, dword [esp + 0x15cc]
dec ecx
jmp 0x408869
dec eax
cmp eax, edx
je 0x4085b8
mov esi, dword [esp + 0x15cc]
dec dword [esp + esi*4 + 0x30]
mov esi, ecx
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
test esi, esi
jle 0x408860
mov edi, dword [esp + esi*4 + 0x30]
dec esi
test edi, edi
je 0x408880
dec edi
mov dword [esp + esi*4 + 0x34], edi
add dword [esp + esi*4 + 0x38], 2
jmp 0x408860