Function at 0x5d9c9b
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x10]
sub esp, 0x2c
mov edx, 0x8000
push ebx
push esi
xor ebx, ebx
cmp eax, edx
push edi
cmova eax, edx
mov edi, ecx
push eax
push dword [ebp + 0xc]
push dword [edi + 0xe694]
lea esi, [edi + 0xe688]
mov dword [esi + 4], ebx
mov dword [esi], ebx
call fcn.006f6760
add esp, 0xc
cmp dword [edi + 0xe664], ebx
jne 0x5d9ceb
push 0x40004
call fcn.006f44d4
pop ecx
mov dword [edi + 0xe664], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xc], eax
test al, al
jns 0x5d9d12
mov ecx, esi
call fcn.005dfad0
mov esi, eax
mov dword [ebp + 8], esi
test esi, esi
jne 0x5d9d0f
push ebx
mov ecx, edi
call fcn.005da739
jmp 0x5d9d1b
dec esi
jmp 0x5d9d18
mov esi, dword [edi + 0xe6d4]
mov dword [ebp + 8], esi
mov eax, dword [edi + 0xe69c]
mov dword [ebp - 0x18], eax
cmp esi, eax
ja 0x5d9e3a
cmp esi, dword [edi + 0xe6c4]
ja 0x5d9e3a
push 0x38
mov dword [edi + 0xe6d4], esi
call fcn.006f40bd
pop ecx
mov ecx, eax
mov dword [ebp + 0xc], ecx
mov dword [ecx + 0x34], ebx
mov dword [ecx + 0x10], ebx
cmp esi, dword [ebp - 0x18]
jne 0x5d9db1
cmp esi, 0x2000
ja 0x5d9e30
lea esi, [edi + 0xe698]
push ecx
mov ecx, esi
call fcn.005dc82d
push 0x38
call fcn.006f40bd
mov dword [ebp - 4], eax
mov dword [eax + 0x34], ebx
mov dword [eax + 0x10], ebx
mov ecx, dword [esi]
lea esi, [edi + 0xe6c0]
mov edx, dword [edi + 0xe69c]
mov dword [ecx + edx*4 - 4], eax
mov ecx, dword [edi + 0xe69c]
mov eax, dword [ebp + 0xc]
dec ecx
mov dword [eax + 0xc], ecx
mov ecx, esi
call fcn.005dc82d
mov ecx, dword [esi + 4]
mov eax, dword [esi]
mov dword [eax + ecx*4 - 4], ebx
jmp 0x5d9dc0
mov eax, dword [edi + 0xe698]
mov eax, dword [eax + esi*4]
mov dword [ebp - 4], eax
mov dword [ecx + 0xc], esi
lea eax, [edi + 0xe6ac]
mov edx, ebx
mov ecx, ebx
mov dword [ebp - 0x10], edx
mov dword [ebp - 8], ecx
cmp dword [edi + 0xe6b0], ebx
jbe 0x5d9e43
sub ecx, dword [ebp - 0x10]
mov esi, edx
mov edx, dword [eax]
mov eax, dword [ebp - 8]
mov eax, dword [edx + eax*4]
mov dword [edx + ecx*4], eax
lea edx, [esi + 1]
mov eax, dword [edi + 0xe6ac]
mov ecx, dword [ebp - 8]
cmp dword [eax + ecx*4], ebx
lea eax, [edi + 0xe6ac]
cmovne edx, esi
mov dword [ebp - 0x10], edx
test edx, edx
je 0x5d9e10
mov esi, dword [edi + 0xe6ac]
mov dword [esi + ecx*4], ebx
mov esi, dword [edi + 0xe6b0]
inc ecx
mov dword [ebp - 8], ecx
cmp ecx, esi
jb 0x5d9dd8
test edx, edx
jne 0x5d9e54
mov dword [ebp - 0x14], eax
cmp esi, 0x2000
jbe 0x5d9e46
mov ecx, dword [ebp + 0xc]
push 0x38
push ecx
call fcn.006f3e3b
pop ecx
pop ecx
xor al, al
pop edi
pop esi
pop ebx
leave
ret 0xc
mov dword [ebp - 0x14], eax
push ecx
mov ecx, eax
call fcn.005dc82d
mov eax, dword [ebp - 0x14]
xor edx, edx
inc edx
mov ecx, dword [edi + 0xe6b0]
lea esi, [edi + 0xe688]
mov eax, dword [eax]
sub ecx, edx
mov edx, dword [ebp + 0xc]
mov dword [eax + ecx*4], edx
mov ecx, esi
call fcn.005dfad0
test byte [ebp - 0xc], 0x40
mov ecx, eax
mov dword [ebp - 0x14], eax
je 0x5d9e85
add ecx, 0x102
mov dword [ebp - 0x14], ecx
mov eax, dword [edi + 0x7c]
mov edx, dword [ebp + 0xc]
add eax, ecx
and eax, dword [edi + 0xe6dc]
test byte [ebp - 0xc], 0x20
mov dword [edx], eax
je 0x5d9eb9
mov ecx, esi
call fcn.005dfad0
mov edx, dword [ebp + 0xc]
mov dword [edx + 4], eax
mov edx, dword [ebp + 8]
mov ecx, dword [edi + 0xe6c0]
mov dword [ecx + edx*4], eax
mov edx, dword [ebp + 0xc]
jmp 0x5d9ed4
mov ecx, dword [ebp + 8]
cmp ecx, dword [edi + 0xe6c4]
jae 0x5d9ecf
mov eax, dword [edi + 0xe6c0]
mov eax, dword [eax + ecx*4]
jmp 0x5d9ed1
mov eax, ebx
mov dword [edx + 4], eax
mov eax, dword [edi + 0x80]
cmp eax, dword [edi + 0x7c]
je 0x5d9eef
sub eax, dword [edi + 0x7c]
and eax, dword [edi + 0xe6dc]
cmp eax, dword [ebp - 0x14]
mov al, 1
jbe 0x5d9ef1
mov al, bl
test byte [ebp - 0xc], 0x10
mov byte [edx + 8], al
lea eax, [edx + 0x14]
mov dword [edx + 0x14], ebx
mov dword [edx + 0x18], ebx
mov dword [edx + 0x1c], ebx
mov dword [edx + 0x20], ebx
mov dword [edx + 0x28], ebx
mov dword [edx + 0x2c], ebx
mov dword [ebp - 0x14], eax
mov eax, dword [edx + 4]
mov dword [edx + 0x24], eax
je 0x5d9f5d
mov ecx, esi
call fcn.005d3d48
mov edx, dword [esi + 4]
mov edi, ebx
mov ebx, dword [ebp - 0x14]
add edx, 7
mov ecx, edx
shr eax, 9
shr ecx, 3
add dword [esi], ecx
and edx, 7
mov dword [ebp - 0x10], eax
mov dword [esi + 4], edx
xor eax, eax
mov ecx, edi
inc eax
shl eax, cl
test dword [ebp - 0x10], eax
je 0x5d9f52
mov ecx, esi
call fcn.005dfad0
mov dword [ebx], eax
inc edi
add ebx, 4
cmp edi, 7
jb 0x5d9f3d
xor ebx, ebx
mov eax, dword [ebp - 0x18]
cmp dword [ebp + 8], eax
jne 0x5da04c
mov ecx, esi
call fcn.005dfad0
mov edi, eax
cmp edi, 0x10000
jae 0x5d9e3a
test edi, edi
je 0x5d9e3a
mov ecx, dword [esi]
add ecx, edi
cmp ecx, dword [ebp + 0x10]
ja 0x5d9e3a
push edi
lea ecx, [ebp - 0x2c]
call fcn.005c9b06
mov dword [ebp + 0x10], ebx
test edi, edi
je 0x5d9fef
mov eax, dword [esi]
add eax, 3
cmp eax, 0x8000
jae 0x5d9fe2
mov ecx, esi
call fcn.005d3d48
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp - 0x2c]
shr eax, 8
mov byte [edx + ecx], al
mov ecx, dword [esi + 4]
add ecx, 8
mov eax, ecx
and ecx, 7
shr eax, 3
add dword [esi], eax
mov dword [esi + 4], ecx
mov ecx, dword [ebp + 0x10]
inc ecx
mov dword [ebp + 0x10], ecx
cmp ecx, edi
jb 0x5d9fa3
jmp 0x5d9ff2
lea ecx, [ebp - 0x2c]
call fcn.005c9b2b
jmp 0x5d9e3a
mov edx, dword [ebp - 0x2c]
xor eax, eax
mov cl, bl
inc eax
cmp edi, eax
jbe 0x5da003
xor cl, byte [edx + eax]
inc eax
cmp eax, edi
jb 0x5d9ffb
cmp cl, byte [edx]
jne 0x5da02e
push edi
or ecx, 0xffffffff
call fcn.005dd351
pop ecx
not eax
mov ecx, ebx
cmp dword [ecx + 0xef9bec], eax
jne 0x5da025
cmp dword [ecx + 0xef9be8], edi
je 0x5da03b
add ecx, 0xc
inc ebx
cmp ecx, 0x48
jb 0x5da015
mov esi, dword [ebp - 4]
lea ecx, [ebp - 0x2c]
call fcn.005c9b2b
jmp 0x5da04f
mov esi, dword [ebp - 4]
imul eax, ebx, 0xc
mov ecx, dword [eax + 0xef9bf0]
mov dword [esi + 0x10], ecx
jmp 0x5da031
mov esi, dword [ebp - 4]
mov eax, dword [ebp + 0xc]
mov ecx, dword [esi + 0x10]
mov dword [eax + 0x10], ecx
mov al, 1
jmp 0x5d9e3c