Function at 0x4036a0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x588
lea eax, [esp + 0x40]
push ebx
push ebp
push esi
push edi
push 0x44
push eax
call fcn.00403680
mov esi, dword [esp + 0x5a4]
mov ebx, dword [esp + 0x5a8]
add esp, 8
mov ecx, esi
mov edx, ebx
mov eax, dword [ecx]
add ecx, 4
mov ebp, dword [esp + eax*4 + 0x50]
lea eax, [esp + eax*4 + 0x50]
inc ebp
dec edx
mov dword [eax], ebp
jne 0x4036cb
cmp dword [esp + 0x50], ebx
jne 0x40370c
mov ecx, dword [esp + 0x5b0]
mov edx, dword [esp + 0x5b4]
mov dword [ecx], 0
mov dword [edx], 0
pop edi
pop esi
pop ebp
xor ax, ax
pop ebx
add esp, 0x588
ret
mov edi, dword [esp + 0x5b4]
mov ecx, 1
lea eax, [esp + 0x54]
mov ebp, dword [edi]
mov dword [esp + 0x14], ebp
cmp dword [eax], 0
jne 0x403730
inc ecx
add eax, 4
cmp ecx, 0x10
jbe 0x403722
cmp ebp, ecx
mov dword [esp + 0x10], ecx
jae 0x40373e
mov dword [esp + 0x14], ecx
mov ebp, ecx
mov eax, 0x10
lea edx, [esp + 0x90]
cmp dword [edx], 0
jne 0x403757
dec eax
sub edx, 4
test eax, eax
jne 0x40374a
cmp ebp, eax
mov dword [esp + 0x38], eax
jbe 0x403765
mov dword [esp + 0x14], eax
mov ebp, eax
mov dword [edi], ebp
mov edi, 1
shl edi, cl
cmp ecx, eax
jae 0x403784
lea edx, [esp + ecx*4 + 0x50]
sub edi, dword [edx]
js 0x403790
inc ecx
add edx, 4
shl edi, 1
cmp ecx, eax
jb 0x403776
mov ecx, dword [esp + eax*4 + 0x50]
sub edi, ecx
mov dword [esp + 0x48], edi
jns 0x40379f
pop edi
pop esi
pop ebp
mov ax, 0xfffb
pop ebx
add esp, 0x588
ret
add ecx, edi
xor edx, edx
mov dword [esp + eax*4 + 0x50], ecx
xor ecx, ecx
dec eax
mov dword [esp + 0x98], edx
je 0x4037c6
mov edi, dword [esp + edx + 0x54]
add edx, 4
add ecx, edi
dec eax
mov dword [esp + edx + 0x98], ecx
jne 0x4037b3
xor edx, edx
mov eax, dword [esi]
add esi, 4
test eax, eax
je 0x4037e9
mov ecx, dword [esp + eax*4 + 0x94]
lea eax, [esp + eax*4 + 0x94]
mov dword [esp + ecx*4 + 0x118], edx
inc ecx
mov dword [eax], ecx
inc edx
cmp edx, ebx
jb 0x4037c8
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x38]
mov eax, ebp
xor edi, edi
lea ebx, [esp + 0x118]
xor esi, esi
neg eax
cmp edx, ecx
mov dword [esp + 0x30], edi
mov dword [esp + 0x94], edi
mov dword [esp + 0x24], ebx
mov dword [esp + 0x18], 0xffffffff
mov dword [esp + 0xd8], esi
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], esi
jg 0x403ac8
lea ecx, [edx - 1]
mov dword [esp + 0x34], ecx
lea ecx, [esp + edx*4 + 0x50]
mov dword [esp + 0x28], ecx
mov ecx, dword [esp + 0x28]
mov ecx, dword [ecx]
mov esi, ecx
dec ecx
test esi, esi
mov dword [esp + 0x2c], ecx
je 0x403aa1
lea ecx, [eax + ebp]
cmp edx, ecx
jle 0x40396f
mov edx, dword [esp + 0x2c]
mov edi, ecx
inc edx
mov dword [esp + 0x4c], edx
mov edx, dword [esp + 0x18]
add eax, ebp
inc edx
add edi, ebp
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x38]
sub edx, eax
mov dword [esp + 0x3c], eax
cmp edx, ebp
jbe 0x40388a
mov edx, ebp
mov ebx, dword [esp + 0x10]
sub ebx, eax
mov eax, 1
mov ecx, ebx
shl eax, cl
cmp eax, dword [esp + 0x4c]
jbe 0x4038c6
mov ebp, dword [esp + 0x2c]
or ecx, 0xffffffff
mov esi, dword [esp + 0x28]
sub ecx, ebp
add eax, ecx
inc ebx
cmp ebx, edx
jae 0x4038c6
mov ecx, dword [esi + 4]
add esi, 4
shl eax, 1
cmp eax, ecx
jbe 0x4038c6
sub eax, ecx
inc ebx
cmp ebx, edx
jb 0x4038b3
mov eax, 1
mov ecx, ebx
shl eax, cl
mov dword [esp + 0x40], eax
lea edx, [eax*8 + 8]
push edx
call fcn.00402600
add esp, 4
test eax, eax
je 0x403ae9
mov edx, dword [esp + 0x5b0]
lea ecx, [eax + 8]
add eax, 4
mov dword [esp + 0x44], ecx
mov dword [edx], ecx
mov dword [esp + 0x5b0], eax
mov dword [eax], 0
mov eax, dword [esp + 0x18]
test eax, eax
lea ebp, [esp + eax*4 + 0xd8]
mov dword [ebp], ecx
je 0x403953
mov edx, dword [esp + 0x30]
mov esi, ecx
mov ecx, dword [esp + 0x3c]
mov dword [esp + eax*4 + 0x94], edx
mov eax, dword [esp + 0x14]
add bl, 0x10
sub ecx, eax
mov byte [esp + 0x1d], al
mov eax, dword [ebp - 4]
mov byte [esp + 0x1c], bl
shr edx, cl
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x20], esi
mov dword [eax + edx*8], ecx
mov dword [eax + edx*8 + 4], esi
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x14]
cmp eax, edi
mov eax, dword [esp + 0x3c]
jg 0x40386d
mov ebx, dword [esp + 0x24]
mov edi, dword [esp + 0x30]
mov dl, byte [esp + 0x10]
mov ecx, dword [esp + 0x5a0]
sub dl, al
mov byte [esp + 0x1d], dl
lea edx, [esp + ecx*4 + 0x118]
cmp ebx, edx
jb 0x403992
mov byte [esp + 0x1c], 0x63
jmp 0x4039e2
mov ecx, dword [ebx]
mov edx, dword [esp + 0x5a4]
cmp ecx, edx
jae 0x4039b9
mov dx, word [ebx]
cmp ecx, 0x100
setb cl
add ecx, 0xf
mov word [esp + 0x20], dx
mov byte [esp + 0x1c], cl
jmp 0x4039db
sub ecx, edx
mov edx, dword [esp + 0x5ac]
shl ecx, 1
mov dl, byte [ecx + edx]
mov byte [esp + 0x1c], dl
mov edx, dword [esp + 0x5a8]
mov cx, word [ecx + edx]
mov word [esp + 0x20], cx
add ebx, 4
mov dword [esp + 0x24], ebx
mov ecx, dword [esp + 0x10]
mov esi, 1
sub ecx, eax
mov edx, edi
shl esi, cl
mov ecx, eax
shr edx, cl
cmp edx, dword [esp + 0x40]
jae 0x403a2a
mov ecx, dword [esp + 0x44]
lea edi, [esi*8]
lea ecx, [ecx + edx*8]
mov ebx, dword [esp + 0x1c]
add edx, esi
mov dword [ecx], ebx
mov ebx, dword [esp + 0x20]
mov dword [ecx + 4], ebx
mov ebx, dword [esp + 0x40]
add ecx, edi
cmp edx, ebx
jb 0x403a09
mov ebx, dword [esp + 0x24]
mov edi, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
mov edx, 1
shl edx, cl
test edi, edx
je 0x403a41
xor edi, edx
shr edx, 1
test edi, edx
jne 0x403a39
mov esi, 1
mov ecx, eax
xor edi, edx
mov edx, dword [esp + 0x18]
shl esi, cl
mov ecx, dword [esp + edx*4 + 0x94]
lea edx, [esp + edx*4 + 0x94]
mov dword [esp + 0x30], edi
dec esi
and esi, edi
cmp esi, ecx
je 0x403a8a
mov esi, dword [esp + 0x18]
sub eax, ebp
dec esi
mov ecx, eax
mov dword [esp + 0x18], esi
mov esi, 1
shl esi, cl
mov ecx, dword [edx - 4]
sub edx, 4
dec esi
and esi, edi
cmp esi, ecx
jne 0x403a69
mov ecx, dword [esp + 0x2c]
mov edx, ecx
dec ecx
test edx, edx
mov edx, dword [esp + 0x10]
mov dword [esp + 0x2c], ecx
jne 0x403857
mov esi, dword [esp + 0x28]
mov ecx, dword [esp + 0x34]
inc edx
add esi, 4
inc ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x38]
cmp edx, ecx
mov dword [esp + 0x28], esi
jle 0x403842
xor esi, esi
cmp dword [esp + 0x48], esi
je 0x4036fe
cmp ecx, esi
je 0x4036fe
pop edi
pop esi
pop ebp
mov ax, 0xfffc
pop ebx
add esp, 0x588
ret
mov eax, dword [esp + 0x18]
test eax, eax
je 0x403b01
mov eax, dword [esp + 0xd8]
push eax
call fcn.00403b10
add esp, 4
pop edi
pop esi
pop ebp
mov ax, 0xfffa
pop ebx
add esp, 0x588
ret