Function at 0x40b571
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov dword [ebp - 0x14], edx
xor edx, edx
xor esi, esi
push edi
mov dword [ebp - 8], edx
mov dword [ebp - 0xc], esi
test ebx, ebx
je 0x40b590
mov byte [ebx], dl
test ecx, ecx
jne 0x40b59c
push 0xffffffffffffff9a
pop eax
jmp 0x40b7c1
mov edi, dword [ecx + 0x7c]
mov dword [ebp - 0x10], edi
test edi, edi
je 0x40b594
cmp dword [edi], edx
jne 0x40b5ae
push 0xffffffffffffff9c
jmp 0x40b596
mov eax, dword [ebp + 8]
test eax, eax
jne 0x40b5bc
xor eax, eax
jmp 0x40b7c1
mov ecx, dword [ebp - 0x14]
mov dword [edi + 0x10], ecx
mov ecx, dword [edi + 0x5c]
mov dword [edi + 0x14], eax
cmp eax, ecx
jbe 0x40b5cf
mov dword [edi + 0x14], ecx
cmp dword [edi + 0x14], edx
jbe 0x40b7bf
cmp dword [edi + 8], 0
jne 0x40b691
mov eax, dword [edi + 0x58]
test eax, eax
je 0x40b691
mov esi, 0x4000
cmp eax, esi
jae 0x40b600
mov esi, eax
test esi, esi
je 0x40b791
mov edx, dword [edi + 0x68]
add edx, dword [edi + 0x3c]
mov ecx, dword [edi + 0x60]
push 0
call fcn.0040aa78
pop ecx
test eax, eax
jne 0x40b7a1
push dword [edi + 0x60]
mov ecx, dword [edi]
push 1
mov edx, esi
call fcn.0040aae3
pop ecx
pop ecx
cmp eax, 1
jne 0x40b7a1
mov ecx, dword [edi]
add dword [edi + 0x3c], esi
sub dword [edi + 0x58], esi
cmp byte [edi + 0x6c], 0
mov dword [ebp - 0x1c], ecx
mov dword [edi + 4], ecx
mov dword [edi + 8], esi
je 0x40b691
and dword [ebp - 0x18], 0
test esi, esi
je 0x40b691
lea eax, [edi + 0x70]
mov edi, dword [ebp - 0x18]
mov dword [ebp - 0x14], eax
mov eax, dword [eax + 8]
and eax, 0xfffd
or eax, 2
mov ebx, eax
xor ebx, 1
imul ebx, eax
shr ebx, 8
xor bl, byte [edi + ecx]
mov ecx, dword [ebp - 0x14]
mov dl, bl
call fcn.0040a460
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x14]
mov byte [edi + ecx], bl
inc edi
cmp edi, esi
jb 0x40b65a
mov edi, dword [ebp - 0x10]
mov ebx, dword [ebp + 0xc]
mov ecx, dword [edi + 0x7c]
mov edx, dword [edi + 8]
cmp ecx, edx
cmova ecx, edx
test ecx, ecx
je 0x40b6cd
mov eax, dword [edi + 4]
add eax, ecx
sub edx, ecx
mov bl, byte [eax - 1]
sub dword [edi + 0x5c], ecx
sub dword [edi + 0x7c], ecx
mov byte [ebp - 1], bl
mov ebx, dword [ebp + 0xc]
mov dword [edi + 8], edx
mov dword [edi + 4], eax
jne 0x40b6cd
mov al, byte [ebp - 1]
cmp al, byte [edi + 0x80]
jne 0x40b7a6
cmp dword [edi + 0x64], 0
jne 0x40b73b
mov edx, dword [edi + 8]
cmp dword [edi + 0x14], edx
cmovb edx, dword [edi + 0x14]
xor esi, esi
mov dword [ebp - 0x1c], edx
test edx, edx
je 0x40b6f7
mov eax, dword [edi + 4]
mov ecx, dword [edi + 0x10]
mov al, byte [esi + eax]
mov byte [esi + ecx], al
inc esi
cmp esi, edx
jb 0x40b6e6
mov esi, dword [edi + 0x10]
mov ecx, dword [edi + 0x50]
push edx
mov edx, esi
call fcn.0040a37c
mov edx, dword [ebp - 8]
pop ecx
mov ecx, dword [ebp - 0x1c]
sub dword [edi + 0x5c], ecx
sub dword [edi + 8], ecx
sub dword [edi + 0x14], ecx
add dword [edi + 4], ecx
add dword [edi + 0x18], ecx
mov dword [edi + 0x50], eax
lea eax, [esi + ecx]
mov esi, dword [ebp - 0xc]
add esi, ecx
cmp dword [edi + 0x5c], 0
mov dword [edi + 0x10], eax
mov dword [ebp - 0xc], esi
jne 0x40b783
test ebx, ebx
je 0x40b783
mov byte [ebx], 1
jmp 0x40b783
mov ebx, dword [ebp - 0x10]
mov esi, dword [edi + 0x18]
mov edi, dword [edi + 0x10]
lea ecx, [ebx + 4]
call fcn.0040a702
mov ebx, dword [ebx + 0x18]
mov edx, edi
mov edi, dword [ebp - 0x10]
sub ebx, esi
mov ecx, dword [edi + 0x50]
push ebx
mov dword [ebp - 8], eax
call fcn.0040a37c
mov esi, dword [ebp - 0xc]
mov edx, dword [ebp - 8]
sub dword [edi + 0x5c], ebx
add esi, ebx
pop ecx
mov dword [edi + 0x50], eax
mov dword [ebp - 0xc], esi
cmp edx, 1
je 0x40b7b5
cmp dword [edi + 0x5c], 0
je 0x40b7b5
test edx, edx
jne 0x40b7b1
cmp dword [edi + 0x14], 0
jbe 0x40b7ad
mov ebx, dword [ebp + 0xc]
jmp 0x40b5d8
test ebx, ebx
je 0x40b5b5
mov byte [ebx], 1
jmp 0x40b5b5
or eax, 0xffffffff
jmp 0x40b7c1
push 0xffffffffffffff96
jmp 0x40b596
test edx, edx
je 0x40b7bf
mov eax, edx
jmp 0x40b7c1
mov ecx, dword [ebp + 0xc]
test ecx, ecx
je 0x40b7bf
mov byte [ecx], 1
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret