Function at 0x407820
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x3c
mov eax, dword [0x488fdc]
xor eax, esp
mov dword [esp + 0x38], eax
cmp byte [0x4bcc16], 0
push ebx
mov ebx, dword [ebp + 0x10]
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0xc]
mov dword [esp + 0x24], ecx
mov dword [esp + 0x2c], edi
mov dword [esp + 0x30], ebx
jne 0x40785a
call fcn.0040b540
cmp byte [0x4bcc20], 0
je 0x407887
mov ecx, dword [esp + 0x24]
push 0
push 0x10
push ebx
push edi
push esi
call fcn.004085d0
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x38]
xor ecx, esp
call fcn.0044545a
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esi]
mov ebx, dword [esi + 8]
mov eax, dword [esi + 0xc]
mov edi, dword [esi + 4]
mov edx, dword [esp + 0x24]
mov esi, dword [edx + 0x118]
mov edx, dword [esi + 4]
mov dword [esp + 0x20], eax
mov eax, dword [esi]
xor eax, ecx
mov ecx, dword [esi + 8]
xor ecx, ebx
mov ebx, dword [esi + 0x1c]
mov dword [esp + 0x10], ecx
mov ecx, dword [esi + 0xc]
xor ecx, dword [esp + 0x20]
xor edx, edi
mov dword [esp + 0x20], ecx
mov ecx, dword [esi + 0x10]
mov dword [esp + 0x1c], ecx
mov ecx, dword [esi + 0x14]
mov dword [esp + 0x18], ecx
mov ecx, dword [esi + 0x18]
add esi, 0x20
cmp byte [0x4bcc16], 0
mov dword [esp + 0x28], eax
mov dword [esp + 0x14], edx
mov dword [esp + 0xc], ecx
jne 0x4078f6
call fcn.0040b540
mov eax, dword [esp + 0x28]
mov edx, dword [esp + 0x14]
xor edi, edi
xor ecx, ecx
jmp 0x407904
mov edi, dword [esp + 0x14]
and edi, dword [ecx + 0x4bc370]
add ecx, dword [0x48b3b0]
mov dword [esp + 0x14], edi
cmp ecx, 0x800
jb 0x407900
mov ecx, edi
and ecx, dword [0x4bcb68]
or dword [esp + 0x10], ecx
or eax, ecx
or edx, ecx
mov dword [esp + 0x14], ecx
mov ecx, dword [esp + 0x20]
or ecx, dword [esp + 0x14]
movzx edi, cl
xor ebx, dword [edi*8 + 0x4bc374]
shr ecx, 8
mov dword [esp + 0x20], ecx
movzx ecx, cl
mov ecx, dword [ecx*8 + 0x4bc371]
xor dword [esp + 0xc], ecx
movzx ecx, byte [esp + 0x10]
mov ecx, dword [ecx*8 + 0x4bc374]
xor dword [esp + 0xc], ecx
mov ecx, dword [esp + 0x10]
shr dword [esp + 0x20], 8
movzx edi, byte [esp + 0x20]
shr ecx, 8
mov dword [esp + 0x10], ecx
movzx ecx, cl
mov ecx, dword [ecx*8 + 0x4bc371]
xor ecx, dword [edi*8 + 0x4bc372]
mov edi, dword [esp + 0x18]
xor edi, ecx
shr dword [esp + 0x10], 8
movzx ecx, dl
xor edi, dword [ecx*8 + 0x4bc374]
shr edx, 8
mov dword [esp + 0x18], edi
mov edi, dword [esp + 0x20]
shr edi, 8
mov edi, dword [edi*8 + 0x4bc373]
movzx ecx, dl
xor edi, dword [ecx*8 + 0x4bc371]
movzx ecx, byte [esp + 0x10]
xor edi, dword [ecx*8 + 0x4bc372]
mov ecx, dword [esp + 0x1c]
xor ecx, edi
movzx edi, al
xor ecx, dword [edi*8 + 0x4bc374]
mov edi, dword [esp + 0x10]
shr eax, 8
mov dword [esp + 0x1c], ecx
movzx ecx, al
shr edi, 8
mov edi, dword [edi*8 + 0x4bc373]
xor edi, dword [ecx*8 + 0x4bc371]
shr edx, 8
movzx ecx, dl
xor edi, dword [ecx*8 + 0x4bc372]
shr eax, 8
movzx ecx, al
shr edx, 8
mov edx, dword [edx*8 + 0x4bc373]
xor edx, dword [ecx*8 + 0x4bc372]
mov ecx, dword [esp + 0x24]
xor dword [esp + 0xc], edx
shr eax, 8
mov eax, dword [eax*8 + 0x4bc373]
xor dword [esp + 0x18], eax
mov eax, dword [ecx + 0xc]
shr eax, 1
xor ebx, edi
dec eax
mov dword [esp + 0x24], eax
movzx edx, bl
mov eax, dword [edx*8 + 0x4bc373]
shr ebx, 8
movzx ecx, bl
mov edi, dword [ecx*8 + 0x4bc372]
movzx ecx, byte [esp + 0xc]
xor edi, dword [esi + 4]
shr ebx, 8
xor eax, dword [esi]
movzx edx, bl
shr ebx, 8
mov dword [esp + 0x28], ecx
mov ecx, dword [ebx*8 + 0x4bc374]
mov ebx, dword [esp + 0x28]
xor ecx, dword [ebx*8 + 0x4bc373]
mov ebx, dword [esp + 0xc]
shr ebx, 8
mov dword [esp + 0xc], ebx
movzx ebx, bl
xor eax, dword [ebx*8 + 0x4bc372]
mov ebx, dword [esp + 0xc]
mov edx, dword [edx*8 + 0x4bc371]
xor edx, dword [esi + 8]
shr ebx, 8
xor ecx, dword [esi + 0xc]
mov dword [esp + 0xc], ebx
movzx ebx, bl
xor edi, dword [ebx*8 + 0x4bc371]
movzx ebx, byte [esp + 0x18]
mov dword [esp + 0x14], edi
mov edi, dword [esp + 0xc]
shr edi, 8
mov edi, dword [edi*8 + 0x4bc374]
xor edi, dword [ebx*8 + 0x4bc373]
mov ebx, dword [esp + 0x18]
xor edx, edi
shr ebx, 8
movzx edi, bl
xor ecx, dword [edi*8 + 0x4bc372]
shr ebx, 8
movzx edi, bl
xor eax, dword [edi*8 + 0x4bc371]
movzx edi, byte [esp + 0x1c]
shr ebx, 8
mov ebx, dword [ebx*8 + 0x4bc374]
xor ebx, dword [edi*8 + 0x4bc373]
xor dword [esp + 0x14], ebx
mov ebx, dword [esp + 0x1c]
shr ebx, 8
movzx edi, bl
xor edx, dword [edi*8 + 0x4bc372]
shr ebx, 8
movzx edi, bl
xor ecx, dword [edi*8 + 0x4bc371]
shr ebx, 8
xor eax, dword [ebx*8 + 0x4bc374]
movzx edi, cl
mov edi, dword [edi*8 + 0x4bc373]
xor edi, dword [esi + 0x10]
shr ecx, 8
mov dword [esp + 0x1c], edi
movzx edi, cl
mov edi, dword [edi*8 + 0x4bc372]
xor edi, dword [esi + 0x14]
shr ecx, 8
mov dword [esp + 0x18], edi
movzx ebx, dl
mov edi, ecx
shr edi, 8
mov edi, dword [edi*8 + 0x4bc374]
xor edi, dword [ebx*8 + 0x4bc373]
shr edx, 8
xor edi, dword [esi + 0x1c]
mov dword [esp + 0x10], edx
movzx edx, dl
mov edx, dword [edx*8 + 0x4bc372]
xor dword [esp + 0x1c], edx
mov ebx, edi
mov edi, dword [esp + 0x10]
shr edi, 8
mov dword [esp + 0x10], edi
movzx edx, byte [esp + 0x14]
shr edi, 8
mov edi, dword [edi*8 + 0x4bc374]
xor edi, dword [edx*8 + 0x4bc373]
movzx ecx, cl
xor edi, dword [ecx*8 + 0x4bc371]
mov ecx, dword [esp + 0x14]
xor edi, dword [esi + 0x18]
shr ecx, 8
movzx edx, cl
xor ebx, dword [edx*8 + 0x4bc372]
shr ecx, 8
mov dword [esp + 0xc], edi
movzx edi, al
mov edx, ecx
shr edx, 8
mov edx, dword [edx*8 + 0x4bc374]
xor edx, dword [edi*8 + 0x4bc373]
movzx edi, byte [esp + 0x10]
xor edx, dword [edi*8 + 0x4bc371]
shr eax, 8
xor dword [esp + 0x18], edx
movzx edx, al
mov edx, dword [edx*8 + 0x4bc372]
xor dword [esp + 0xc], edx
shr eax, 8
movzx edx, al
xor ebx, dword [edx*8 + 0x4bc371]
shr eax, 8
mov edx, dword [eax*8 + 0x4bc374]
movzx ecx, cl
xor edx, dword [ecx*8 + 0x4bc371]
add esi, 0x20
xor dword [esp + 0x1c], edx
dec dword [esp + 0x24]
jne 0x407a42
mov eax, dword [esp + 0xc]
movzx ecx, al
movzx edx, byte [ecx*8 + 0x4bc371]
shr eax, 8
movzx ecx, al
shr eax, 8
mov byte [esp + 0x43], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, al
shr eax, 8
movzx eax, byte [eax*8 + 0x4bc371]
mov byte [esp + 0x3c], al
mov eax, dword [esp + 0x18]
mov byte [esp + 0x36], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, al
shr eax, 8
mov byte [esp + 0x39], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, al
shr eax, 8
mov byte [esp + 0x3f], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, al
shr eax, 8
movzx eax, byte [eax*8 + 0x4bc371]
mov byte [esp + 0x38], al
mov eax, dword [esp + 0x1c]
mov byte [esp + 0x42], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, al
shr eax, 8
mov byte [esp + 0x35], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, al
shr eax, 8
mov byte [esp + 0x3b], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, al
shr eax, 8
movzx eax, byte [eax*8 + 0x4bc371]
mov byte [esp + 0x3e], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, bl
shr ebx, 8
mov byte [esp + 0x34], al
movzx eax, bl
mov byte [esp + 0x41], dl
movzx edx, byte [ecx*8 + 0x4bc371]
movzx ecx, byte [eax*8 + 0x4bc371]
shr ebx, 8
mov byte [esp + 0x37], dl
movzx edx, bl
movzx eax, byte [edx*8 + 0x4bc371]
mov byte [esp + 0x3a], cl
shr ebx, 8
movzx ecx, byte [ebx*8 + 0x4bc371]
mov byte [esp + 0x40], cl
mov ecx, dword [esi]
xor ecx, dword [esp + 0x34]
mov byte [esp + 0x3d], al
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x407d66
mov edx, dword [eax]
jmp 0x407d68
xor edx, edx
xor edx, ecx
mov ecx, dword [esp + 0x30]
mov dword [ecx], edx
lea edx, [ecx + 4]
test eax, eax
je 0x407d7a
add eax, 4
mov edi, dword [esi + 4]
xor edi, dword [esp + 0x38]
test eax, eax
je 0x407d89
mov ecx, dword [eax]
jmp 0x407d8b
xor ecx, ecx
xor ecx, edi
mov dword [edx], ecx
test eax, eax
je 0x407d96
add eax, 4
mov edi, dword [esi + 8]
xor edi, dword [esp + 0x3c]
test eax, eax
je 0x407da5
mov ecx, dword [eax]
jmp 0x407da7
xor ecx, ecx
xor ecx, edi
mov dword [edx + 4], ecx
test eax, eax
je 0x407db3
add eax, 4
mov esi, dword [esi + 0xc]
xor esi, dword [esp + 0x40]
test eax, eax
je 0x407dc2
mov eax, dword [eax]
jmp 0x407dc4
xor eax, eax
mov ecx, dword [esp + 0x44]
xor eax, esi
pop edi
pop esi
pop ebx
xor ecx, esp
mov dword [edx + 8], eax
call fcn.0044545a
mov esp, ebp
pop ebp
ret 0xc