Function at 0x53d99e0
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebx + 8]
push edi
mov eax, esi
mov dword [esp + 0x10], 0
call fcn.0539c360
mov edi, dword [ebp + 0xc]
mov ecx, eax
mov al, byte [edi + 0x2c]
shr al, 4
not al
and al, 2
or al, 0x41
cmp byte [ebp + 0x2c], 0
mov dword [esp + 0x18], ecx
mov byte [esp + 0xf], al
jne 0x53d9a3c
movsx edx, word [ebp + 0x20]
push edx
mov edx, dword [ebp + 0x1c]
push edx
push ecx
mov ecx, dword [ebp + 0x14]
movzx edx, al
push ecx
push edx
mov eax, esi
call fcn.0539ec90
add esp, 0x14
mov eax, dword [ebx]
test dword [eax + 0x18], 0x80000
je 0x53d9a57
mov ecx, edi
call fcn.0537cd20
test eax, eax
jne 0x53d9a61
cmp dword [edi + 0x10], eax
jne 0x53d9a61
cmp dword [ebp + 0x10], 0
je 0x53d9bb3
movzx eax, byte [ebp + 0x28]
push eax
push edi
push 3
push 0
mov dword [esp + 0x30], eax
mov eax, dword [ebp + 0x10]
push 0
push ebx
call fcn.0537ca80
push edi
push ebx
mov dword [esp + 0x34], eax
call fcn.053905f0
or dword [esp + 0x34], eax
mov eax, dword [ebx + 0x4c]
movsx edx, word [edi + 0x26]
lea ecx, [eax + 1]
lea eax, [edx + eax + 1]
mov dword [ebx + 0x4c], eax
mov eax, dword [esi + 0x20]
mov dword [esp + 0x30], ecx
mov ecx, dword [esi + 0x18]
add esp, 0x20
mov dword [esp + 0x24], eax
cmp dword [ecx + 0x58], eax
jg 0x53d9ac2
mov ebx, esi
call fcn.0539b0d0
mov ebx, dword [ebp + 8]
test eax, eax
jne 0x53d9aec
mov eax, dword [esp + 0x24]
inc dword [esi + 0x20]
mov ecx, dword [ebp + 0x1c]
lea edx, [eax + eax*4]
mov eax, dword [esi + 4]
lea eax, [eax + edx*4]
mov edx, dword [esp + 0x10]
mov dword [eax + 4], ecx
xor ecx, ecx
mov byte [eax + 3], 0
mov dword [eax + 8], edx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], ecx
mov word [eax], 0x21
xor ecx, ecx
xor eax, eax
mov dword [esp + 0x1c], ecx
cmp ax, word [edi + 0x26]
jge 0x53d9b49
lea ebx, [ebx]
cmp dword [esp + 0x14], 0xffffffff
je 0x53d9b19
cmp ecx, 0x1f
jg 0x53d9b3c
mov edx, 1
shl edx, cl
test dword [esp + 0x14], edx
je 0x53d9b3c
mov eax, dword [esp + 0x10]
lea edx, [ecx + eax + 1]
mov eax, dword [ebp + 0x14]
push edx
push ecx
push eax
push edi
mov edi, esi
call fcn.053aa340
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov ecx, dword [esp + 0x2c]
add esp, 0x10
movsx edx, word [edi + 0x26]
inc ecx
mov dword [esp + 0x1c], ecx
cmp ecx, edx
jl 0x53d9b00
mov eax, dword [esi + 0x20]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x18]
push eax
push edi
push 1
push 0
push 0x6d
push ecx
push ebx
call fcn.053d9970
mov edx, dword [esp + 0x48]
add esp, 0x24
cmp edx, dword [esi + 0x20]
jge 0x53d9b9e
movsx eax, word [ebp + 0x20]
mov ecx, dword [ebp + 0x1c]
mov edx, dword [esp + 0x18]
push eax
mov eax, dword [ebp + 0x14]
push ecx
movzx ecx, byte [esp + 0x17]
push edx
push eax
push ecx
mov eax, esi
call fcn.0539ec90
add esp, 0x14
mov edx, dword [esp + 0x10]
push 0
push 0
push 0
push edx
push edi
push ebx
call fcn.053cc300
add esp, 0x18
cmp dword [edi + 0xc], 0
jne 0x53d9c97
mov eax, dword [ebp + 0x18]
mov ecx, dword [ebp + 0x14]
push 0
push eax
push ecx
push ebx
mov eax, edi
call fcn.053ac900
mov eax, dword [esi + 0x20]
mov edx, dword [esi + 0x18]
add esp, 0x10
mov dword [esp + 0x24], eax
cmp dword [edx + 0x58], eax
jg 0x53d9bf3
mov ebx, esi
call fcn.0539b0d0
mov ebx, dword [ebp + 8]
test eax, eax
jne 0x53d9c21
mov eax, dword [esp + 0x24]
mov ecx, dword [esi + 4]
inc dword [esi + 0x20]
mov edx, dword [ebp + 0x14]
lea eax, [eax + eax*4]
lea eax, [ecx + eax*4]
xor ecx, ecx
cmp byte [ebp + 0x24], cl
mov byte [eax + 3], 0
setne cl
mov dword [eax + 4], edx
mov word [eax], 0x4a
mov dword [eax + 8], ecx
xor ecx, ecx
mov dword [eax + 0xc], ecx
mov dword [eax + 0x10], ecx
cmp byte [ebp + 0x24], 0
je 0x53d9c97
mov ecx, dword [edi]
mov ebx, dword [esi + 4]
mov edi, dword [esi]
mov dword [esp + 0x24], ecx
test ebx, ebx
je 0x53d9c8a
cmp byte [edi + 0x40], 0
jne 0x53d9c8a
mov eax, dword [esi + 0x20]
lea edx, [eax + eax*4 - 5]
movsx eax, byte [ebx + edx*4 + 1]
mov ecx, dword [ebx + edx*4 + 0x10]
lea ebx, [ebx + edx*4]
mov dword [esp + 0x20], ebx
call fcn.05388110
mov ecx, dword [esp + 0x24]
xor eax, eax
mov dword [ebx + 0x10], eax
cmp ecx, eax
jne 0x53d9c6d
mov dword [ebx + 0x10], eax
mov byte [ebx + 1], al
jmp 0x53d9c91
call fcn.05373120
mov edx, dword [esi]
mov edi, eax
mov ebx, ecx
call fcn.053837c0
mov ecx, dword [esp + 0x20]
mov dword [ecx + 0x10], eax
mov byte [ecx + 1], 0xff
jmp 0x53d9c91
xor eax, eax
call fcn.05388110
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov eax, dword [ebx]
test dword [eax + 0x18], 0x80000
je 0x53d9d89
mov edx, dword [edi]
mov eax, edx
test edx, edx
jne 0x53d9cb6
xor ecx, ecx
mov dword [esp + 0x20], ecx
jmp 0x53d9cd3
cmp byte [edx], 0
je 0x53d9cc6
jmp 0x53d9cc0
inc eax
cmp byte [eax], 0
jne 0x53d9cc0
sub eax, edx
and eax, 0x3fffffff
mov ecx, eax
mov dword [esp + 0x20], eax
mov eax, dword [edi + 0x44]
add eax, 0x38
cmp dword [eax + 0xc], 0
mov dword [esp + 0x24], eax
je 0x53d9d2e
xor eax, eax
mov dword [esp + 0x14], ecx
mov dword [esp + 0x1c], edx
test ecx, ecx
jle 0x53d9d1c
movzx ecx, byte [edx]
movzx edx, byte [ecx + 0x53f9750]
lea ecx, [eax*8]
xor edx, ecx
mov ecx, dword [esp + 0x14]
xor eax, edx
mov edx, dword [esp + 0x1c]
dec ecx
inc edx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x14], ecx
test ecx, ecx
jg 0x53d9cf1
mov ecx, dword [esp + 0x24]
xor edx, edx
div dword [ecx]
mov ecx, dword [esp + 0x20]
mov eax, dword [esp + 0x24]
jmp 0x53d9d30
xor edx, edx
push ecx
mov ecx, dword [edi]
push ecx
call fcn.053786c0
add esp, 8
test eax, eax
je 0x53d9d89
mov eax, dword [eax + 8]
mov dword [esp + 0x14], eax
test eax, eax
je 0x53d9d89
jmp 0x53d9d54
mov eax, dword [esp + 0x14]
push 0
push eax
push edi
mov eax, ebx
call fcn.0539d4c0
add esp, 0xc
test eax, eax
je 0x53d9d7a
mov edx, dword [esp + 0x10]
push 0
push 2
push edx
push edi
push eax
push ebx
call fcn.053d9820
add esp, 0x18
mov eax, dword [esp + 0x14]
mov eax, dword [eax + 0xc]
mov dword [esp + 0x14], eax
test eax, eax
jne 0x53d9d50
mov ecx, dword [esp + 0x18]
movzx edx, byte [ebp + 0x28]
mov eax, dword [esp + 0x10]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
push eax
push edi
push 2
push 0
push 0x6d
push ecx
push ebx
call fcn.053d9970
mov ecx, dword [esi + 0x18]
or eax, 0xffffffff
add esp, 0x24
sub eax, dword [esp + 0x18]
js 0x53d9dc5
mov edx, dword [ecx + 0x74]
test edx, edx
je 0x53d9dc5
mov edi, dword [esi + 0x20]
mov dword [edx + eax*4], edi
mov edx, dword [esi + 0x20]
pop edi
dec edx
pop esi
mov dword [ecx + 0x5c], edx
pop ebx
mov esp, ebp
pop ebp
ret