Function at 0x41d810
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x28
cmp dword [ecx], 0xffffffff
je 0x41d862
mov ah, byte [ebp + 0x18]
mov al, byte [ebp + 0x14]
movzx edx, byte [ebp + 0x10]
mov ebx, dword [ebp + 0xc]
and dl, 0xf
shl al, 7
or al, dl
mov byte [esp + 6], al
mov al, ah
shl al, 7
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
cmp ebx, 0x7d
mov dword [esp + 0x20], ecx
ja 0x41d869
or al, bl
mov byte [esp + 7], al
xor esi, esi
jmp 0x41d8ae
xor ebx, ebx
jmp 0x41dab1
cmp ebx, 0xffff
ja 0x41d893
or al, 0x7e
mov byte [esp + 7], al
mov eax, ebx
rol ax, 8
movzx eax, ax
mov dword [esp + 0x10], eax
mov dword [esp + 0x14], 0
mov esi, 2
jmp 0x41d8ae
or al, 0x7f
mov byte [esp + 7], al
mov eax, ebx
bswap eax
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov esi, 8
lea eax, [ebx + 0xe]
push eax
call fcn.00408620
add esp, 4
mov ebx, eax
lea eax, [esp + 6]
mov edx, eax
mov edi, ebx
xor ecx, ecx
xchg esi, edx
rep movsd dword es:[edi], dword [esi]
xchg esi, edx
mov edi, ebx
mov ecx, 1
xchg esi, eax
rep movsw word es:[edi], word [esi]
xchg esi, eax
mov eax, ebx
add ebx, 2
cmp dword [ebp + 0xc], 0x7e
mov dword [esp + 0x1c], eax
jb 0x41d915
mov ecx, esi
shr ecx, 2
lea eax, [esp + 0x10]
mov edi, ebx
xchg esi, eax
rep movsd dword es:[edi], dword [esi]
xchg esi, eax
mov eax, esi
and eax, 0xfffffff8
add ebx, eax
add eax, esp
add eax, 0x10
mov ecx, esi
shr ecx, 1
and ecx, 1
mov edi, ebx
xchg esi, eax
rep movsw word es:[edi], word [esi]
xchg esi, eax
and esi, 2
add ebx, esi
mov edx, dword [ebp + 8]
cmp byte [ebp + 0x18], 0
je 0x41d97d
mov edx, dword [ebp + 0x1c]
mov esi, edx
mov edi, ebx
mov ecx, 1
xchg esi, esi
rep movsd dword es:[edi], dword [esi]
xchg esi, esi
lea esi, [ebx + 4]
lea eax, [edx + 4]
mov edi, esi
xor ecx, ecx
xchg esi, eax
rep movsw word es:[edi], word [esi]
xchg esi, eax
cmp byte [edx], 0
jne 0x41d95a
cmp byte [edx + 1], 0
jne 0x41d95a
cmp byte [edx + 2], 0
jne 0x41d95a
cmp byte [edx + 3], 0
je 0x41dabd
mov edx, dword [ebp + 0xc]
mov dword [esp + 8], edx
test edx, edx
je 0x41da40
movzx eax, byte [esi]
mov ecx, edx
and ecx, 3
cmp edx, 4
jae 0x41d9ec
xor edi, edi
jmp 0x41da26
mov esi, dword [ebp + 0xc]
mov ecx, esi
shr ecx, 2
mov eax, edx
mov edi, ebx
xchg esi, eax
rep movsd dword es:[edi], dword [esi]
xchg esi, eax
mov ecx, esi
mov eax, esi
and eax, 0xfffffffc
lea esi, [ebx + eax]
mov dword [esp + 0xc], eax
add edx, eax
mov eax, ecx
and eax, 3
mov ecx, eax
shr ecx, 1
mov dword [esp + 8], edx
mov edi, esi
xchg esi, edx
rep movsw word es:[edi], word [esi]
xchg esi, edx
mov edi, dword [ebp + 0xc]
and edi, 2
add esi, edi
mov ecx, eax
xor ecx, 0xfffffffe
or eax, 1
and eax, ecx
je 0x41da40
mov ecx, dword [esp + 8]
add ecx, edi
mov dword [esp + 0x18], eax
push eax
push ecx
push esi
call fcn.00408650
add esp, 0xc
mov eax, dword [esp + 0xc]
or eax, dword [esp + 0x18]
add ebx, edi
add ebx, eax
mov esi, ebx
jmp 0x41da40
and dword [esp + 8], 0xfffffffc
xor edi, edi
mov edx, dword [ebp + 0x1c]
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
xor al, byte [edx]
mov byte [ebx + edi + 5], al
xor al, byte [edx + 1]
mov byte [ebx + edi + 6], al
xor al, byte [edx + 2]
mov byte [ebx + edi + 7], al
xor al, byte [edx + 3]
mov byte [ebx + edi + 8], al
add edi, 4
cmp dword [esp + 8], edi
jne 0x41da00
add esi, edi
test ecx, ecx
mov edx, dword [ebp + 0x1c]
je 0x41da40
nop
nop
nop
mov ebx, edi
and ebx, 3
xor al, byte [edx + ebx]
mov byte [esi + 1], al
inc esi
inc edi
dec ecx
jne 0x41da30
mov edi, dword [esp + 0x1c]
sub esi, edi
push 0x12007ce3
push dword [0x449b7c]
call fcn.0043d470
add esp, 8
push 0
push esi
push edi
mov esi, dword [esp + 0x2c]
push dword [esi]
call eax
cmp eax, 0xffffffff
setne bl
jne 0x41daa8
cmp dword [esi], 0xffffffff
je 0x41daa8
push 0x4f80c377
push dword [0x449b7c]
call fcn.0043d470
add esp, 8
push 2
push dword [esi]
call eax
push 0xa2994af6
push dword [0x449b7c]
call fcn.0043d470
add esp, 8
push dword [esi]
call eax
mov dword [esi], 0xffffffff
push edi
call fcn.00408630
add esp, 4
mov eax, ebx
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret 0x18
mov ecx, dword [ebp + 0xc]
shr ecx, 2
mov edx, dword [ebp + 8]
mov eax, edx
mov edi, esi
xchg esi, eax
rep movsd dword es:[edi], dword [esi]
xchg esi, eax
mov ecx, dword [ebp + 0xc]
mov eax, ecx
and eax, 0xfffffffc
add esi, eax
mov dword [esp + 0x18], eax
add edx, eax
mov eax, ecx
and eax, 3
mov ecx, eax
shr ecx, 1
mov dword [esp + 8], edx
mov dword [esp + 0xc], edx
mov edi, esi
mov edx, dword [esp + 0xc]
xchg esi, edx
rep movsw word es:[edi], word [esi]
xchg esi, edx
mov edi, dword [ebp + 0xc]
and edi, 2
add esi, edi
mov ecx, eax
xor ecx, 0xfffffffe
or eax, 1
and eax, ecx
je 0x41da40
mov ecx, dword [esp + 8]
add ecx, edi
mov dword [esp + 0xc], eax
push eax
push ecx
push esi
call fcn.00408650
add esp, 0xc
mov eax, dword [esp + 0x18]
or eax, dword [esp + 0xc]
add eax, edi
lea esi, [ebx + eax]
add esi, 4
jmp 0x41da40