Function at 0x40d400
Capabilities:
Generate random numbers using the delphi lcg

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [0x45e0d8]
push ebx
push esi
push edi
mov ecx, dword [eax]
xor edi, edi
mov edx, dword [ecx + 0xe]
mov ecx, dword [ebp + 8]
cmp ecx, edi
mov dword [ebp - 8], edx
je 0x40d803
mov esi, dword [0x46a748]
inc esi
mov dword [0x46a748], esi
mov eax, dword [eax + 4]
mov dword [ebp - 0xc], eax
mov ebx, 0x12345678
mov ecx, 0x23456789
mov edx, 0x34567890
mov esi, dword [ebp + 8]
lodsb al, byte [esi]
or al, al
je 0x40d481
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
jmp 0x40d448
mov esi, dword [ebp - 0xc]
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], edx
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov eax, edx
or eax, 2
mov word [ebp - 4], ax
xor ax, 1
imul ax, word [ebp - 4]
lodsb al, byte [esi]
xor al, ah
mov byte [ebp - 1], al
xor al, bl
and eax, 0xff
shr ebx, 8
xor ebx, dword [eax*4 + 0x46a138]
mov eax, ebx
and eax, 0xff
add eax, ecx
imul eax, eax, 0x8088405
inc eax
mov ecx, eax
shr eax, 0x18
xor al, dl
shr edx, 8
xor edx, dword [eax*4 + 0x46a138]
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0x18], edx
mov ecx, dword [ebp - 8]
mov al, byte [ebp - 1]
shr ecx, 0x18
cmp al, cl
je 0x40d817
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [0x466120]
mov edx, dword [0x46611c]
mov ebx, dword [0x466118]
jmp 0x40d825
mov ecx, dword [ebp - 0x10]
mov edx, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x18]
mov eax, dword [0x45e0d8]
mov esi, dword [eax]
push ebx
push edx
mov edx, dword [eax + 0x10]
mov esi, dword [esi + 0x12]
push ecx
sub esi, 0xc
push esi
push edx
call fcn.00409c30
mov eax, dword [0x45e0d8]
add esp, 0x14
or ebx, 0xffffffff
mov ecx, dword [eax]
mov edx, dword [ecx + 0x16]
mov ecx, dword [0x44b450]
cmp ecx, edi
mov dword [0x4660e0], edx
mov dword [0x4660e4], esi
mov dword [0x4660e8], edi
mov dword [0x4660ec], ebx
je 0x40d87e
mov dword [0x44b450], edi
mov dword [0x4660f4], edi
mov dword [0x4660f8], edi
lea ecx, [eax + 0xa0]
mov dword [0x4660fc], edi
mov dword [0x46a758], ecx
mov dword [0x46a75c], edi
mov dword [0x46a760], 0x64
mov ecx, dword [eax]
xor eax, eax
mov ax, word [ecx + 8]
cmp eax, 8
ja case.0x40d8b1.7
jmp dword [eax*4 + 0x40d950]
cmp esi, edi
je 0x40d910
cmp esi, 8
mov edi, esi
jb 0x40d8c8
mov edi, 8
sub esi, edi
call fcn.00409c70
push edi
push 0x466130
push ebx
call fcn.0040a650
add esp, 0xc
mov ebx, eax
test esi, esi
jne 0x40d8bc
xor edi, edi
jmp 0x40d910
push ecx
call fcn.00409d50
add esp, 4
jmp 0x40d90e
push ecx
call fcn.0040a0c0
add esp, 4
jmp 0x40d90e
push ecx
call fcn.0040abe0
add esp, 4
jmp 0x40d90e
call fcn.0040c890
mov ebx, eax
mov eax, dword [0x4660fc]
cmp eax, edi
je 0x40d92a
mov esi, dword [eax]
push eax
call fcn.004293a8
add esp, 4
cmp esi, edi
mov eax, esi
jne 0x40d919
mov ecx, dword [ebp - 8]
xor eax, eax
not ebx
cmp ebx, ecx
pop edi
pop esi
pop ebx
sete al
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov dword [0x45e0dc], 1
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret