Function at 0x4047f0
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x580
lea eax, [esp + 0xbc]
push ebx
push esi
push edi
push ebp
push 0x44
push 0
push eax
call fcn.004059a0
mov edx, dword [esp + 0x5a0]
mov ecx, dword [esp + 0x5a4]
add esp, 0xc
mov eax, edx
mov esi, dword [eax]
add eax, 4
inc dword [esp + esi*4 + 0xcc]
dec ecx
jne 0x40481e
mov eax, dword [esp + 0x598]
cmp eax, dword [esp + 0xcc]
jne 0x404864
mov ecx, dword [esp + 0x5a8]
mov ebx, dword [esp + 0x5ac]
xor eax, eax
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 + 0x14], eax
lea eax, [esp + 0xd0]
cmp dword [eax], 0
jne 0x404891
add eax, 4
inc ecx
lea esi, [esp + 0x10c]
cmp eax, esi
jbe 0x40487d
mov dword [esp + 0x1c], ecx
mov esi, ecx
cmp dword [esp + 0x14], ecx
jae 0x4048a1
mov dword [esp + 0x14], esi
mov edi, 0x10
lea eax, [esp + 0x10c]
cmp dword [eax], 0
jne 0x4048c1
sub eax, 4
dec edi
lea ebp, [esp + 0xcc]
cmp eax, ebp
jne 0x4048ad
mov dword [esp + 0x30], edi
cmp dword [esp + 0x14], edi
jbe 0x4048cf
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x14]
mov dword [ebx], eax
mov eax, 1
shl eax, cl
mov dword [esp + 0x3c], eax
cmp ecx, edi
jae 0x404905
lea eax, [esp + ecx*4 + 0xcc]
mov ebx, dword [eax]
sub dword [esp + 0x3c], ebx
js 0x404924
add eax, 4
inc ecx
mov ebx, dword [esp + 0x3c]
add ebx, ebx
cmp ecx, edi
mov dword [esp + 0x3c], ebx
jb 0x4048eb
lea eax, [esp + edi*4 + 0xcc]
mov ecx, dword [eax]
sub dword [esp + 0x3c], ecx
jns 0x404934
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
add ecx, dword [esp + 0x3c]
lea ebx, [esp + 0x90]
mov dword [eax], ecx
xor eax, eax
lea ecx, [esp + 0xd0]
dec edi
mov dword [esp + 0x8c], eax
je 0x404961
add eax, dword [ecx]
add ecx, 4
mov dword [ebx], eax
add ebx, 4
dec edi
jne 0x404954
xor edi, edi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x40497f
lea ecx, [esp + eax*4 + 0x88]
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 0x404963
xor edi, edi
lea eax, [esp + 0x110]
mov dword [esp + 0x18], edi
mov dword [esp + 0x88], edi
xor edx, edx
mov dword [esp + 0x34], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x48], edi
neg eax
mov dword [esp + 0x10], eax
cmp esi, dword [esp + 0x30]
mov dword [esp + 0x20], 0xffffffff
jg 0x404c44
mov eax, dword [esp + 0x1c]
lea ecx, [esp + eax*4 + 0xcc]
mov dword [esp + 0x2c], ecx
mov eax, dword [ecx]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x24]
dec dword [esp + 0x24]
test eax, eax
je 0x404c32
mov eax, dword [esp + 0x14]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x1c]
jge 0x404aff
mov esi, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
shl esi, 2
inc eax
mov dword [esp + 0x38], eax
add esi, 4
mov eax, dword [esp + 0x14]
mov edi, dword [esp + 0x30]
inc dword [esp + 0x20]
add dword [esp + 0x10], eax
sub edi, dword [esp + 0x10]
cmp edi, eax
jbe 0x404a27
mov edi, eax
mov ebx, dword [esp + 0x1c]
mov edx, 1
sub ebx, dword [esp + 0x10]
mov cl, bl
shl edx, cl
cmp edx, dword [esp + 0x38]
jbe 0x404a61
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x2c]
inc eax
inc ebx
sub edx, eax
cmp ebx, edi
jae 0x404a61
mov eax, dword [ecx + 4]
add edx, edx
add ecx, 4
cmp edx, eax
jbe 0x404a61
sub edx, eax
inc ebx
cmp ebx, edi
jb 0x404a4e
mov edi, 1
mov cl, bl
shl edi, cl
lea eax, [edi*8 + 8]
push eax
call fcn.0040602a
add esp, 4
test eax, eax
je 0x404c62
lea edx, [eax + 8]
lea ecx, [edi + 1]
mov ebp, dword [esp + 0x5a8]
add eax, 4
add dword [0x40a308], ecx
mov dword [esp + 0x5a8], eax
mov dword [ebp], edx
mov dword [esp + esi + 0x48], edx
mov dword [eax], 0
test esi, esi
je 0x404aed
mov eax, dword [esp + 0x18]
mov cl, byte [esp + 0x14]
add bl, 0x10
mov ebp, dword [esp + 0x18]
mov dword [esp + esi + 0x88], eax
mov byte [esp + 0x41], cl
mov ecx, dword [esp + 0x10]
mov byte [esp + 0x40], bl
sub cl, byte [esp + 0x14]
mov dword [esp + 0x44], edx
shr ebp, cl
shl ebp, 3
mov ebx, dword [esp + 0x40]
add ebp, dword [esp + esi + 0x44]
mov dword [ebp], ebx
mov dword [ebp + 4], edx
mov eax, dword [esp + 0x10]
add eax, dword [esp + 0x14]
cmp eax, dword [esp + 0x1c]
jl 0x404a0a
mov bl, byte [esp + 0x10]
mov cl, byte [esp + 0x1c]
sub cl, bl
mov eax, dword [esp + 0x598]
mov byte [esp + 0x41], cl
lea ebp, [esp + eax*4 + 0x110]
cmp ebp, dword [esp + 0x34]
ja 0x404b28
mov byte [esp + 0x40], 0x63
jmp 0x404b8b
mov eax, dword [esp + 0x34]
mov esi, dword [eax]
cmp dword [esp + 0x59c], esi
jbe 0x404b51
mov byte [esp + 0x38], 0x10
cmp esi, 0x100
adc byte [esp + 0x38], 0xff
mov al, byte [esp + 0x38]
mov byte [esp + 0x40], al
jmp 0x404b81
cmp dword [esp + 0x5a4], 0
je 0x404c86
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 + 0x40], al
add dword [esp + 0x34], 4
mov word [esp + 0x44], si
mov eax, 1
mov esi, dword [esp + 0x18]
shl eax, cl
mov cl, bl
mov dword [esp + 0x28], eax
shr esi, cl
cmp esi, edi
jae 0x404bc5
shl eax, 3
lea ecx, [edx + esi*8]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x40]
mov ebp, dword [esp + 0x44]
add esi, dword [esp + 0x28]
mov dword [ecx], eax
mov dword [ecx + 4], ebp
add ecx, dword [esp + 0x38]
cmp esi, edi
jb 0x404bac
mov eax, 1
mov cl, byte [esp + 0x1c]
dec cl
shl eax, cl
test dword [esp + 0x18], eax
je 0x404be5
xor dword [esp + 0x18], eax
shr eax, 1
test dword [esp + 0x18], eax
jne 0x404bd8
mov cl, bl
xor dword [esp + 0x18], eax
mov eax, dword [esp + 0x20]
lea esi, [esp + eax*4 + 0x88]
mov eax, 1
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
je 0x4049d8
sub esi, 4
mov eax, dword [esp + 0x14]
dec dword [esp + 0x20]
sub dword [esp + 0x10], eax
mov eax, 1
mov cl, byte [esp + 0x10]
shl eax, cl
dec eax
and eax, dword [esp + 0x18]
cmp eax, dword [esi]
jne 0x404c0a
jmp 0x4049d8
inc dword [esp + 0x1c]
mov eax, dword [esp + 0x1c]
cmp eax, dword [esp + 0x30]
jle 0x4049c3
cmp dword [esp + 0x3c], 0
je 0x404c96
cmp dword [esp + 0x30], 1
je 0x404c96
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
cmp dword [esp + 0x20], 0
je 0x404c76
mov eax, dword [esp + 0x48]
push eax
call fcn.00404cb0
add esp, 4
mov eax, 3
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x580
ret