Function at 0x405800
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x144
mov dword [esp + 0x18], edx
push ebx
push esi
mov edx, ecx
cmp dword [esp + 0x20], 0x100
push edi
push ebp
jbe 0x405826
mov eax, dword [edx + 0x400]
mov dword [esp + 0x34], eax
jmp 0x40582e
mov dword [esp + 0x34], 0x10
lea edi, [esp + 0x48]
xor eax, eax
mov ecx, 0x11
rep stosd dword es:[edi], eax
mov ecx, edx
mov eax, dword [esp + 0x28]
mov esi, dword [ecx]
add ecx, 4
inc dword [esp + esi*4 + 0x48]
dec eax
jne 0x405841
mov eax, dword [esp + 0x28]
cmp eax, dword [esp + 0x48]
jne 0x405876
mov eax, dword [esp + 0x164]
mov edi, dword [esp + 0x168]
mov dword [eax], 0
mov dword [edi], 0
jmp 0x405cbd
mov ecx, 1
lea eax, [esp + 0x4c]
cmp dword [eax], 0
jne 0x405893
add eax, 4
inc ecx
lea esi, [esp + 0x88]
cmp eax, esi
jbe 0x40587f
mov edi, dword [esp + 0x168]
mov dword [esp + 0x18], ecx
mov esi, ecx
cmp dword [edi], ecx
jae 0x4058a6
mov dword [edi], esi
mov ebx, 0x10
lea eax, [esp + 0x88]
cmp dword [eax], 0
jne 0x4058c3
sub eax, 4
dec ebx
lea edi, [esp + 0x48]
cmp eax, edi
jne 0x4058b2
mov edi, dword [esp + 0x168]
mov dword [esp + 0x2c], ebx
cmp dword [edi], ebx
jbe 0x4058d4
mov dword [edi], ebx
mov eax, 1
shl eax, cl
mov dword [esp + 0x1c], eax
cmp ecx, ebx
jae 0x405901
lea edi, [esp + ecx*4 + 0x48]
mov eax, dword [edi]
sub dword [esp + 0x1c], eax
js 0x405917
add edi, 4
inc ecx
mov eax, dword [esp + 0x1c]
add eax, eax
cmp ecx, ebx
mov dword [esp + 0x1c], eax
jb 0x4058e7
lea ecx, [esp + ebx*4 + 0x48]
mov eax, dword [ecx]
sub dword [esp + 0x1c], eax
jns 0x405921
mov eax, 2
jmp 0x405cbf
mov eax, 2
jmp 0x405cbf
add eax, dword [esp + 0x1c]
lea edi, [esp + 0x4c]
mov dword [ecx], eax
xor ecx, ecx
lea eax, [esp + 0xd8]
dec ebx
mov dword [esp + 0xd4], ecx
je 0x40594b
add ecx, dword [edi]
add edi, 4
mov dword [eax], ecx
add eax, 4
dec ebx
jne 0x40593e
xor edi, edi
mov eax, dword [edx]
add edx, 4
test eax, eax
je 0x405969
lea ecx, [esp + eax*4 + 0xd0]
mov eax, dword [ecx]
inc eax
mov dword [ecx], eax
mov dword [eax*4 + 0x448b6c], edi
inc edi
cmp dword [esp + 0x28], edi
ja 0x40594d
mov dword [esp + 0x38], 0x448b70
mov dword [esp + 0x3c], 0xffffffff
xor edi, edi
xor edx, edx
mov dword [esp + 0x14], edi
mov dword [esp + 0xd0], edi
mov dword [esp + 0x8c], edi
mov dword [esp + 0x10], edi
mov dword [esp + 0x114], edi
cmp esi, dword [esp + 0x2c]
jg 0x405c9a
mov eax, dword [esp + 0x18]
lea ecx, [esp + eax*4 + 0x48]
mov dword [esp + 0x44], ecx
mov eax, dword [ecx]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x30]
dec dword [esp + 0x30]
test eax, eax
je 0x405c88
mov esi, dword [esp + 0x3c]
shl esi, 2
mov eax, dword [esp + esi + 0x90]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x18]
jge 0x405b62
mov eax, dword [esp + 0x30]
inc eax
mov dword [esp + 0x40], eax
mov eax, dword [esp + esi + 0x90]
add esi, 4
mov edx, dword [esp + 0x2c]
mov edi, dword [esp + 0x168]
add dword [esp + 0x10], eax
inc dword [esp + 0x3c]
sub edx, dword [esp + 0x10]
mov eax, dword [edi]
cmp edx, eax
jbe 0x405a1b
mov edx, eax
mov ebx, dword [esp + 0x18]
mov edi, 1
sub ebx, dword [esp + 0x10]
mov cl, bl
shl edi, cl
cmp edi, dword [esp + 0x40]
jbe 0x405a55
mov eax, dword [esp + 0x30]
inc ebx
inc eax
sub edi, eax
mov eax, dword [esp + 0x44]
cmp ebx, edx
jae 0x405a55
mov ecx, dword [eax + 4]
add edi, edi
add eax, 4
cmp edi, ecx
jbe 0x405a55
sub edi, ecx
inc ebx
cmp ebx, edx
jb 0x405a42
mov eax, dword [esp + 0x10]
lea ecx, [eax + ebx]
cmp ecx, dword [esp + 0x34]
jbe 0x405a6e
cmp dword [esp + 0x34], eax
jbe 0x405a6e
mov ebx, dword [esp + 0x34]
sub ebx, eax
mov edi, 1
mov cl, bl
shl edi, cl
mov dword [esp + esi + 0x90], ebx
lea eax, [edi + 1]
mov ebp, dword [0x4594b0]
sub dword [0x448b58], eax
js 0x405a9e
lea eax, [edi*8 + 8]
add dword [0x4594b0], eax
jmp 0x405ad6
lea eax, [edi*8 + 0x10]
push eax
call fcn.00428740
add esp, 4
mov ebp, eax
test ebp, ebp
je 0x405ac7
mov eax, dword [0x43c4a0]
mov dword [ebp + 4], eax
mov dword [0x43c4a0], ebp
add ebp, 8
jmp 0x405ad6
push 0xffffffffffffffff
push 0x448ff0
call fcn.004286c0
add esp, 8
lea edx, [ebp + 8]
mov eax, dword [esp + 0x164]
add ebp, 4
mov dword [esp + esi + 0x114], edx
mov dword [eax], edx
mov dword [esp + 0x164], ebp
mov dword [ebp], 0
test esi, esi
je 0x405b4d
mov eax, dword [esp + 0x14]
add bl, 0x10
mov dword [esp + esi + 0xd0], eax
mov byte [esp + 0x20], bl
mov cl, byte [esp + esi + 0x8c]
mov ebp, edx
mov eax, 1
mov byte [esp + 0x21], cl
mov cl, byte [esp + 0x10]
mov dword [esp + 0x24], edx
shl eax, cl
mov ebx, dword [esp + 0x20]
dec eax
and eax, dword [esp + 0x14]
sub cl, byte [esp + esi + 0x8c]
shr eax, cl
shl eax, 3
add eax, dword [esp + esi + 0x110]
mov dword [eax], ebx
mov dword [eax + 4], ebp
mov eax, dword [esp + esi + 0x90]
add eax, dword [esp + 0x10]
cmp eax, dword [esp + 0x18]
jl 0x4059f2
mov cl, byte [esp + 0x18]
mov eax, dword [esp + 0x28]
sub cl, byte [esp + 0x10]
lea ebx, [eax*4 + 0x448b70]
mov byte [esp + 0x21], cl
cmp ebx, dword [esp + 0x38]
ja 0x405b86
mov byte [esp + 0x20], 0x63
jmp 0x405bd6
mov eax, dword [esp + 0x38]
mov esi, dword [eax]
cmp dword [esp + 0x158], esi
jbe 0x405baa
mov word [esp + 0x24], si
mov al, 0x10
cmp esi, 0x100
adc al, 0xff
mov byte [esp + 0x20], al
jmp 0x405bd1
sub esi, dword [esp + 0x158]
mov eax, dword [esp + 0x160]
add esi, esi
mov ebx, dword [esp + 0x15c]
mov bp, word [esi + ebx]
mov al, byte [esi + eax]
mov word [esp + 0x24], bp
mov byte [esp + 0x20], al
add dword [esp + 0x38], 4
mov esi, 1
mov ebx, dword [esp + 0x14]
shl esi, cl
mov cl, byte [esp + 0x10]
shr ebx, cl
cmp ebx, edi
jae 0x405c10
lea ecx, [edx + ebx*8]
lea eax, [esi*8]
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x20]
mov ebp, dword [esp + 0x24]
add ebx, esi
mov dword [ecx], eax
mov dword [ecx + 4], ebp
add ecx, dword [esp + 0x40]
cmp ebx, edi
jb 0x405bf9
mov eax, 1
mov cl, byte [esp + 0x18]
dec cl
shl eax, cl
test dword [esp + 0x14], eax
je 0x405c30
xor dword [esp + 0x14], eax
shr eax, 1
test dword [esp + 0x14], eax
jne 0x405c23
mov esi, dword [esp + 0x3c]
mov cl, byte [esp + 0x10]
shl esi, 2
xor dword [esp + 0x14], eax
mov eax, 1
shl eax, cl
dec eax
and eax, dword [esp + 0x14]
cmp eax, dword [esp + esi + 0xd0]
je 0x4059bd
mov eax, dword [esp + esi + 0x8c]
sub esi, 4
dec dword [esp + 0x3c]
sub dword [esp + 0x10], eax
mov eax, 1
mov cl, byte [esp + 0x10]
shl eax, cl
dec eax
and eax, dword [esp + 0x14]
cmp eax, dword [esp + esi + 0xd0]
jne 0x405c58
jmp 0x4059bd
inc dword [esp + 0x18]
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x2c]
jle 0x4059ab
mov eax, dword [esp + 0x90]
mov edi, dword [esp + 0x168]
cmp dword [esp + 0x1c], 0
mov dword [edi], eax
je 0x405cbd
cmp dword [esp + 0x2c], 1
mov eax, 1
jne 0x405cbf
xor eax, eax
pop ebp
pop edi
pop esi
pop ebx
add esp, 0x144
ret 0x14