Function at 0x59db10
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov edi, eax
push 0xd440
push 0x40
mov dword [ebp - 0x18], edi
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
mov ebx, 1
lea edx, [eax - 0x3fa]
mov dword [ebp + 0xc], edx
jmp 0x59db4c
mov edx, dword [ebp + 0xc]
mov eax, dword [edx - 4]
sub eax, ebx
inc ebx
lea ecx, [eax + eax*4]
mov eax, dword [edx + ecx*8 + 8]
mov esi, dword [edx + ecx*8 + 0xc]
lea edx, [edx + ecx*8]
add eax, esi
lea ecx, [esi + edi]
add eax, edi
cmp ecx, 0x5af398
ja 0x59db49
cmp eax, 0x5af398
jbe 0x59db49
cmp ecx, eax
mov esi, ecx
jae 0x59db95
imul esi, esi, 0x19660d
mov ebx, dword [ecx]
add esi, 0x3c6ef375
xor ebx, esi
mov dword [ecx], ebx
add ecx, 4
cmp ecx, eax
jb 0x59db7c
mov ebx, dword [edx + 0xc]
mov edx, dword [ebx + edi]
add ebx, edi
mov dword [ebp - 8], edx
mov esi, dword [ebx + 4]
mov eax, dword [ebx + 8]
push esi
push 0x40
mov dword [ebp - 0xc], esi
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
test edi, edi
mov dword [ebp - 0x10], edi
je 0x59dbc6
cmp esi, 0x10000
jbe 0x59dbd7
push 0
push 0
push 0
push 0xef0000fe
call dword [sym.imp.KERNEL32.dll_RaiseException]
mov ecx, esi
lea esi, [ebx + 0xc]
mov edx, ecx
mov eax, dword [ebp - 0xc]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
push esi
push ebx
push eax
push edi
call fcn.0059d9b0
cmp eax, esi
je 0x59dc14
push 0
push 0
push 0
push 0xef0000f8
call dword [sym.imp.KERNEL32.dll_RaiseException]
push esi
push ebx
push 0
call fcn.0059d895
mov ecx, dword [ebp - 0x14]
add esp, 0xc
cmp eax, ecx
je 0x59dc38
push 0
push 0
push 0
push 0xef0000fa
call dword [sym.imp.KERNEL32.dll_RaiseException]
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push 0x5af388
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, eax
test esi, esi
jne 0x59dc5e
push eax
push eax
push eax
push 0xef0000fd
call dword [sym.imp.KERNEL32.dll_RaiseException]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push 0x5af370
push esi
call ebx
push 0x5af35c
push esi
mov dword [0x5b0710], eax
call ebx
mov esi, eax
mov eax, dword [0x5b0710]
test eax, eax
jne 0x59dc95
push 0
push 0
push 0
push 0xef0000fc
call dword [sym.imp.KERNEL32.dll_RaiseException]
call esi
mov ebx, dword [ebp + 8]
mov dword [0x5b072c], eax
mov edx, 3
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp - 0x18]
mov eax, dword [ecx - 4]
sub eax, edx
inc edx
lea eax, [eax + eax*4]
lea eax, [ecx + eax*8]
mov ecx, dword [eax + 0xc]
mov eax, dword [eax + 8]
add eax, ecx
add ecx, esi
add eax, esi
cmp ecx, ebx
jae 0x59dca4
cmp ebx, eax
jae 0x59dca4
lea ecx, [ebx + 0xc]
mov edx, ebx
and ecx, 0xfffffffc
cmp ecx, eax
jae 0x59dcef
imul edx, edx, 0x19660d
mov esi, dword [ecx]
add edx, 0x3c6ef375
xor esi, edx
mov dword [ecx], esi
add ecx, 4
cmp ecx, eax
jb 0x59dcd6
mov esi, dword [ebx + 4]
mov ecx, dword [ebx]
mov edx, dword [ebx + 8]
push esi
push 0x40
mov dword [ebp + 8], ecx
mov dword [ebp - 0x18], esi
mov dword [ebp - 0x10], edx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
test edi, edi
mov dword [ebp - 0x14], edi
je 0x59dd1a
cmp esi, 0x10000
jbe 0x59dd2b
push 0
push 0
push 0
push 0xef0000ff
call dword [sym.imp.KERNEL32.dll_RaiseException]
mov ecx, esi
lea esi, [ebx + 0xc]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [ebp + 8]
mov ecx, dword [ebp - 0x18]
mov edi, dword [ebp - 0x14]
push esi
push ebx
push ecx
mov ecx, dword [ebp - 4]
push edi
call fcn.0059d9b0
cmp eax, esi
je 0x59dd68
push 0
push 0
push 0
push 0xef0000f9
call dword [sym.imp.KERNEL32.dll_RaiseException]
push esi
push ebx
push 0
call fcn.0059d895
mov ecx, dword [ebp - 0x10]
add esp, 0xc
cmp eax, ecx
je 0x59dd8c
push 0
push 0
push 0
push 0xef0000fb
call dword [sym.imp.KERNEL32.dll_RaiseException]
mov edx, dword [0x5b072c]
push esi
push ebx
push edx
call dword [0x5b0710]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call esi
mov eax, dword [ebp - 4]
push eax
call esi
mov esi, dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x5b0ed8
call esi
push 0x5b09e0
call esi
call fcn.0059e6f0
push 0x80
call fcn.005a5ba5
add esp, 4
test eax, eax
pop edi
pop esi
pop ebx
je 0x59dde0
mov ecx, eax
call int.0059e4f0
jmp 0x59dde2
xor eax, eax
mov ecx, 0x59de40
mov dword [ecx + 4], eax
call fcn.005a63e7
mov dword [0x5b59bc], eax
mov eax, dword [ebp + 0xc]
mov edx, dword [eax - 4]
mov dword [0x5b073c], eax
mov dword [0x5b0738], edx
mov esp, ebp
pop ebp
ret 8