Function at 0x405309
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x34
push ebp
mov ebp, dword [esp + 0x40]
push edi
mov edi, ecx
test ebp, ebp
je 0x40573f
shr ebp, 4
cmp byte [edi], 0
mov dword [esp + 0x44], ebp
je 0x40533b
push dword [esp + 0x48]
push ebp
push dword [esp + 0x48]
call fcn.00405747
jmp 0x40573f
lea ecx, [edi + 8]
mov dword [esp + 0x18], ecx
push esi
mov esi, ecx
test ebp, ebp
je 0x405728
mov eax, dword [esp + 0x4c]
add eax, 4
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x44]
add eax, 8
mov dword [esp + 0x18], eax
push ebx
cmp byte [edi + 1], 0
lea ebx, [eax - 8]
je 0x40538b
push ebx
push esi
lea eax, [esp + 0x3c]
push eax
call fcn.004052d7
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x3c]
mov esi, dword [esp + 0x38]
mov ebx, dword [esp + 0x34]
jmp 0x4053a5
mov ebx, dword [ebx]
mov esi, dword [eax - 4]
mov edx, dword [eax]
mov ecx, dword [eax + 4]
mov dword [esp + 0x34], ebx
mov dword [esp + 0x38], esi
mov dword [esp + 0x3c], edx
mov dword [esp + 0x40], ecx
mov eax, dword [edi + 0x18]
xor eax, ebx
mov ebx, dword [edi + 0x1c]
mov dword [esp + 0x14], eax
xor ebx, esi
mov dword [esp + 0x24], eax
mov eax, dword [edi + 0x20]
xor eax, edx
mov esi, dword [esp + 0x10]
mov edx, dword [edi + 0x24]
add esi, 0xfffffffc
mov dword [esp + 0x18], eax
xor edx, ecx
mov dword [esp + 0x2c], eax
shr eax, 0x10
movzx ecx, al
mov eax, ebx
shr eax, 8
movzx eax, al
mov dword [esp + 0x28], ebx
mov ecx, dword [ecx*4 + 0x43c838]
mov dword [esp + 0x30], edx
xor ecx, dword [eax*4 + 0x43c438]
mov eax, edx
shr eax, 0x18
xor ecx, dword [eax*4 + 0x43cc38]
mov eax, dword [esp + 0x14]
movzx eax, al
xor ecx, dword [eax*4 + 0x43c038]
mov eax, edx
shr eax, 0x10
mov dword [esi], ecx
movzx ecx, al
mov eax, dword [esp + 0x18]
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x43c838]
xor ecx, dword [eax*4 + 0x43c438]
mov eax, dword [esp + 0x14]
shr eax, 0x18
xor ecx, dword [eax*4 + 0x43cc38]
movzx eax, bl
xor ecx, dword [eax*4 + 0x43c038]
mov eax, dword [esp + 0x10]
mov dword [eax], ecx
mov eax, dword [esp + 0x14]
shr eax, 0x10
movzx ecx, al
mov eax, edx
shr eax, 8
movzx eax, al
mov ecx, dword [ecx*4 + 0x43c838]
xor ecx, dword [eax*4 + 0x43c438]
mov eax, ebx
shr eax, 0x18
shr ebx, 0x10
xor ecx, dword [eax*4 + 0x43cc38]
mov eax, dword [esp + 0x18]
movzx eax, al
xor ecx, dword [eax*4 + 0x43c038]
mov eax, dword [esp + 0x10]
mov dword [eax + 4], ecx
mov eax, dword [esp + 0x14]
shr eax, 8
movzx ecx, al
movzx eax, bl
mov ebx, dword [esp + 0x10]
mov ecx, dword [ecx*4 + 0x43c438]
xor ecx, dword [eax*4 + 0x43c838]
mov eax, dword [esp + 0x18]
shr eax, 0x18
xor ecx, dword [eax*4 + 0x43cc38]
movzx eax, dl
xor ecx, dword [eax*4 + 0x43c038]
mov dword [ebx + 8], ecx
xor ecx, ecx
mov edx, dword [edi + 4]
inc ecx
mov dword [esp + 0x18], ecx
lea eax, [edx - 1]
cmp eax, ecx
jle 0x4055ef
lea ecx, [edi + 0x28]
mov ebp, ebx
mov dword [esp + 0x14], ecx
push ecx
push esi
lea eax, [esp + 0x2c]
push eax
call fcn.004052d7
mov eax, dword [esp + 0x24]
mov edx, dword [esp + 0x28]
movzx ecx, al
movzx eax, dh
mov ebx, dword [esp + 0x2c]
mov ecx, dword [ecx*4 + 0x43c038]
xor ecx, dword [eax*4 + 0x43c438]
movzx eax, byte [esp + 0x2e]
xor ecx, dword [eax*4 + 0x43c838]
movzx eax, byte [esp + 0x33]
xor ecx, dword [eax*4 + 0x43cc38]
movzx eax, byte [esp + 0x27]
mov dword [esi], ecx
movzx ecx, dl
mov edx, dword [eax*4 + 0x43cc38]
movzx eax, bh
xor edx, dword [ecx*4 + 0x43c038]
movzx ecx, byte [esp + 0x2b]
xor edx, dword [eax*4 + 0x43c438]
movzx eax, byte [esp + 0x32]
xor edx, dword [eax*4 + 0x43c838]
movzx eax, byte [esp + 0x26]
mov dword [ebp], edx
mov edx, dword [eax*4 + 0x43c838]
xor edx, dword [ecx*4 + 0x43cc38]
movzx ecx, byte [esp + 0x2a]
movzx eax, bl
mov ebx, dword [esp + 0x30]
xor edx, dword [eax*4 + 0x43c038]
movzx eax, bh
xor edx, dword [eax*4 + 0x43c438]
mov eax, dword [esp + 0x24]
movzx eax, ah
mov dword [ebp + 4], edx
mov edx, dword [eax*4 + 0x43c438]
xor edx, dword [ecx*4 + 0x43c838]
movzx eax, byte [esp + 0x2f]
mov ecx, dword [esp + 0x14]
add ecx, 0x10
mov dword [esp + 0x14], ecx
xor edx, dword [eax*4 + 0x43cc38]
movzx eax, bl
mov ebx, dword [esp + 0x18]
xor edx, dword [eax*4 + 0x43c038]
inc ebx
mov dword [ebp + 8], edx
mov edx, dword [edi + 4]
mov dword [esp + 0x18], ebx
lea eax, [edx - 1]
cmp ebx, eax
jl 0x4054ea
mov ebp, dword [esp + 0x4c]
mov ebx, dword [esp + 0x10]
shl edx, 4
lea eax, [edi + 8]
add eax, edx
push eax
push esi
lea eax, [esp + 0x2c]
push eax
call fcn.004052d7
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x28]
movzx eax, dl
mov al, byte [eax*4 + 0x43c039]
mov byte [esi], al
movzx eax, ch
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx - 3], al
movzx eax, byte [esp + 0x2e]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx - 2], al
movzx eax, byte [esp + 0x33]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx - 1], al
movzx eax, cl
mov ecx, dword [esp + 0x2c]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx], al
movzx eax, ch
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 1], al
movzx eax, byte [esp + 0x32]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 2], al
movzx eax, byte [esp + 0x27]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 3], al
movzx eax, cl
mov ecx, dword [esp + 0x30]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 4], al
movzx eax, ch
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 5], al
movzx eax, byte [esp + 0x26]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 6], al
movzx eax, byte [esp + 0x2b]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 7], al
movzx eax, cl
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 8], al
movzx eax, dh
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 9], al
movzx eax, byte [esp + 0x2a]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 0xa], al
movzx eax, byte [esp + 0x2f]
mov al, byte [eax*4 + 0x43c039]
mov byte [ebx + 0xb], al
mov eax, dword [edi + 4]
shl eax, 4
add eax, 0x18
add eax, edi
push eax
push esi
push esi
call fcn.004052d7
mov eax, dword [esp + 0x1c]
add ebx, 0x10
add eax, 0x10
mov dword [esp + 0x10], ebx
sub ebp, 1
mov dword [esp + 0x1c], eax
mov dword [esp + 0x4c], ebp
jne 0x405364
mov ecx, dword [esp + 0x20]
pop ebx
mov eax, dword [esi]
mov dword [ecx], eax
mov eax, dword [esi + 4]
mov dword [ecx + 4], eax
mov eax, dword [esi + 8]
mov dword [ecx + 8], eax
mov eax, dword [esi + 0xc]
mov dword [ecx + 0xc], eax
pop esi
pop edi
pop ebp
add esp, 0x34
ret 0xc