Function at 0x10005922
Capabilities:
Encrypt or decrypt via wincrypt
Generate random numbers via winapi

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
mov ebx, dword [ebp + 0xc]
push esi
push edi
xor edi, edi
and dword [ebp - 4], edi
push ebx
mov dword [ebp - 8], edi
call fcn.100050da
mov esi, dword [ebp + 8]
push 0x10
mov eax, dword [esi + 0x10]
add eax, 0x20
push eax
lea eax, [ebx + 4]
push 0x10
push eax
call fcn.10005e67
mov eax, dword [esi + 0x58]
add esp, 0x14
test eax, eax
je 0x10005a93
xor edx, edx
cmp dword [eax + 0xc], edx
je 0x10005a93
cmp dword [eax + 0x3c], edx
je 0x10005a8c
lea ecx, [ebp - 4]
push ecx
push edx
push edx
push dword [eax + 4]
call dword [sym.imp.ADVAPI32.dll_CryptDuplicateKey]
test eax, eax
jne 0x10005995
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x10005a93
mov edi, dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
lea eax, [ebp + 0xc]
push 0
push eax
push 4
push dword [ebp - 4]
mov dword [ebp + 0xc], 1
call edi
test eax, eax
je 0x10005988
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [esi + 0x58]
push 0x10
push dword [eax]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x100059d3
call esi
mov dword [ebp - 8], eax
push 0
lea eax, [ebp - 0x1c]
push eax
push 1
push dword [ebp - 4]
call edi
test eax, eax
jne 0x100059e8
call esi
jmp 0x1000598e
push 1
call dword [sym.imp.WS2_32.dll_htonl]
mov edi, dword [ebx + 0x24]
and edi, 0xfffffff0
mov dword [ebx + 0x14], eax
add edi, 0x10
lea eax, [edi + 0x30]
push eax
call fcn.1001535e
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
mov dword [ebp + 8], eax
mov dword [ecx], eax
add eax, 0x20
mov ecx, dword [ebx + 0x24]
mov dword [edx], ecx
push dword [ebx + 0x24]
lea esi, [eax + 0x10]
mov dword [ebp - 0xc], eax
push dword [ebx + 0x20]
push dword [ebx + 0x24]
push esi
call fcn.10005e67
add esp, 0x14
push edi
push dword [ebp + 0x14]
push esi
push 0
push 1
push 0
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
jne 0x10005a52
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x10005a55
mov edi, dword [ebp - 8]
mov esi, dword [ebp + 0x14]
mov eax, dword [esi]
add eax, 0x18
push eax
call dword [sym.imp.WS2_32.dll_ntohl]
push 0x20
push ebx
push 0x20
push dword [ebp + 8]
mov dword [ebx + 0x18], eax
add dword [esi], 0x30
call fcn.10005e67
push 0x10
lea eax, [ebp - 0x1c]
push eax
push 0x10
push dword [ebp - 0xc]
call fcn.10005e67
add esp, 0x20
jmp 0x10005a96
mov dword [eax + 0x3c], 1
mov esi, dword [ebp + 0x14]
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
test ecx, ecx
jne 0x10005ae5
mov eax, dword [ebx + 0x24]
add eax, 0x20
push eax
mov dword [esi], eax
call fcn.1001535e
mov esi, eax
mov eax, dword [ebp + 0x10]
pop ecx
push 0
mov dword [eax], esi
call dword [sym.imp.WS2_32.dll_htonl]
push 0x20
push ebx
push 0x20
push esi
mov dword [ebx + 0x14], eax
call fcn.10005e67
push dword [ebx + 0x24]
lea eax, [esi + 0x20]
push dword [ebx + 0x20]
push dword [ebx + 0x24]
push eax
call fcn.10005e67
mov eax, dword [ebp + 0x10]
add esp, 0x20
mov ecx, dword [eax]
mov eax, dword [ebp + 0x14]
mov eax, dword [eax]
sub eax, 4
push eax
lea eax, [ecx + 4]
push eax
push ebx
call fcn.10005099
add esp, 0xc
cmp dword [ebp - 4], 0
je 0x10005b0a
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret