Function at 0x40d1bc
Capabilities:
Encode data using xor

Disassembly:
sub esp, 0x54
push ebp
push edi
mov edi, dword [esp + 0x64]
mov ebp, ecx
mov dword [esp + 0x1c], ebp
test edi, edi
je 0x40d676
shr edi, 4
cmp byte [ebp], 0
mov dword [esp + 0x64], edi
je 0x40d1f3
push dword [esp + 0x68]
push edi
push dword [esp + 0x68]
call fcn.0040d67e
jmp 0x40d676
lea eax, [ebp + 8]
push 0x10
push eax
mov dword [esp + 0x30], eax
lea eax, [esp + 0x54]
push eax
call fcn.0041ee90
add esp, 0xc
test edi, edi
je 0x40d663
mov edx, dword [esp + 0x60]
push ebx
push esi
lea eax, [edx + 8]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x70]
sub edx, eax
mov dword [esp + 0x2c], edx
lea ecx, [eax + 8]
mov dword [esp + 0x20], ecx
mov esi, dword [ebp + 4]
add edx, 0xfffffff8
mov eax, esi
add ecx, edx
shl eax, 4
add eax, 0x18
mov dword [esp + 0x28], ecx
add eax, ebp
push eax
push ecx
lea eax, [esp + 0x4c]
push eax
call fcn.0040d18a
mov edx, dword [esp + 0x44]
movzx ecx, byte [esp + 0x4b]
movzx eax, dl
mov ebx, dword [eax*4 + 0x43ee40]
xor ebx, dword [ecx*4 + 0x43fa40]
movzx eax, byte [esp + 0x4e]
xor ebx, dword [eax*4 + 0x43f640]
mov dword [esp + 0x68], ebx
mov ebx, dword [esp + 0x50]
mov ecx, dword [esp + 0x68]
movzx eax, bh
xor ecx, dword [eax*4 + 0x43f240]
mov dword [esp + 0x68], ecx
mov dword [esp + 0x34], ecx
movzx ecx, dh
mov edx, dword [esp + 0x48]
movzx eax, dl
mov ecx, dword [ecx*4 + 0x43f240]
xor ecx, dword [eax*4 + 0x43ee40]
movzx eax, byte [esp + 0x4f]
xor ecx, dword [eax*4 + 0x43fa40]
movzx eax, byte [esp + 0x52]
xor ecx, dword [eax*4 + 0x43f640]
movzx eax, byte [esp + 0x46]
mov dword [esp + 0x70], ecx
mov dword [esp + 0x38], ecx
movzx ecx, dh
mov eax, dword [eax*4 + 0x43f640]
mov edx, dword [esp + 0x4c]
xor eax, dword [ecx*4 + 0x43f240]
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x10]
movzx eax, dl
xor ecx, dword [eax*4 + 0x43ee40]
movzx eax, byte [esp + 0x53]
xor ecx, dword [eax*4 + 0x43fa40]
movzx eax, byte [esp + 0x47]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x3c], ecx
movzx ecx, byte [esp + 0x4a]
mov eax, dword [eax*4 + 0x43fa40]
xor eax, dword [ecx*4 + 0x43f640]
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x14]
movzx eax, dh
xor ecx, dword [eax*4 + 0x43f240]
movzx eax, bl
xor ecx, dword [eax*4 + 0x43ee40]
dec esi
mov dword [esp + 0x14], ecx
mov dword [esp + 0x40], ecx
cmp esi, 1
jle 0x40d4a5
mov edi, dword [esp + 0x68]
lea eax, [esi + 2]
shl eax, 4
add eax, ebp
dec esi
mov dword [esp + 0x14], eax
mov ebp, eax
mov dword [esp + 0x18], esi
mov eax, dword [ebp - 8]
xor eax, edi
mov edx, dword [ebp]
mov dword [esp + 0x68], eax
lea ebp, [ebp - 0x10]
mov eax, dword [ebp + 0x14]
xor eax, ecx
xor edx, dword [esp + 0x10]
mov dword [esp + 0x14], eax
shr eax, 8
movzx ecx, al
mov eax, edx
mov ebx, dword [ebp + 0xc]
xor ebx, dword [esp + 0x70]
shr eax, 0x10
mov edi, dword [ecx*4 + 0x43f240]
mov ecx, edx
movzx eax, al
shr ecx, 0x18
xor edi, dword [eax*4 + 0x43f640]
mov eax, ebx
shr eax, 0x18
xor edi, dword [eax*4 + 0x43fa40]
mov eax, dword [esp + 0x68]
movzx eax, al
xor edi, dword [eax*4 + 0x43ee40]
mov eax, dword [esp + 0x14]
shr eax, 0x10
movzx eax, al
mov dword [esp + 0x34], edi
mov eax, dword [eax*4 + 0x43f640]
xor eax, dword [ecx*4 + 0x43fa40]
mov dword [esp + 0x70], eax
mov eax, dword [esp + 0x68]
mov ecx, dword [esp + 0x70]
shr eax, 8
movzx eax, al
xor ecx, dword [eax*4 + 0x43f240]
movzx eax, bl
xor ecx, dword [eax*4 + 0x43ee40]
mov eax, ebx
mov dword [esp + 0x70], ecx
mov dword [esp + 0x38], ecx
mov ecx, dword [esp + 0x14]
shr eax, 8
shr ecx, 0x18
movzx eax, al
shr ebx, 0x10
mov ecx, dword [ecx*4 + 0x43fa40]
xor ecx, dword [eax*4 + 0x43f240]
mov eax, dword [esp + 0x68]
shr eax, 0x10
movzx eax, al
xor ecx, dword [eax*4 + 0x43f640]
movzx eax, dl
shr edx, 8
xor ecx, dword [eax*4 + 0x43ee40]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x3c], ecx
movzx ecx, dl
movzx eax, bl
mov ecx, dword [ecx*4 + 0x43f240]
xor ecx, dword [eax*4 + 0x43f640]
mov eax, dword [esp + 0x68]
shr eax, 0x18
xor ecx, dword [eax*4 + 0x43fa40]
mov eax, dword [esp + 0x14]
movzx eax, al
xor ecx, dword [eax*4 + 0x43ee40]
sub dword [esp + 0x18], 1
mov dword [esp + 0x40], ecx
jne 0x40d36b
mov ebp, dword [esp + 0x24]
mov dword [esp + 0x68], edi
mov edi, dword [esp + 0x6c]
mov dword [esp + 0x14], ecx
mov eax, dword [ebp + 0x28]
xor eax, dword [esp + 0x68]
mov dword [esp + 0x6c], eax
mov dword [esp + 0x44], eax
movzx eax, al
mov ecx, dword [ebp + 0x34]
xor ecx, dword [esp + 0x14]
mov edx, dword [ebp + 0x30]
mov al, byte [eax + 0x43dd20]
mov byte [esp + 0x34], al
mov eax, ecx
shr eax, 8
movzx eax, al
xor edx, dword [esp + 0x10]
mov ebx, dword [ebp + 0x2c]
xor ebx, dword [esp + 0x70]
mov al, byte [eax + 0x43dd20]
mov byte [esp + 0x35], al
mov eax, edx
shr eax, 0x10
movzx eax, al
mov esi, dword [esp + 0x6c]
mov dword [esp + 0x4c], edx
mov dword [esp + 0x48], ebx
mov al, byte [eax + 0x43dd20]
mov byte [esp + 0x36], al
invalid