Function at 0x1097d89
Capabilities:
Generate random numbers via winapi

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x70
mov eax, dword [0x10d0640]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
push ebx
push esi
mov esi, dword [ebp + 0x10]
mov dword [ebp - 0x6c], eax
xor eax, eax
cmp dword [ebp + 0xc], 2
push edi
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x4c], eax
mov dword [ebp - 0x60], eax
mov dword [ebp - 0x5c], eax
je 0x1097df6
cmp dword [ebp + 0xc], 1
je 0x1097df6
lea eax, [ebp - 0x58]
push eax
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.01097a65
mov edi, eax
test edi, edi
je 0x1097dea
push edi
push 0x7e301a4
jmp 0x1097f2a
mov ebx, dword [ebp - 0x58]
mov dword [ebp + 0xc], 1
jmp 0x1097df9
mov ebx, dword [ebp + 8]
lea eax, [ebp - 0x50]
push eax
push esi
push 1
push ebx
call dword [sym.imp.CRYPT32.dll_CryptImportPublicKeyInfo]
test eax, eax
jne 0x1097e1d
call fcn.01091f1e
mov edi, eax
push edi
push 0x7f201a4
jmp 0x1097f2a
lea eax, [ebp - 0x48]
push eax
push 1
push dword [ebp + 0x14]
push ebx
call dword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
jne 0x1097e43
call fcn.01091f1e
mov edi, eax
push edi
push 0x7fa01a4
jmp 0x1097f2a
lea eax, [ebp - 0x44]
push eax
push 0x40
pop esi
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
jne 0x1097e68
call fcn.01091f1e
mov edi, eax
push edi
push 0x80201a4
jmp 0x1097f2a
lea eax, [ebp - 0x70]
push eax
lea eax, [ebp - 0x60]
push eax
push esi
lea eax, [ebp - 0x44]
push eax
push dword [ebp - 0x48]
call fcn.01095513
mov edi, eax
test edi, edi
je 0x1097e8e
push edi
push 0x81201a4
jmp 0x1097f2a
lea eax, [ebp - 0x64]
push eax
lea eax, [ebp - 0x4c]
push eax
push 1
push dword [ebp - 0x50]
push dword [ebp - 0x48]
call fcn.0109328e
mov edi, eax
test edi, edi
je 0x1097eb1
push edi
push 0x81e01a4
jmp 0x1097f2a
push dword [ebp - 0x48]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
and dword [ebp - 0x48], 0
lea eax, [ebp - 0x54]
push eax
push dword [ebp + 0xc]
push ebx
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
jne 0x1097edf
call fcn.01091f1e
mov edi, eax
push edi
push 0x83101a4
jmp 0x1097f2a
lea eax, [ebp - 0x48]
push eax
push 1
push dword [ebp - 0x54]
push dword [ebp - 0x64]
push dword [ebp - 0x4c]
push ebx
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x1097f08
call fcn.01091f1e
mov edi, eax
push edi
push 0x83c01a4
jmp 0x1097f2a
lea eax, [ebp - 0x68]
push eax
lea eax, [ebp - 0x5c]
push eax
push dword [ebp - 0x70]
push dword [ebp - 0x60]
push dword [ebp - 0x48]
call fcn.01093326
mov edi, eax
test edi, edi
je 0x1097f31
push edi
push 0x84401a4
call fcn.0108c503
jmp 0x1097f67
mov edx, dword [ebp - 0x6c]
and dword [edx], 0
cmp dword [ebp - 0x68], esi
jne 0x1097f53
mov edi, dword [ebp - 0x5c]
mov ecx, esi
lea esi, [ebp - 0x44]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x1097f4f
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
je 0x1097f65
push 0
push 0x85401a4
mov dword [edx], 0x80090003
call fcn.0108c503
xor edi, edi
xor ebx, ebx
cmp dword [ebp - 0x50], ebx
je 0x1097f77
push dword [ebp - 0x50]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
cmp dword [ebp - 0x48], ebx
je 0x1097f85
push dword [ebp - 0x48]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
cmp dword [ebp - 0x54], ebx
je 0x1097f93
push dword [ebp - 0x54]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x60], ebx
je 0x1097fa3
push dword [ebp - 0x60]
call esi
cmp dword [ebp - 0x5c], ebx
je 0x1097fad
push dword [ebp - 0x5c]
call esi
cmp dword [ebp - 0x4c], ebx
je 0x1097fb7
push dword [ebp - 0x4c]
call esi
cmp dword [ebp - 0x58], ebx
je 0x1097fc6
push ebx
push dword [ebp - 0x58]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.01077d0b
leave
ret 0x14