Function at 0x54f2f5
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
push ebx
mov ebx, dword [ebp + 0xc]
mov eax, ecx
mov dword [ebp - 0x1c], eax
test ebx, ebx
je 0x54f456
cmp dword [ebp + 8], 4
jb 0x54f456
push esi
lea esi, [eax + 0x2c]
push edi
push esi
mov dword [ebp - 0x20], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [ebp + 8]
cmp eax, 6
jb case.0x54f2ee.10
cmp byte [ebx], 0x54
jne case.0x54f2ee.10
cmp byte [ebx + 1], 0x44
jne case.0x54f2ee.10
sub eax, 4
cmp eax, 2
jb case.0x54f2ee.10
movzx edi, word [ebx + 4]
sub eax, 2
mov ecx, dword [ebp - 0x1c]
add ebx, 6
mov dword [ebp + 8], eax
call fcn.0054cad6
xor edx, edx
mov eax, edi
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x2c], edx
mov dword [ebp - 0x34], eax
test eax, eax
je 0x54f43a
mov edi, dword [ebp + 8]
cmp edi, 7
jb case.0x54f2ee.10
mov al, byte [ebx]
mov dword [ebp + 8], edi
dec edi
mov byte [ebp - 0xc], al
cmp edi, 2
jb case.0x54f2ee.10
movzx ecx, word [ebx + 1]
sub edi, 2
movzx eax, cx
add ebx, 3
mov dword [ebp - 8], eax
add eax, 4
mov dword [ebp - 0x28], ecx
cmp edi, eax
jb case.0x54f2ee.10
mov eax, dword [ebp - 8]
mov esi, dword [ebp - 8]
add eax, ebx
mov dword [ebp - 0x10], eax
add esi, 7
mov eax, dword [eax]
add eax, esi
mov esi, dword [ebp - 0x20]
cmp eax, dword [ebp + 8]
ja case.0x54f2ee.10
shr ecx, 8
xor cl, byte [ebp - 0x28]
cmp dword [ebp - 8], 0
jbe 0x54f250
mov esi, dword [ebp - 8]
mov al, byte [edx + ebx]
not al
xor al, cl
mov byte [edx + ebx], al
inc edx
cmp edx, esi
jb 0x54f23e
mov esi, dword [ebp - 0x20]
mov dword [ebp - 0x28], ebx
mov ebx, dword [ebp - 0x10]
push 0xfffffffffffffffc
pop eax
sub eax, dword [ebp - 8]
mov ecx, dword [ebx]
add edi, eax
mov eax, ecx
mov dword [ebp - 4], ecx
add ebx, 4
cmp edi, eax
jb case.0x54f2ee.10
xor ecx, ecx
mov edx, ebx
cmp byte [ebp - 0xc], 9
mov dword [ebp - 0x10], edx
mov dword [ebp + 0xc], ecx
je 0x54f28c
cmp byte [ebp - 0xc], 8
je 0x54f28c
cmp byte [ebp - 0xc], 0x10
jne 0x54f2d9
mov ecx, eax
xor edx, edx
shr ecx, 8
xor cl, al
test eax, eax
je 0x54f2ab
mov al, byte [edx + ebx]
not al
xor al, cl
mov byte [edx + ebx], al
inc edx
mov eax, dword [ebp - 4]
cmp edx, eax
jb 0x54f299
push eax
push ebx
lea ecx, [ebp - 0x24]
call sym.txupd.exe_public:_void___thiscall_CTXStringA::constructor_char_const___int_
lea eax, [ebp - 0x24]
push eax
lea ecx, [ebp + 0xc]
call sym.txupd.exe_public:_void___thiscall_CTXStringA::constructor_void_
mov ecx, eax
call fcn.00532e4e
lea ecx, [ebp - 0x24]
call sym.txupd.exe_public:_void___thiscall_CTXStringA::destructor_void_
mov ecx, dword [ebp + 0xc]
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
sub edi, eax
add ebx, eax
movzx eax, byte [ebp - 0xc]
dec eax
mov dword [ebp + 8], edi
cmp eax, 0x10
ja case.0x54f2ee.10
jmp dword [eax*4 + 0x54f464]
cmp dword [ebp - 4], 1
jne case.0x54f2ee.6
xor ecx, ecx
cmp byte [edx], cl
setne cl
jmp 0x54f3e1
mov ecx, dword [edx]
jmp 0x54f3e1
movzx ecx, byte [edx]
jmp 0x54f3e1
movsx ecx, byte [edx]
jmp 0x54f3e1
movzx ecx, word [edx]
jmp 0x54f3e1
movsx ecx, word [edx]
jmp 0x54f3e1
push 0x10
push edx
push 0x10
call sym.txupd.exe_void____cdecl_Util::Misc::AllocBuffer_unsigned_int_
pop ecx
push eax
call fcn.00689000
add esp, 0xc
mov ecx, eax
jmp 0x54f3e1
push 8
push edx
push 8
jmp 0x54f333
lea ecx, [ebp - 0x14]
xor eax, eax
push ecx
push 0x70fb50
push eax
mov dword [ebp - 0x14], eax
call fcn.00526127
mov edx, dword [ebp - 0x14]
test edx, edx
je 0x54f42e
cmp dword [ebp + 0x10], 0
push dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
mov eax, dword [edx]
push ecx
push edx
je 0x54f387
call dword [eax + 0x190]
jmp 0x54f38d
call dword [eax + 0x18c]
mov edi, eax
test edi, edi
js 0x54f423
mov ecx, dword [ebp - 0x14]
jmp 0x54f3de
lea ecx, [ebp - 0x18]
xor eax, eax
push ecx
push 0x70fc44
push eax
mov dword [ebp - 0x18], eax
call fcn.0052603f
mov edx, dword [ebp - 0x18]
test edx, edx
je 0x54f42e
cmp dword [ebp + 0x10], 0
push dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
mov eax, dword [edx]
push ecx
push edx
je 0x54f3cf
call dword [eax + 0x15c]
jmp 0x54f3d5
call dword [eax + 0x158]
mov edi, eax
test edi, edi
js 0x54f435
mov ecx, dword [ebp - 0x18]
mov edi, dword [ebp + 8]
mov dword [ebp + 0xc], ecx
cmp dword [ebp + 0x10], 0
push ecx
push dword [ebp - 0xc]
mov ecx, dword [ebp - 0x1c]
je 0x54f3fe
push dword [ebp - 8]
push dword [ebp - 0x28]
call fcn.0054c8e6
jmp 0x54f40c
mov eax, dword [ebp - 8]
shr eax, 1
push eax
push dword [ebp - 0x28]
call fcn.0054ca4b
test eax, eax
js 0x54f42e
mov eax, dword [ebp - 0x2c]
inc eax
mov dword [ebp - 0x2c], eax
cmp eax, dword [ebp - 0x34]
jge 0x54f43a
xor edx, edx
jmp 0x54f1d8
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
jmp 0x54f445
mov edi, 0x80004005
jmp 0x54f445
mov eax, dword [ebp - 0x18]
jmp 0x54f426
cmp dword [ebp + 8], 0
je 0x54f448
mov edi, 0xe0630004
mov dword [ebp - 0x30], edi
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0x30]
pop edi
pop esi
jmp 0x54f45b
mov eax, 0x80004005
pop ebx
mov esp, ebp
pop ebp
ret 0xc