Function at 0x518274
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffa8
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x58], ecx
mov dword [ebp - 0x54], ecx
mov dword [ebp - 0x50], ecx
mov dword [ebp - 0x4c], ecx
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x3c], ecx
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x34], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x5184f4
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
call fcn.00405684
call fcn.004d9cdc
cmp byte [eax + 0x343], 0
je 0x5182eb
mov eax, dword [0x6909dc]
cmp byte [eax], 0
je 0x5182eb
lea ecx, [ebp - 0x34]
xor edx, edx
mov eax, 0x518508
call fcn.004d99c0
mov edx, dword [ebp - 0x34]
mov eax, dword [ebp - 8]
call fcn.00405938
mov eax, dword [ebp - 8]
cmp dword [eax], 0
jne 0x5184c9
lea eax, [ebp - 0x38]
call fcn.0051858c
mov eax, dword [ebp - 0x38]
mov edx, dword [ebp - 8]
call fcn.0040bc58
movzx eax, byte [0x6dbe34]
or al, byte [0x6dbe35]
je 0x51833a
lea eax, [ebp - 0x40]
call fcn.004a4c1c
mov eax, dword [ebp - 0x40]
lea edx, [ebp - 0x3c]
call fcn.0040bc58
mov edx, dword [ebp - 0x3c]
mov eax, dword [ebp - 8]
call fcn.0040597c
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp dword [eax], 0
jne 0x518355
lea eax, [ebp - 0x44]
call fcn.004a4c1c
mov eax, dword [ebp - 0x44]
mov edx, dword [ebp - 8]
call fcn.0040bc58
mov eax, dword [ebp - 8]
cmp dword [eax], 0
jne 0x518370
lea eax, [ebp - 0x48]
call fcn.00518164
mov eax, dword [ebp - 0x48]
mov edx, dword [ebp - 8]
call fcn.0040bc58
mov eax, dword [ebp - 8]
mov edx, 0x518528
call fcn.0040597c
mov eax, dword [ebp - 8]
jmp 0x518392
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 8]
mov edx, dword [edx]
call fcn.0040597c
mov eax, dword [ebp - 8]
mov eax, dword [ebp - 8]
mov eax, dword [eax]
call fcn.00405970
cmp eax, 0x24
jl 0x518382
mov ecx, 0x518534
mov dl, 1
mov eax, dword [0x4a2944]
call fcn.004a2e64
mov ebx, eax
push 0x24
mov eax, dword [ebp - 8]
call fcn.00405bcc
mov edx, eax
lea ecx, [ebp - 0x30]
mov eax, ebx
mov esi, dword [eax]
call dword [esi + 0x48]
mov eax, ebx
call fcn.00404748
mov dword [ebp - 0xc], 3
lea eax, [ebp - 0x30]
mov edx, dword [eax]
xor edx, dword [eax + 0xc]
xor edx, dword [eax + 0x18]
mov dword [eax], edx
add eax, 4
dec dword [ebp - 0xc]
jne 0x5183db
mov eax, dword [ebp - 8]
call fcn.00405684
mov edi, 0x39
mov dword [ebp - 0xc], 2
lea ebx, [ebp - 0x30]
mov esi, 5
mov eax, dword [ebx]
xor edx, edx
div edi
inc edx
mov eax, 0x518544
movzx edx, byte [eax + edx - 1]
lea eax, [ebp - 0x4c]
call fcn.0040586c
mov edx, dword [ebp - 0x4c]
mov eax, dword [ebp - 8]
call fcn.0040597c
mov eax, dword [ebp - 8]
mov eax, dword [ebx]
xor edx, edx
div edi
mov dword [ebx], eax
dec esi
jne 0x518409
add ebx, 4
dec dword [ebp - 0xc]
jne 0x518404
mov eax, dword [ebp - 0x28]
xor edx, edx
div edi
inc edx
mov eax, 0x518544
movzx edx, byte [eax + edx - 1]
lea eax, [ebp - 0x50]
call fcn.0040586c
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 8]
call fcn.0040597c
mov eax, dword [ebp - 8]
push 0x518588
mov eax, dword [ebp - 8]
push dword [eax]
lea ecx, [ebp - 0x54]
mov edx, 8
mov eax, dword [ebp - 4]
call fcn.0040c3cc
push dword [ebp - 0x54]
mov eax, dword [ebp - 8]
mov edx, 3
call fcn.00405a34
call fcn.004d9cdc
cmp byte [eax + 0x343], 0
je 0x5184c9
mov eax, dword [0x6909dc]
cmp byte [eax], 0
je 0x5184c9
lea eax, [ebp - 0x58]
mov edx, dword [ebp - 8]
mov edx, dword [edx]
call fcn.004060a4
mov edx, dword [ebp - 0x58]
mov cl, 1
mov eax, 0x518508
call fcn.004d993c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x5184fb
lea eax, [ebp - 0x58]
call fcn.00405ebc
lea eax, [ebp - 0x54]
mov edx, 8
call fcn.004056a8
lea eax, [ebp - 0x34]
call fcn.00405ebc
ret