Function at 0x403520
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x580
lea eax, [esp + 0x38]
push ebx
push esi
push edi
push ebp
push 0x44
push eax
call fcn.00403500
mov edx, dword [esp + 0x59c]
mov ecx, dword [esp + 0x5a0]
add esp, 8
mov eax, edx
mov esi, dword [eax]
add eax, 4
inc dword [esp + esi*4 + 0x48]
dec ecx
jne 0x403549
mov eax, dword [esp + 0x598]
cmp eax, dword [esp + 0x48]
jne 0x40358a
xor ax, ax
mov ecx, dword [esp + 0x5a8]
mov ebx, dword [esp + 0x5ac]
pop ebp
pop edi
mov dword [ecx], 0
pop esi
mov dword [ebx], 0
pop ebx
add esp, 0x580
ret
mov ebx, dword [esp + 0x5ac]
mov ecx, 1
mov eax, dword [ebx]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x4c]
cmp dword [eax], 0
jne 0x4035b4
add eax, 4
inc ecx
lea esi, [esp + 0x88]
cmp eax, esi
jbe 0x4035a0
mov dword [esp + 0x1c], ecx
mov esi, ecx
cmp dword [esp + 0x10], ecx
jae 0x4035c4
mov dword [esp + 0x10], esi
mov edi, 0x10
lea eax, [esp + 0x88]
cmp dword [eax], 0
jne 0x4035e1
sub eax, 4
dec edi
lea ebp, [esp + 0x48]
cmp eax, ebp
jne 0x4035d0
mov dword [esp + 0x30], edi
cmp dword [esp + 0x10], edi
jbe 0x4035ef
mov dword [esp + 0x10], edi
mov eax, dword [esp + 0x10]
mov dword [ebx], eax
mov eax, 1
shl eax, cl
mov dword [esp + 0x20], eax
cmp ecx, edi
jae 0x403622
lea eax, [esp + ecx*4 + 0x48]
mov ebx, dword [eax]
sub dword [esp + 0x20], ebx
js 0x40363d
add eax, 4
inc ecx
mov ebx, dword [esp + 0x20]
add ebx, ebx
cmp ecx, edi
mov dword [esp + 0x20], ebx
jb 0x403608
lea eax, [esp + edi*4 + 0x48]
mov ecx, dword [eax]
sub dword [esp + 0x20], ecx
jns 0x40364c
mov ax, 0xfffb
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
mov ax, 0xfffb
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
add ecx, dword [esp + 0x20]
xor ebx, ebx
dec edi
mov dword [eax], ecx
lea eax, [esp + 0x4c]
lea ecx, [esp + 0x94]
mov dword [esp + 0x90], ebx
je 0x403676
add ebx, dword [eax]
add eax, 4
mov dword [ecx], ebx
add ecx, 4
dec edi
jne 0x403669
xor edi, edi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x403694
lea ecx, [esp + eax*4 + 0x8c]
mov eax, dword [ecx]
inc eax
mov dword [ecx], eax
mov dword [esp + eax*4 + 0x10c], edi
inc edi
cmp dword [esp + 0x598], edi
ja 0x403678
xor edx, edx
lea eax, [esp + 0x110]
mov dword [esp + 0x18], edx
mov dword [esp + 0x8c], edx
mov dword [esp + 0x38], eax
mov dword [esp + 0xd0], edx
mov eax, dword [esp + 0x10]
mov dword [esp + 0x3c], edx
neg eax
mov dword [esp + 0x14], eax
cmp esi, dword [esp + 0x30]
mov dword [esp + 0x2c], 0xffffffff
jg 0x403944
mov eax, dword [esp + 0x1c]
lea ecx, [esp + eax*4 + 0x48]
mov dword [esp + 0x44], ecx
mov eax, dword [ecx]
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x34]
dec dword [esp + 0x34]
test eax, eax
je 0x403932
mov eax, dword [esp + 0x10]
add eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x1c]
jge 0x403815
mov esi, dword [esp + 0x2c]
mov eax, dword [esp + 0x34]
shl esi, 2
inc eax
mov dword [esp + 0x40], eax
add esi, 4
mov eax, dword [esp + 0x10]
mov edi, dword [esp + 0x30]
inc dword [esp + 0x2c]
add dword [esp + 0x14], eax
sub edi, dword [esp + 0x14]
cmp eax, edi
jae 0x40373e
mov edi, eax
mov ebx, dword [esp + 0x1c]
mov edx, 1
sub ebx, dword [esp + 0x14]
mov cl, bl
shl edx, cl
cmp dword [esp + 0x40], edx
jae 0x403778
mov eax, dword [esp + 0x34]
inc ebx
inc eax
sub edx, eax
mov eax, dword [esp + 0x44]
cmp ebx, edi
jae 0x403778
mov ecx, dword [eax + 4]
add edx, edx
add eax, 4
cmp ecx, edx
jae 0x403778
sub edx, ecx
inc ebx
cmp ebx, edi
jb 0x403765
mov eax, 1
mov cl, bl
shl eax, cl
mov dword [esp + 0x3c], eax
lea ecx, [eax*8 + 8]
push ecx
call fcn.00402490
add esp, 4
test eax, eax
je 0x403961
lea edx, [eax + 8]
mov ecx, dword [esp + 0x5a8]
add eax, 4
mov dword [esp + esi + 0xd0], edx
mov dword [ecx], edx
mov dword [esp + 0x5a8], eax
mov dword [eax], 0
test esi, esi
je 0x403803
mov eax, dword [esp + 0x18]
mov cl, byte [esp + 0x10]
add bl, 0x10
mov dword [esp + esi + 0x8c], eax
mov byte [esp + 0x25], cl
mov byte [esp + 0x24], bl
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
sub cl, byte [esp + 0x10]
mov dword [esp + 0x28], edx
shr ebx, cl
shl ebx, 3
mov eax, dword [esp + 0x24]
add ebx, dword [esp + esi + 0xcc]
mov dword [ebx], eax
mov dword [ebx + 4], edx
mov eax, dword [esp + 0x14]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x1c]
jl 0x403721
mov bl, byte [esp + 0x14]
mov cl, byte [esp + 0x1c]
sub cl, bl
mov eax, dword [esp + 0x598]
mov byte [esp + 0x25], cl
lea ebp, [esp + eax*4 + 0x110]
cmp ebp, dword [esp + 0x38]
ja 0x40383e
mov byte [esp + 0x24], 0x63
jmp 0x403889
mov eax, dword [esp + 0x38]
mov esi, dword [eax]
cmp dword [esp + 0x59c], esi
jbe 0x40385d
mov al, 0x10
cmp esi, 0x100
adc al, 0xff
mov byte [esp + 0x24], al
jmp 0x40387f
sub esi, dword [esp + 0x59c]
mov eax, dword [esp + 0x5a4]
add esi, esi
mov ebp, dword [esp + 0x5a0]
mov al, byte [esi + eax]
mov si, word [esi + ebp]
mov byte [esp + 0x24], al
add dword [esp + 0x38], 4
mov word [esp + 0x28], si
mov esi, 1
mov edi, dword [esp + 0x18]
shl esi, cl
mov cl, bl
shr edi, cl
cmp edi, dword [esp + 0x3c]
jae 0x4038c5
lea ecx, [edx + edi*8]
lea eax, [esi*8]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x24]
mov ebp, dword [esp + 0x28]
add edi, esi
mov dword [ecx], eax
mov dword [ecx + 4], ebp
add ecx, dword [esp + 0x40]
cmp edi, dword [esp + 0x3c]
jb 0x4038ac
mov eax, 1
mov cl, byte [esp + 0x1c]
dec cl
shl eax, cl
test dword [esp + 0x18], eax
je 0x4038e5
xor dword [esp + 0x18], eax
shr eax, 1
test dword [esp + 0x18], eax
jne 0x4038d8
mov cl, bl
xor dword [esp + 0x18], eax
mov eax, dword [esp + 0x2c]
lea esi, [esp + eax*4 + 0x8c]
mov eax, 1
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
je 0x4036ef
sub esi, 4
mov eax, dword [esp + 0x10]
dec dword [esp + 0x2c]
sub dword [esp + 0x14], eax
mov eax, 1
mov cl, byte [esp + 0x14]
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
jne 0x40390a
jmp 0x4036ef
inc dword [esp + 0x1c]
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x30]
jle 0x4036dd
cmp dword [esp + 0x20], 0
je 0x403987
cmp dword [esp + 0x30], 0
je 0x403987
mov ax, 0xfffc
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
cmp dword [esp + 0x2c], 0
je 0x403978
mov eax, dword [esp + 0xd0]
push eax
call fcn.004039a0
add esp, 4
mov ax, 0xfffa
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
xor ax, ax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret