Function at 0x401d90
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x5c0
push ebx
mov ebx, dword [esp + 0x5cc]
push ebp
mov ebp, dword [esp + 0x5cc]
push esi
cmp ebx, 0x100
push edi
jbe 0x401dbc
mov eax, dword [ebp + 0x400]
mov dword [esp + 0x38], eax
jmp 0x401dc4
mov dword [esp + 0x38], 0x10
mov ecx, 0x11
xor eax, eax
lea edi, [esp + 0x44]
mov edx, ebx
rep stosd dword es:[edi], eax
mov ecx, ebp
mov eax, dword [ecx]
add ecx, 4
mov edi, dword [esp + eax*4 + 0x44]
lea eax, [esp + eax*4 + 0x44]
inc edi
dec edx
mov dword [eax], edi
jne 0x401dd5
cmp dword [esp + 0x44], ebx
jne 0x401e15
mov ecx, dword [esp + 0x5e8]
mov edx, dword [esp + 0x5ec]
pop edi
pop esi
mov dword [ecx], 0
pop ebp
mov dword [edx], 0
xor eax, eax
pop ebx
add esp, 0x5c0
ret
mov eax, dword [esp + 0x48]
xor edi, edi
cmp eax, edi
mov ecx, 1
jne 0x401e38
lea eax, [esp + 0x48]
cmp ecx, 0x10
ja 0x401e38
mov edx, dword [eax + 4]
add eax, 4
inc ecx
cmp edx, edi
je 0x401e28
mov eax, dword [esp + 0x84]
mov dword [esp + 0x10], ecx
cmp eax, edi
mov edx, 0x10
jne 0x401e62
lea eax, [esp + 0x84]
cmp edx, edi
je 0x401e62
mov esi, dword [eax - 4]
sub eax, 4
dec edx
cmp esi, edi
je 0x401e53
mov esi, dword [esp + 0x5ec]
mov dword [esp + 0x28], edx
mov eax, dword [esi]
cmp eax, ecx
jae 0x401e77
mov eax, ecx
jmp 0x401e7d
cmp eax, edx
jbe 0x401e7d
mov eax, edx
mov dword [esi], eax
mov eax, 1
shl eax, cl
cmp ecx, edx
jae 0x401e9c
lea esi, [esp + ecx*4 + 0x44]
sub eax, dword [esi]
js 0x401ea8
inc ecx
add esi, 4
shl eax, 1
cmp ecx, edx
jb 0x401e8e
mov ecx, dword [esp + edx*4 + 0x44]
sub eax, ecx
mov dword [esp + 0x40], eax
jns 0x401eb8
pop edi
pop esi
pop ebp
mov eax, 2
pop ebx
add esp, 0x5c0
ret
add ecx, eax
mov dword [esp + 0xd0], edi
mov dword [esp + edx*4 + 0x44], ecx
xor ecx, ecx
dec edx
je 0x401edd
xor esi, esi
add ecx, dword [esp + esi + 0x48]
add esi, 4
dec edx
mov dword [esp + esi + 0xd0], ecx
jne 0x401ecc
xor esi, esi
mov ecx, dword [ebp]
add ebp, 4
cmp ecx, edi
je 0x401f01
mov edx, dword [esp + ecx*4 + 0xcc]
lea ecx, [esp + ecx*4 + 0xcc]
mov dword [esp + edx*4 + 0x150], esi
inc edx
mov dword [ecx], edx
inc esi
cmp esi, ebx
jb 0x401edf
mov esi, dword [esp + 0x10]
lea ecx, [esp + 0x150]
mov dword [esp + 0x2c], ecx
mov ecx, dword [esp + 0x28]
xor ebx, ebx
or ebp, 0xffffffff
xor edx, edx
cmp esi, ecx
mov dword [esp + 0x20], ebx
mov dword [esp + 0xcc], edi
mov dword [esp + 0x88], edi
mov dword [esp + 0x14], edi
mov dword [esp + 0x110], edi
jg 0x402210
mov ecx, esi
dec ecx
mov dword [esp + 0x34], ecx
mov ecx, esi
lea ecx, [esp + ecx*4 + 0x44]
mov dword [esp + 0x30], ecx
mov ecx, dword [esp + 0x30]
mov ecx, dword [ecx]
mov esi, ecx
dec ecx
test esi, esi
mov dword [esp + 0x24], ecx
je 0x4021e3
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + ebp*4 + 0x8c]
cmp eax, ecx
jle 0x4020b5
lea esi, [ebp*4 - 4]
jmp 0x401f8b
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esp + 0x5ec]
mov edx, dword [esp + 0x28]
inc ebp
add esi, 4
mov eax, dword [ecx]
mov dword [esp + 0x3c], ebp
mov ebp, dword [esp + esi + 0x8c]
sub edx, ebp
mov dword [esp + 0x14], ebp
cmp edx, eax
jbe 0x401fb3
mov edx, eax
mov ebx, dword [esp + 0x10]
mov eax, 1
sub ebx, ebp
mov ecx, ebx
shl eax, cl
mov ecx, dword [esp + 0x24]
inc ecx
cmp eax, ecx
jbe 0x401ff2
mov edi, dword [esp + 0x24]
or ecx, 0xffffffff
sub ecx, edi
mov edi, dword [esp + 0x30]
add eax, ecx
inc ebx
cmp ebx, edx
jae 0x401ff2
mov ecx, dword [edi + 4]
add edi, 4
shl eax, 1
cmp eax, ecx
jbe 0x401ff2
sub eax, ecx
inc ebx
cmp ebx, edx
jb 0x401fdf
mov eax, dword [esp + 0x38]
lea edx, [ebx + ebp]
cmp edx, eax
jbe 0x402005
cmp ebp, eax
jae 0x402005
mov ebx, eax
sub ebx, ebp
mov edi, 1
mov ecx, ebx
shl edi, cl
add ebp, ebx
mov dword [esp + esi + 0x90], ebp
lea eax, [edi*8 + 8]
push eax
call fcn.0040ca04
mov edx, dword [esp + 0x5ec]
lea ecx, [eax + 8]
add eax, 4
add esp, 4
mov dword [edx], ecx
mov edx, ecx
cmp esi, 0xfffffffc
mov dword [esp + 0x5e8], eax
mov dword [eax], 0
mov dword [esp + esi + 0x114], edx
je 0x4020a3
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x14]
mov dword [esp + esi + 0xd0], eax
mov al, cl
sub al, byte [esp + esi + 0x88]
add bl, 0x10
mov byte [esp + 0x18], bl
mov dword [esp + 0x1c], edx
mov byte [esp + 0x19], al
mov eax, 1
shl eax, cl
mov ecx, dword [esp + 0x20]
mov ebx, dword [esp + 0x18]
dec eax
and eax, ecx
mov ecx, dword [esp + esi + 0x88]
shr eax, cl
mov ecx, dword [esp + esi + 0x110]
mov dword [ecx + eax*8], ebx
mov ebx, edx
mov dword [ecx + eax*8 + 4], ebx
cmp dword [esp + 0x10], ebp
jg 0x401f87
mov ebx, dword [esp + 0x20]
mov ebp, dword [esp + 0x3c]
mov al, byte [esp + 0x10]
mov cl, byte [esp + 0x14]
mov esi, dword [esp + 0x2c]
sub al, cl
mov ecx, dword [esp + 0x5d8]
mov byte [esp + 0x19], al
lea eax, [esp + ecx*4 + 0x150]
cmp esi, eax
jb 0x4020e0
mov byte [esp + 0x18], 0x63
jmp 0x402135
mov eax, dword [esi]
mov ecx, dword [esp + 0x5dc]
cmp eax, ecx
jae 0x40210a
cmp eax, 0x100
mov word [esp + 0x1c], ax
setb cl
add ecx, 0xf
add esi, 4
mov byte [esp + 0x18], cl
mov dword [esp + 0x2c], esi
jmp 0x402135
sub eax, ecx
mov ecx, dword [esp + 0x5e4]
mov cl, byte [eax + ecx]
mov byte [esp + 0x18], cl
mov ecx, dword [esp + 0x5e0]
mov ax, word [ecx + eax*2]
mov word [esp + 0x1c], ax
mov eax, dword [esp + 0x2c]
add eax, 4
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x14]
sub ecx, esi
mov esi, 1
shl esi, cl
mov ecx, dword [esp + 0x14]
mov eax, ebx
shr eax, cl
cmp eax, edi
jae 0x402175
lea ecx, [edx + eax*8]
mov ebx, dword [esp + 0x18]
add eax, esi
mov dword [ecx], ebx
mov ebx, dword [esp + 0x1c]
mov dword [ecx + 4], ebx
lea ebx, [esi*8]
add ecx, ebx
cmp eax, edi
jb 0x402155
mov ebx, dword [esp + 0x20]
mov ecx, dword [esp + 0x34]
mov eax, 1
shl eax, cl
test ebx, eax
je 0x40218c
xor ebx, eax
shr eax, 1
test ebx, eax
jne 0x402184
mov ecx, dword [esp + 0x14]
xor ebx, eax
mov eax, 1
mov dword [esp + 0x20], ebx
shl eax, cl
mov ecx, dword [esp + ebp*4 + 0xcc]
dec eax
and eax, ebx
cmp eax, ecx
je 0x4021cc
mov ecx, dword [esp + ebp*4 + 0x84]
dec ebp
mov eax, 1
mov dword [esp + 0x14], ecx
shl eax, cl
mov ecx, dword [esp + ebp*4 + 0xcc]
dec eax
and eax, ebx
cmp eax, ecx
jne 0x4021ab
mov eax, dword [esp + 0x24]
mov ecx, eax
dec eax
test ecx, ecx
mov dword [esp + 0x24], eax
jne 0x401f6b
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x30]
inc ecx
add esi, 4
mov dword [esp + 0x10], ecx
mov ecx, dword [esp + 0x34]
inc ecx
mov dword [esp + 0x30], esi
mov esi, dword [esp + 0x10]
mov dword [esp + 0x34], ecx
mov ecx, dword [esp + 0x28]
cmp esi, ecx
jle 0x401f56
mov ecx, dword [esp + 0x5ec]
mov edx, dword [esp + 0x8c]
test eax, eax
mov dword [ecx], edx
je 0x402231
mov ecx, dword [esp + 0x28]
mov eax, 1
cmp ecx, eax
jne 0x402233
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x5c0
ret