Function at 0x405664
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
push ebx
push esi
push edi
mov edi, dword [ebp + 0x14]
cmp dword [edi], 0
je 0x405679
push 0xfffffffffffffffb
jmp 0x405687
cmp dword [edi + 4], 2
je 0x40568d
cmp dword [edi + 8], 0
jne 0x40568d
push 0xfffffffffffffffa
pop eax
jmp 0x405910
mov esi, dword [ebp + 8]
test esi, esi
je 0x40590e
mov eax, dword [ebp + 0xc]
test eax, eax
jle 0x40590e
mov ebx, 0x80
cdq
mov ecx, ebx
idiv ecx
mov ecx, eax
mov eax, dword [edi + 4]
sub eax, 0
mov dword [ebp - 4], ecx
je 0x4058e9
dec eax
je 0x405862
dec eax
je 0x4056d0
or eax, 0xffffffff
jmp 0x405910
mov eax, dword [edi + 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [edi + 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0x14]
mov dword [ebp - 0xc], eax
mov eax, dword [edi + 0x18]
test ecx, ecx
mov dword [ebp - 8], eax
jle 0x405906
mov dword [ebp + 0xc], ecx
and dword [ebp + 8], 0
mov eax, dword [ebp - 0x14]
push edi
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 8]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x24]
push eax
call fcn.00405bc2
mov al, byte [ebp - 0x13]
mov cl, byte [ebp - 0x14]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0x13]
mov byte [ebp - 0x14], al
mov al, byte [ebp - 0x12]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0x12]
mov byte [ebp - 0x13], al
mov al, byte [ebp - 0x11]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0x11]
mov byte [ebp - 0x12], al
mov al, byte [ebp - 0x10]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0x10]
mov byte [ebp - 0x11], al
mov al, byte [ebp - 0xf]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0xf]
mov byte [ebp - 0x10], al
mov al, byte [ebp - 0xe]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0xe]
mov byte [ebp - 0xf], al
mov al, byte [ebp - 0xd]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0xd]
mov byte [ebp - 0xe], al
mov al, byte [ebp - 0xc]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0xc]
mov byte [ebp - 0xd], al
mov al, byte [ebp - 0xb]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0xb]
mov byte [ebp - 0xc], al
mov al, byte [ebp - 0xa]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 0xa]
mov byte [ebp - 0xb], al
mov al, byte [ebp - 9]
shr al, 7
shl cl, 1
add esp, 0xc
or al, cl
mov byte [ebp - 0xa], al
mov al, byte [ebp - 8]
mov cl, byte [ebp - 9]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 8]
mov byte [ebp - 9], al
mov al, byte [ebp - 7]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 7]
mov byte [ebp - 8], al
mov al, byte [ebp - 6]
shr al, 7
shl cl, 1
or al, cl
mov cl, byte [ebp - 6]
mov byte [ebp - 7], al
mov al, byte [ebp - 5]
shr al, 7
shl cl, 1
or al, cl
push 8
mov byte [ebp - 6], al
mov eax, dword [ebp + 8]
mov dword [ebp + 0x14], eax
pop ecx
cdq
idiv ecx
and dword [ebp + 0x14], 7
mov cl, 7
sub cl, byte [ebp + 0x14]
mov dl, byte [esi + eax]
shr dl, cl
mov cl, byte [ebp - 5]
shl cl, 1
and dl, 1
or dl, cl
mov ecx, dword [ebp + 0x10]
mov byte [ebp - 5], dl
mov dl, byte [ebp - 0x24]
add eax, ecx
mov cl, byte [ebp + 0x14]
and dl, bl
shr dl, cl
xor byte [eax], dl
inc dword [ebp + 8]
cmp dword [ebp + 8], ebx
jl 0x4056f7
dec dword [ebp + 0xc]
jne 0x4056f3
jmp 0x405906
mov eax, dword [edi + 0xc]
mov dword [ebp - 0x14], eax
mov eax, dword [edi + 0x10]
mov dword [ebp - 0x10], eax
mov eax, dword [edi + 0x14]
mov dword [ebp - 0xc], eax
mov eax, dword [edi + 0x18]
test ecx, ecx
mov dword [ebp - 8], eax
jle 0x405906
mov ebx, dword [ebp + 0x10]
mov dword [ebp + 0x14], ecx
lea eax, [ebp - 0x24]
push edi
push eax
push esi
call fcn.00405ee6
mov eax, dword [ebp - 0x14]
add esp, 0xc
xor dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x10]
xor dword [ebp - 0x20], eax
mov eax, dword [ebp - 0xc]
xor dword [ebp - 0x1c], eax
mov eax, dword [ebp - 8]
xor dword [ebp - 0x18], eax
mov eax, dword [esi]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x24]
mov dword [ebx], eax
mov eax, dword [esi + 4]
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x20]
mov dword [ebx + 4], eax
mov eax, dword [esi + 8]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebx + 8], eax
mov eax, dword [esi + 0xc]
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x18]
mov dword [ebx + 0xc], eax
add esi, 0x10
add ebx, 0x10
dec dword [ebp + 0x14]
jne 0x405888
jmp 0x405906
test ecx, ecx
jle 0x405906
mov ebx, ecx
push edi
push dword [ebp + 0x10]
push esi
call fcn.00405ee6
add dword [ebp + 0x10], 0x10
add esp, 0xc
add esi, 0x10
dec ebx
jne 0x4058ef
mov eax, dword [ebp - 4]
shl eax, 7
jmp 0x405910
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret