Function at 0x40da70
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x584
xor eax, eax
mov ecx, 0x11
push ebx
mov dword [esp + 0x34], 0
push esi
push edi
lea edi, [esp + 0x48]
push ebp
rep stosd dword es:[edi], eax
mov edx, dword [esp + 0x598]
mov eax, dword [esp + 0x59c]
mov ecx, edx
mov esi, dword [ecx]
add ecx, 4
inc dword [esp + esi*4 + 0x4c]
dec eax
jne 0x40da9f
mov eax, dword [esp + 0x59c]
cmp dword [esp + 0x4c], eax
mov eax, dword [esp + 0x5b4]
jne 0x40dad2
pop ebp
mov dword [eax], 0
xor eax, eax
pop edi
pop esi
pop ebx
add esp, 0x584
ret
mov ebx, dword [eax]
mov ecx, 1
lea eax, [esp + 0x50]
cmp dword [eax], 0
jne 0x40daf1
add eax, 4
inc ecx
lea esi, [esp + 0x8c]
cmp eax, esi
jbe 0x40dadd
mov dword [esp + 0x18], ecx
mov esi, ecx
cmp ebx, ecx
jae 0x40dafd
mov ebx, esi
mov edi, 0x10
lea eax, [esp + 0x8c]
cmp dword [eax], 0
jne 0x40db1a
sub eax, 4
dec edi
lea ebp, [esp + 0x4c]
cmp eax, ebp
jne 0x40db09
mov dword [esp + 0x28], edi
cmp ebx, edi
jbe 0x40db24
mov ebx, edi
mov eax, dword [esp + 0x5b4]
mov dword [eax], ebx
mov eax, 1
shl eax, cl
mov dword [esp + 0x1c], eax
cmp ecx, edi
jae 0x40db5b
lea ebp, [esp + ecx*4 + 0x4c]
mov eax, dword [ebp]
sub dword [esp + 0x1c], eax
js 0x40db77
add ebp, 4
inc ecx
mov eax, dword [esp + 0x1c]
add eax, eax
cmp ecx, edi
mov dword [esp + 0x1c], eax
jb 0x40db40
lea ecx, [esp + edi*4 + 0x4c]
mov eax, dword [ecx]
sub dword [esp + 0x1c], eax
jns 0x40db87
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x584
ret
mov eax, 2
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x584
ret
add eax, dword [esp + 0x1c]
lea ebp, [esp + 0x50]
mov dword [ecx], eax
xor ecx, ecx
lea eax, [esp + 0x98]
dec edi
mov dword [esp + 0x94], ecx
je 0x40dbb2
add ecx, dword [ebp]
add ebp, 4
mov dword [eax], ecx
add eax, 4
dec edi
jne 0x40dba4
xor edi, edi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x40dbd0
lea eax, [esp + eax*4 + 0x90]
mov ecx, dword [eax]
inc ecx
mov dword [eax], ecx
mov dword [esp + ecx*4 + 0x110], edi
inc edi
cmp dword [esp + 0x59c], edi
ja 0x40dbb4
xor eax, eax
lea edi, [esp + 0x114]
mov edx, ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0x90], eax
mov dword [esp + 0x30], edi
mov dword [esp + 0xd4], eax
mov dword [esp + 0x34], eax
neg edx
mov dword [esp + 0x38], eax
cmp esi, dword [esp + 0x28]
mov dword [esp + 0x3c], 0xffffffff
jg 0x40de6d
mov eax, dword [esp + 0x18]
lea ecx, [esp + eax*4 + 0x4c]
mov dword [esp + 0x44], ecx
mov eax, dword [ecx]
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x2c]
dec dword [esp + 0x2c]
test eax, eax
je 0x40de5b
lea eax, [ebx + edx]
cmp eax, dword [esp + 0x18]
jge 0x40dd3c
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x28]
shl esi, 2
and eax, 0xffff
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x2c]
inc eax
mov dword [esp + 0x48], eax
add esi, 4
add edx, ebx
mov edi, dword [esp + 0x14]
inc dword [esp + 0x3c]
sub edi, edx
cmp edi, ebx
jbe 0x40dc79
movzx edi, bx
mov ecx, dword [esp + 0x18]
mov eax, 1
sub ecx, edx
shl eax, cl
cmp dword [esp + 0x48], eax
jae 0x40dcae
mov ebp, dword [esp + 0x2c]
inc ecx
inc ebp
sub eax, ebp
mov ebp, dword [esp + 0x44]
cmp edi, ecx
jbe 0x40dcae
add eax, eax
add ebp, 4
cmp dword [ebp], eax
jae 0x40dcae
sub eax, dword [ebp]
inc ecx
cmp edi, ecx
ja 0x40dc9c
mov eax, 1
mov edi, dword [esp + 0x5ac]
shl eax, cl
mov ebp, dword [esp + 0x40]
mov dword [esp + 0x38], eax
lea eax, [edi + ebp*8]
mov edi, dword [esp + 0x38]
mov dword [esp + 0x34], eax
add dword [esp + 0x40], edi
mov ebp, dword [esp + 0x40]
cmp dword [esp + 0x5b0], ebp
jb 0x40de8b
mov dword [esp + esi + 0xd4], eax
test esi, esi
je 0x40dd2f
mov eax, dword [esp + 0x10]
add cl, 0x10
mov dword [esp + esi + 0x90], eax
mov byte [esp + 0x21], bl
mov eax, dword [esp + 0x34]
mov ebp, dword [esp + 0x10]
mov byte [esp + 0x20], cl
mov dword [esp + 0x24], eax
mov ecx, edx
sub cl, bl
shr ebp, cl
shl ebp, 3
add ebp, dword [esp + esi + 0xd0]
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
mov dword [ebp], eax
mov dword [ebp + 4], edi
lea eax, [ebx + edx]
cmp eax, dword [esp + 0x18]
jl 0x40dc63
mov cl, byte [esp + 0x18]
mov eax, dword [esp + 0x59c]
sub cl, dl
lea ebp, [esp + eax*4 + 0x114]
mov byte [esp + 0x21], cl
cmp ebp, dword [esp + 0x30]
ja 0x40dd61
mov byte [esp + 0x20], 0x63
jmp 0x40ddb6
mov edi, dword [esp + 0x30]
mov esi, dword [edi]
cmp dword [esp + 0x5a0], esi
jbe 0x40dd8a
mov byte [esp + 0x14], 0x10
cmp esi, 0x100
adc byte [esp + 0x14], 0xff
mov al, byte [esp + 0x14]
mov byte [esp + 0x20], al
jmp 0x40ddac
sub esi, dword [esp + 0x5a0]
mov eax, dword [esp + 0x5a8]
add esi, esi
mov ebp, dword [esp + 0x5a4]
mov al, byte [esi + eax]
mov si, word [esi + ebp]
mov byte [esp + 0x20], al
add dword [esp + 0x30], 4
mov word [esp + 0x24], si
mov esi, 1
mov edi, dword [esp + 0x10]
shl esi, cl
mov cl, dl
shr edi, cl
cmp dword [esp + 0x38], edi
jbe 0x40ddf6
mov eax, dword [esp + 0x34]
lea ebp, [esi*8]
mov dword [esp + 0x14], ebp
lea ecx, [eax + edi*8]
mov eax, dword [esp + 0x20]
mov ebp, dword [esp + 0x24]
add edi, esi
mov dword [ecx], eax
mov dword [ecx + 4], ebp
add ecx, dword [esp + 0x14]
cmp dword [esp + 0x38], edi
ja 0x40dddd
mov eax, 1
mov cl, byte [esp + 0x18]
dec cl
shl eax, cl
test dword [esp + 0x10], eax
je 0x40de16
xor dword [esp + 0x10], eax
shr eax, 1
test dword [esp + 0x10], eax
jne 0x40de09
mov cl, dl
xor dword [esp + 0x10], eax
mov eax, dword [esp + 0x3c]
lea esi, [esp + eax*4 + 0x90]
mov eax, 1
shl eax, cl
dec eax
and eax, dword [esp + 0x10]
cmp eax, dword [esi]
je 0x40dc29
sub esi, 4
sub edx, ebx
mov eax, 1
mov cl, dl
shl eax, cl
dec eax
dec dword [esp + 0x3c]
and eax, dword [esp + 0x10]
cmp eax, dword [esi]
jne 0x40de3b
jmp 0x40dc29
inc dword [esp + 0x18]
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x28]
jle 0x40dc17
cmp dword [esp + 0x1c], 0
je 0x40de9b
cmp dword [esp + 0x28], 1
je 0x40de9b
mov eax, 1
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x584
ret
mov eax, 3
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x584
ret
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x584
ret