Function at 0x501359
Capabilities:
Generate random numbers using the delphi lcg
Hash data with crc32

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff8
sub esp, 0x98
mov ebx, edx
mov edi, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
mov esi, ecx
movzx eax, byte [ebx]
test eax, eax
je 0x501449
cmp eax, 1
jne 0x501460
lea edx, [ebx + 8]
lea ecx, [esp + 0x20]
mov dword [esp + 8], esi
push edi
mov esi, dword [ebp + 8]
push esi
call fcn.005011c3
mov edx, esi
add esp, 8
mov eax, edi
mov eax, dword [ebx + 0x1c]
mov ecx, dword [ebx + 0x20]
mov esi, dword [ebx + 0x18]
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], ebx
mov dword [esp + 4], eax
cmp dword [esp + 0x14], 0
je 0x5014af
mov eax, ecx
mov edi, ecx
mov ecx, esi
dec dword [esp + 0x14]
or eax, 3
mov ebx, eax
and ebx, 0xfffffffe
imul ebx, eax
mov eax, esi
mov esi, 0xff
xor bh, byte [edx]
shr eax, 8
xor cl, bh
movzx ecx, cl
xor eax, dword [ecx*4 + 0x5b9844]
mov ecx, eax
mov dword [esp + 0x10], eax
mov eax, edi
and ecx, esi
add ecx, dword [esp + 4]
mov dword [esp + 4], edx
mov edx, edi
mov edi, 0xff
and eax, edi
mov edi, dword [esp + 4]
shr edx, 8
imul ecx, ecx, 0x8088405
inc ecx
mov byte [edi], bh
mov ebx, dword [esp + 0xc]
mov esi, ecx
mov dword [esp + 4], ecx
shr esi, 0x18
xor eax, esi
mov esi, dword [esp + 0x10]
xor edx, dword [eax*4 + 0x5b9844]
lea eax, [edi + 1]
mov dword [ebx + 0x18], esi
mov dword [ebx + 0x1c], ecx
mov dword [ebx + 0x20], edx
mov ecx, edx
mov edx, eax
jmp 0x5013b7
add ebx, 8
mov eax, edx
mov ecx, esi
mov edx, ebx
push edi
push eax
call fcn.005011c3
pop eax
pop ecx
jmp 0x50168f
mov ecx, dword [ebx + 0x20]
mov eax, dword [ebx + 0x24]
mov edx, ecx
or edx, eax
je 0x5014c2
mov edx, dword [ebp + 8]
cmp ecx, edi
mov dword [esp + 8], esi
lea esi, [ebx + 8]
sbb eax, 0
cmovae ecx, edi
push 0x5b941c
push edi
call fcn.00426344
pop ecx
pop ecx
mov edi, eax
mov eax, edx
lea ecx, [esp + 0x20]
mov dword [esp + 0x14], esi
mov edx, esi
mov esi, ecx
push eax
push edi
call fcn.005011c3
pop eax
pop ecx
cmp byte [esi], 4
jne 0x5014ce
mov edi, dword [esp + 0x24]
jmp 0x5014de
movsd xmm0, qword [esp + 0x20]
mov eax, dword [esp + 8]
movsd qword [eax], xmm0
jmp 0x50168f
and dword [esi + 4], 0
mov byte [esi], 4
jmp 0x50168f
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
cmp al, 4
jne 0x5015d7
sub dword [ebx + 0x20], edi
lea esi, [ebx + 0x28]
mov edx, edi
sbb dword [ebx + 0x24], 0
xor ecx, ecx
push 0x5b942c
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00463c35
add esp, 0xc
mov dword [esp + 4], eax
mov al, byte [ebx + 0xc8]
mov dword [esp + 0x40], esi
mov dword [esp + 0x20], esi
mov ecx, ebx
movzx esi, al
push 0x40
pop ebx
mov dword [esp + 0x1c], esi
sub ebx, esi
mov esi, edx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], edi
sub esi, ebx
mov dword [esp + 0x18], esi
lea esi, [ecx + 0x88]
mov dword [esp + 0x44], esi
jae 0x501587
mov ebx, dword [esp + 0x1c]
mov edi, edx
mov edx, esi
mov ecx, ebx
push 0x5b8c9c
push 0x40
call fcn.0047d17f
pop ecx
pop ecx
mov esi, edx
mov ecx, edi
mov edx, eax
push 0x5b8cac
push esi
call fcn.00426344
pop ecx
pop ecx
mov ecx, eax
push 0x5b8cbc
push edi
push dword [esp + 0xc]
call fcn.00467063
mov eax, edi
add esp, 0xc
add eax, ebx
mov ebx, dword [esp + 0xc]
jmp 0x501649
mov ecx, dword [esp + 4]
test al, al
je 0x5015e5
mov edi, ecx
mov ecx, dword [esp + 0x1c]
mov edx, esi
add edi, ebx
push 0x5b8c5c
push 0x40
call fcn.0047d17f
pop ecx
pop ecx
mov ecx, eax
push 0x5b8c6c
push ebx
push dword [esp + 0xc]
call fcn.00467063
add esp, 0xc
lea ecx, [esp + 0x20]
mov edx, esi
push 1
call fcn.005019b3
pop eax
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0xc]
mov eax, edi
mov edx, ecx
jmp 0x5015ef
mov ecx, dword [esp + 8]
mov dword [ecx], eax
mov dword [ecx + 4], edi
jmp 0x50168f
mov ebx, dword [esp + 0xc]
mov eax, ecx
mov ecx, edx
mov edi, edx
mov edi, ecx
and edx, 0x3f
and edi, 0xffffffc0
mov dword [esp + 4], edx
add edi, eax
cmp ecx, 0x40
jb 0x50161f
shr ecx, 6
mov edx, eax
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x20]
push dword [esp + 0x18]
call fcn.005019b3
mov edx, dword [esp + 8]
add esp, 4
mov ecx, edx
mov edx, esi
push 0x5b8c7c
push 0x40
call fcn.00426344
pop ecx
pop ecx
mov ecx, eax
push 0x5b8c8c
push dword [esp + 8]
push edi
call fcn.00467063
mov eax, dword [esp + 0x10]
add esp, 0xc
mov byte [ebx + 0xc8], al
mov esi, dword [esp + 0x10]
mov edx, dword [ebp + 8]
mov eax, dword [ebx + 0x18]
mov edi, dword [ebx + 0x1c]
mov ecx, esi
mov dword [esp + 4], eax
push 0x5b943c
push dword [ebp + 0xc]
call fcn.00426344
pop ecx
pop ecx
push edx
push eax
push dword [esp + 0xc]
call dword [edi + 0xc]
add esp, 0xc
mov eax, dword [ebx + 0x20]
or eax, dword [ebx + 0x24]
je 0x501697
mov eax, dword [esp + 8]
mov dword [eax + 4], esi
mov byte [eax], 4
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
cmp byte [ebx + 0xd0], 0
jne 0x50184c
lea esi, [esp + 0x48]
mov byte [ebx + 0xd0], 1
and dword [esi + 4], 0
and dword [esi], 0
and word [esi + 8], 0
push 0xa
pop ebx
test ebx, ebx
je 0x50173a
mov edx, dword [esp + 0x14]
lea edi, [esp + 0x20]
mov ecx, edi
push ebx
push esi
call fcn.005011c3
pop eax
pop ecx
cmp byte [esp + 0x20], 4
jne 0x5016f9
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x50170d
mov edx, esi
push 0x5b8dc0
push ebx
call fcn.0047d17f
pop ecx
pop ecx
mov esi, eax
mov ebx, edx
jmp 0x5016be
mov ecx, edi
call fcn.00401780
test al, al
je 0x50172a
push edi
call fcn.0050107d
pop eax
jmp 0x5016be
xor edx, edx
push 2
pop eax
mov ecx, 0x5b8db4
mov esi, dword [esp + 8]
movzx eax, al
or eax, edx
mov dword [esi + 4], ecx
mov dword [esi], eax
jmp 0x50168f
mov eax, dword [esp + 0x20]
cmp al, 4
je 0x50173a
cmp al, 4
jne 0x50183b
lea ecx, [esp + 0x54]
call fcn.00501004
lea ebx, [esp + 0x80]
mov ecx, ebx
call fcn.00501004
mov esi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
mov edx, esi
push ebx
call 0x501876
pop eax
mov edi, dword [esp + 0xc]
lea ecx, [esp + 0x20]
movsd xmm2, qword [ebx]
mov edx, esi
movsd xmm1, qword [edi + 0x58]
mov eax, dword [edi + 0x60]
movsd xmm0, qword [edi + 0x50]
movsd qword [ecx + 0x10], xmm1
movsd xmm1, qword [edi + 0x48]
mov dword [ecx + 0x18], eax
movsd qword [ecx + 8], xmm0
mov eax, dword [ebx + 0x10]
movsd qword [esi], xmm2
movsd qword [ecx], xmm1
movsd xmm1, qword [ebx + 8]
mov dword [esi + 0x10], eax
movsd qword [esi + 8], xmm1
lea esi, [esp + 0x54]
mov byte [edi + 0xc8], 0x14
push esi
call 0x501876
pop eax
mov eax, dword [edi + 0x80]
movsd xmm1, qword [esi + 8]
lea edx, [esp + 0x48]
mov dword [edi + 0x40], eax
movsd xmm0, qword [edi + 0x78]
movsd qword [edi + 0x38], xmm0
movsd xmm0, qword [edi + 0x70]
movsd qword [edi + 0x30], xmm0
movsd xmm0, qword [esi]
mov eax, dword [edi + 0x68]
mov ecx, dword [edi + 0x6c]
mov dword [edi + 0x28], eax
mov eax, dword [esi + 0x10]
mov dword [edi + 0x2c], ecx
lea ecx, [esp + 0x68]
mov byte [edi + 0xc8], 0
movsd qword [ecx + 8], xmm1
movsd qword [ecx], xmm0
mov dword [ecx + 0x10], eax
call fcn.00428e2b
test al, al
je 0x501832
lea esi, [esp + 0x20]
push 0x15
pop edx
mov ecx, esi
push 0x5b
push str.Invalid_authentication_code__this_could_be_due_to_an_invalid_password_or_errors_in_the_dataTried_to_use_an_already_finalized_HMAC._This_is_a_bug_
call fcn.0043927c
pop eax
pop ecx
movsd xmm0, qword [esi]
jmp 0x5014b5
mov esi, dword [esp + 0x10]
jmp 0x501685
mov ecx, dword [esp + 0x24]
mov edx, eax
and edx, 0xffffff00
jmp 0x501717
lea ecx, [esp + 0x20]
mov edx, 0x5b94e8
mov dword [ecx], 0x5b94e0
mov dword [ecx + 4], 1
and dword [ecx + 0x10], 0
mov dword [ecx + 8], 0x5b8dd0
and dword [ecx + 0xc], 0
call fcn.00535f60
push ebp
push ebx
push edi
push esi
sub esp, 0x70
movzx ebx, byte [edx + 0x40]
mov eax, dword [ecx + 0x18]
movsd xmm0, qword [ecx + 8]
movsd xmm1, qword [ecx + 0x10]
mov edi, dword [ecx]
mov ebp, dword [ecx + 4]
mov esi, edx
mov dword [esp + 0x18], eax
lea eax, [ebx*8]
movsd qword [esp + 0x10], xmm1
movsd qword [esp + 8], xmm0
mov byte [edx + ebx], 0x80
lea ecx, [ebx + 1]
mov dword [esp], eax
push 0x5b8ccc
push 0x40
call fcn.0047d17f
pop ecx
pop ecx
test edx, edx
je 0x5018cf
mov byte [eax], 0
inc eax
dec edx
jmp 0x5018c4
shld ebp, edi, 9
shl edi, 9
not ebx
or edi, dword [esp]
bswap ebp
test bl, 0x38
bswap edi
jne 0x501908
lea ecx, [esp + 8]
mov edx, esi
call fcn.00407a12
lea ebx, [esp + 0x1c]
mov ecx, ebx
call fcn.00500fc4
lea ecx, [esp + 8]
mov edx, ebx
mov dword [ebx + 0x3c], edi
mov dword [ebx + 0x38], ebp
jmp 0x501914
mov dword [esi + 0x38], ebp
mov dword [esi + 0x3c], edi
lea ecx, [esp + 8]
mov edx, esi
call fcn.00407a12
mov eax, dword [esp + 0x84]
lea edx, [esp + 0x5c]
mov byte [esi + 0x40], 0
lea ebp, [esp + 0x1c]
lea esi, [esp + 8]
mov ecx, ebp
mov dword [edx + 8], eax
add eax, 0x14
mov dword [edx + 0xc], 0x14
mov dword [edx], eax
and dword [edx + 4], 0
lea eax, [esp + 0x1c]
mov dword [edx + 0x10], 4
push eax
push esi
call fcn.00501018
pop eax
pop ecx
mov ebx, dword [ebp + 0x1c]
mov edi, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x20]
mov esi, ebx
mov ebp, eax
mov dword [esp + 4], ecx
mov dword [esp], edx
imul esi, edi
add esi, eax
cmp ebx, dword [esp]
jae 0x5019ab
test ebp, ebp
je 0x5019ab
mov eax, dword [esp + 4]
mov ecx, esi
mov edx, edi
mov eax, dword [eax + ebx*4]
inc ebx
bswap eax
mov dword [esp + 0x1c], eax
push 0x5b92ec
push 4
lea eax, [esp + 0x24]
push eax
call fcn.00467063
add esp, 0xc
add esi, edi
jmp 0x501978
add esp, 0x70
pop esi
pop edi
pop ebx
pop ebp
ret