Function at 0x501e39
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 0x501f29
cmp eax, 1
jne 0x501f40
lea edx, [ebx + 8]
lea ecx, [esp + 0x20]
mov dword [esp + 8], esi
push edi
mov esi, dword [ebp + 8]
push esi
call fcn.00501ca3
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 0x501f8f
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 + 0x5ba8c4]
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 + 0x5ba8c4]
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 0x501e97
add ebx, 8
mov eax, edx
mov ecx, esi
mov edx, ebx
push edi
push eax
call fcn.00501ca3
pop eax
pop ecx
jmp 0x50216f
mov ecx, dword [ebx + 0x20]
mov eax, dword [ebx + 0x24]
mov edx, ecx
or edx, eax
je 0x501fa2
mov edx, dword [ebp + 8]
cmp ecx, edi
mov dword [esp + 8], esi
lea esi, [ebx + 8]
sbb eax, 0
cmovae ecx, edi
push 0x5ba49c
push edi
call fcn.00426e24
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.00501ca3
pop eax
pop ecx
cmp byte [esi], 4
jne 0x501fae
mov edi, dword [esp + 0x24]
jmp 0x501fbe
movsd xmm0, qword [esp + 0x20]
mov eax, dword [esp + 8]
movsd qword [eax], xmm0
jmp 0x50216f
and dword [esi + 4], 0
mov byte [esi], 4
jmp 0x50216f
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x24]
cmp al, 4
jne 0x5020b7
sub dword [ebx + 0x20], edi
lea esi, [ebx + 0x28]
mov edx, edi
sbb dword [ebx + 0x24], 0
xor ecx, ecx
push 0x5ba4ac
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00464705
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 0x502067
mov ebx, dword [esp + 0x1c]
mov edi, edx
mov edx, esi
mov ecx, ebx
push 0x5b9d1c
push 0x40
call fcn.0047dc4f
pop ecx
pop ecx
mov esi, edx
mov ecx, edi
mov edx, eax
push 0x5b9d2c
push esi
call fcn.00426e24
pop ecx
pop ecx
mov ecx, eax
push 0x5b9d3c
push edi
push dword [esp + 0xc]
call fcn.00467b33
mov eax, edi
add esp, 0xc
add eax, ebx
mov ebx, dword [esp + 0xc]
jmp 0x502129
mov ecx, dword [esp + 4]
test al, al
je 0x5020c5
mov edi, ecx
mov ecx, dword [esp + 0x1c]
mov edx, esi
add edi, ebx
push 0x5b9cdc
push 0x40
call fcn.0047dc4f
pop ecx
pop ecx
mov ecx, eax
push 0x5b9cec
push ebx
push dword [esp + 0xc]
call fcn.00467b33
add esp, 0xc
lea ecx, [esp + 0x20]
mov edx, esi
push 1
call fcn.00502493
pop eax
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0xc]
mov eax, edi
mov edx, ecx
jmp 0x5020cf
mov ecx, dword [esp + 8]
mov dword [ecx], eax
mov dword [ecx + 4], edi
jmp 0x50216f
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 0x5020ff
shr ecx, 6
mov edx, eax
mov dword [esp + 0x18], ecx
lea ecx, [esp + 0x20]
push dword [esp + 0x18]
call fcn.00502493
mov edx, dword [esp + 8]
add esp, 4
mov ecx, edx
mov edx, esi
push 0x5b9cfc
push 0x40
call fcn.00426e24
pop ecx
pop ecx
mov ecx, eax
push 0x5b9d0c
push dword [esp + 8]
push edi
call fcn.00467b33
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 0x5ba4bc
push dword [ebp + 0xc]
call fcn.00426e24
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 0x502177
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 0x50232c
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 0x50221a
mov edx, dword [esp + 0x14]
lea edi, [esp + 0x20]
mov ecx, edi
push ebx
push esi
call fcn.00501ca3
pop eax
pop ecx
cmp byte [esp + 0x20], 4
jne 0x5021d9
mov ecx, dword [esp + 0x24]
test ecx, ecx
je 0x5021ed
mov edx, esi
push 0x5b9e40
push ebx
call fcn.0047dc4f
pop ecx
pop ecx
mov esi, eax
mov ebx, edx
jmp 0x50219e
mov ecx, edi
call fcn.00401780
test al, al
je 0x50220a
push edi
call fcn.00501b5d
pop eax
jmp 0x50219e
xor edx, edx
push 2
pop eax
mov ecx, 0x5b9e34
mov esi, dword [esp + 8]
movzx eax, al
or eax, edx
mov dword [esi + 4], ecx
mov dword [esi], eax
jmp 0x50216f
mov eax, dword [esp + 0x20]
cmp al, 4
je 0x50221a
cmp al, 4
jne 0x50231b
lea ecx, [esp + 0x54]
call fcn.00501ae4
lea ebx, [esp + 0x80]
mov ecx, ebx
call fcn.00501ae4
mov esi, dword [esp + 0x44]
mov ecx, dword [esp + 0x40]
mov edx, esi
push ebx
call 0x502356
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 0x502356
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.0042990c
test al, al
je 0x502312
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.00439d50
pop eax
pop ecx
movsd xmm0, qword [esi]
jmp 0x501f95
mov esi, dword [esp + 0x10]
jmp 0x502165
mov ecx, dword [esp + 0x24]
mov edx, eax
and edx, 0xffffff00
jmp 0x5021f7
lea ecx, [esp + 0x20]
mov edx, 0x5ba568
mov dword [ecx], 0x5ba560
mov dword [ecx + 4], 1
and dword [ecx + 0x10], 0
mov dword [ecx + 8], 0x5b9e50
and dword [ecx + 0xc], 0
call fcn.00536a40
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 0x5b9d4c
push 0x40
call fcn.0047dc4f
pop ecx
pop ecx
test edx, edx
je 0x5023af
mov byte [eax], 0
inc eax
dec edx
jmp 0x5023a4
shld ebp, edi, 9
shl edi, 9
not ebx
or edi, dword [esp]
bswap ebp
test bl, 0x38
bswap edi
jne 0x5023e8
lea ecx, [esp + 8]
mov edx, esi
call fcn.00407bc2
lea ebx, [esp + 0x1c]
mov ecx, ebx
call fcn.00501aa4
lea ecx, [esp + 8]
mov edx, ebx
mov dword [ebx + 0x3c], edi
mov dword [ebx + 0x38], ebp
jmp 0x5023f4
mov dword [esi + 0x38], ebp
mov dword [esi + 0x3c], edi
lea ecx, [esp + 8]
mov edx, esi
call fcn.00407bc2
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.00501af8
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 0x50248b
test ebp, ebp
je 0x50248b
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 0x5ba36c
push 4
lea eax, [esp + 0x24]
push eax
call fcn.00467b33
add esp, 0xc
add esi, edi
jmp 0x502458
add esp, 0x70
pop esi
pop edi
pop ebx
pop ebp
ret