Function at 0x10013210
Capabilities:
Encode data using xor
Generate random numbers using the delphi lcg
Hash data with crc32
Resolve function by parsing pe exports

Disassembly:
sub esp, 0xc
mov edx, dword [esp + 0x1c]
xor eax, eax
push ebx
xor ebx, ebx
mov dword [esp + 4], eax
mov dword [esp + 8], ebx
push esi
test edx, edx
je 0x1001322b
mov byte [edx], al
mov esi, dword [esp + 0x18]
test esi, esi
je 0x100134de
mov esi, dword [esi + 0x7c]
test esi, esi
je 0x100134de
cmp dword [esi], eax
jne 0x10013251
pop esi
mov eax, 0xffffff9c
pop ebx
add esp, 0xc
ret
mov ecx, dword [esp + 0x20]
test ecx, ecx
jne 0x10013261
pop esi
xor eax, eax
pop ebx
add esp, 0xc
ret
mov eax, dword [esp + 0x1c]
mov dword [esi + 0x10], eax
mov eax, dword [esi + 0x5c]
mov dword [esi + 0x14], ecx
cmp ecx, eax
jbe 0x10013277
mov dword [esi + 0x14], eax
mov ecx, eax
push ebp
push edi
test ecx, ecx
je 0x100134d4
mov ebx, dword [esi + 8]
test ebx, ebx
jne 0x1001337b
mov eax, dword [esi + 0x58]
test eax, eax
je 0x1001337b
mov ecx, dword [esi + 0x60]
mov ebp, 0x4000
mov edx, dword [esi + 0x68]
cmp eax, ebp
cmovb ebp, eax
add edx, dword [esi + 0x3c]
cmp byte [ecx], bl
je 0x100132ca
cmp byte [ecx + 1], bl
je 0x100134b1
mov eax, dword [ecx + 0xc]
push ebx
push ebx
add eax, edx
push eax
push dword [ecx + 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x100132cd
mov dword [ecx + 0x1c], edx
push dword [esi + 0x60]
push 1
push ebp
push dword [esi]
call fcn.10011d60
add esp, 0x10
cmp eax, 1
jne 0x100134b1
add dword [esi + 0x3c], ebp
mov ebx, ebp
sub dword [esi + 0x58], ebp
cmp byte [esi + 0x6c], 0
mov eax, dword [esi]
mov dword [esi + 4], eax
mov dword [esi + 8], ebp
je 0x1001337b
xor ecx, ecx
mov dword [esp + 0x20], ecx
test ebp, ebp
je 0x1001337b
mov ebx, eax
nop dword [eax + eax]
mov edi, dword [esi + 0x78]
mov eax, edi
and eax, 0xfffd
or eax, 2
mov edx, eax
xor edx, 1
imul edx, eax
shr edx, 8
xor dl, byte [ecx + ebx]
mov ecx, dword [esi + 0x70]
movsx eax, dl
xor eax, ecx
shr ecx, 8
movzx eax, al
xor ecx, dword [eax*4 + 0x10051860]
movzx eax, cl
add eax, dword [esi + 0x74]
imul eax, eax, 0x8088405
mov dword [esi + 0x70], ecx
mov ecx, dword [esp + 0x20]
inc eax
mov dword [esi + 0x74], eax
shr eax, 0x18
xor eax, edi
shr edi, 8
movzx eax, al
xor edi, dword [eax*4 + 0x10051860]
mov dword [esi + 0x78], edi
mov byte [ecx + ebx], dl
inc ecx
mov dword [esp + 0x20], ecx
cmp ecx, ebp
jb 0x10013310
mov ebx, dword [esi + 8]
mov edx, dword [esi + 0x7c]
mov ecx, ebx
cmp edx, ebx
cmovbe ecx, edx
mov dword [esp + 0x18], ecx
test ecx, ecx
je 0x100133bf
mov eax, dword [esi + 4]
add eax, ecx
mov cl, byte [eax - 1]
mov byte [esp + 0x20], cl
mov ecx, dword [esp + 0x18]
sub ebx, ecx
sub dword [esi + 0x5c], ecx
sub edx, ecx
mov dword [esi + 8], ebx
mov dword [esi + 4], eax
mov dword [esi + 0x7c], edx
jne 0x100133bf
mov al, byte [esp + 0x20]
cmp al, byte [esi + 0x80]
jne 0x100134bc
cmp dword [esi + 0x64], 0
jne 0x1001344c
mov eax, dword [esi + 0x14]
cmp eax, ebx
mov ebp, eax
mov dword [esp + 0x20], eax
cmovae ebp, ebx
xor edx, edx
test ebp, ebp
je 0x100133fb
nop dword [eax]
mov eax, dword [esi + 4]
mov ecx, dword [esi + 0x10]
mov al, byte [edx + eax]
mov byte [edx + ecx], al
inc edx
cmp edx, ebp
jb 0x100133e0
mov eax, dword [esi + 0x14]
mov ebx, dword [esi + 8]
mov dword [esp + 0x20], eax
mov edi, dword [esi + 0x10]
push ebp
push edi
push dword [esi + 0x50]
call fcn.1000f270
sub dword [esi + 0x5c], ebp
sub ebx, ebp
add dword [esi + 4], ebp
add esp, 0xc
add dword [esi + 0x18], ebp
mov dword [esi + 0x50], eax
mov eax, dword [esp + 0x20]
sub eax, ebp
mov dword [esi + 8], ebx
mov ebx, dword [esp + 0x14]
add ebx, ebp
mov dword [esi + 0x14], eax
cmp dword [esi + 0x5c], 0
lea eax, [edi + ebp]
mov ebp, dword [esp + 0x10]
mov dword [esi + 0x10], eax
mov dword [esp + 0x14], ebx
jne 0x10013499
mov edx, dword [esp + 0x2c]
test edx, edx
je 0x10013499
mov byte [edx], 1
jmp 0x10013499
mov edi, dword [esi + 0x18]
lea eax, [esi + 4]
mov ebx, dword [esi + 0x10]
push 2
push eax
call fcn.1000ec20
mov ebp, dword [esi + 0x18]
sub ebp, edi
mov dword [esp + 0x18], eax
push ebp
push ebx
push dword [esi + 0x50]
call fcn.1000f270
mov ebx, dword [esp + 0x28]
add esp, 0x14
mov dword [esi + 0x50], eax
add ebx, ebp
mov eax, dword [esi + 0x5c]
sub eax, ebp
mov dword [esp + 0x14], ebx
mov ebp, dword [esp + 0x10]
mov dword [esi + 0x5c], eax
cmp ebp, 1
je 0x100134c9
test eax, eax
je 0x100134c9
test ebp, ebp
jne 0x100134a7
cmp dword [esi + 0x14], 0
ja 0x10013281
test ebp, ebp
je 0x100134d4
pop edi
mov eax, ebp
pop ebp
pop esi
pop ebx
add esp, 0xc
ret
pop edi
pop ebp
pop esi
or eax, 0xffffffff
pop ebx
add esp, 0xc
ret
pop edi
pop ebp
pop esi
mov eax, 0xffffff96
pop ebx
add esp, 0xc
ret
mov ecx, dword [esp + 0x2c]
test ecx, ecx
je 0x100134d4
mov byte [ecx], 1
pop edi
pop ebp
pop esi
mov eax, ebx
pop ebx
add esp, 0xc
ret
pop esi
mov eax, 0xffffff9a
pop ebx
add esp, 0xc
ret