Function at 0x10005680
Capabilities:
Encrypt data using des via winapi
Generate random numbers via winapi

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
push ebx
push esi
push edi
xor eax, eax
lea edi, [ebp - 0x3c]
stosd dword es:[edi], eax
xor ebx, ebx
mov dword [ebp - 0x10], ebx
mov esi, ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x18], ebx
stosd dword es:[edi], eax
mov dword [ebp - 8], ebx
mov dword [ebp - 0x20], ebx
mov dword [ebp - 0x14], ebx
stosd dword es:[edi], eax
mov dword [ebp - 0x2c], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x24], ebx
stosd dword es:[edi], eax
mov eax, ebx
mov edi, dword [ebp + 8]
test edi, edi
je 0x10005a52
cmp dword [ebp + 0x18], eax
je 0x10005a52
xor ecx, ecx
inc ecx
cmp dword [ebp + 0x14], eax
je 0x100056dc
test dword [ebp + 0xc], 0x8000
cmovne eax, ecx
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x10]
push eax
push dword [edi + 4]
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
jne 0x100056f9
push 0x8009000d
jmp 0x10005a54
push str.1.2.840.113549.1.1.1
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x10005766
push str.1.2.840.10045.2.1
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x10005766
push str.1.2.643.7.1.1.1.1
push dword [edi + 8]
mov dword [ebp - 0x40], str.1.2.840.113549.1.12.1.80
mov dword [ebp - 0x28], 0x661e
mov dword [ebp - 0x1c], 7
mov dword [ebp - 0x14], 1
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
je 0x1000575d
push str.1.2.643.7.1.1.1.2
push dword [edi + 8]
call dword [sym.imp.KERNEL32.dll_lstrcmpA]
test eax, eax
jne 0x1000577b
mov dword [ebp - 0x2c], 1
jmp 0x1000577b
mov dword [ebp - 0x40], str.1.2.840.113549.1.12.1.3
mov dword [ebp - 0x28], 0x6603
mov dword [ebp - 0x1c], 0x19
push 0x18
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, eax
mov dword [ebp + 8], ecx
test ecx, ecx
jne 0x10005798
mov esi, 0x8007000e
jmp 0x100059be
mov edx, dword [ebp - 0xc]
test edx, edx
je 0x100057e0
mov dword [ecx], 0x10041630
cmp dword [ebp + 0x14], ebx
je 0x100057c6
lea eax, [ecx + 4]
push eax
push 0x10
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
je 0x100059be
mov ecx, dword [ebp + 8]
mov edx, dword [ebp - 0xc]
mov word [ecx + 0x14], 0x202
mov dword [ebp + 0xc], 0x7d0
ror word [ebp + 0xc], 8
mov ax, word [ebp + 0xc]
mov word [ecx + 0x16], ax
mov dword [ebp - 0x3c], 0x18
mov dword [ebp - 0x38], ecx
test edx, edx
jne 0x10005810
lea eax, [ebp - 4]
push eax
push 1
push dword [ebp - 0x28]
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
jne 0x10005866
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x100059be
mov eax, dword [edi + 0x10]
mov dword [ebp + 0xc], eax
test eax, eax
je 0x100059be
push 6
xor edx, edx
pop ecx
call fcn.10002450
test al, al
je 0x1000583c
mov eax, dword [ebp + 0xc]
mov eax, dword [eax]
mov dword [ebp + 0xc], eax
test eax, eax
je 0x100059be
mov ecx, dword [ebp + 8]
lea eax, [ebp - 4]
mov edx, dword [edi]
push eax
movzx eax, byte [ecx + 3]
push eax
lea eax, [ecx + 4]
mov ecx, dword [ebp - 0x40]
push eax
mov eax, dword [ebp + 0xc]
push 0x7d0
push dword [eax + 4]
call fcn.1000ae69
add esp, 0x14
jmp 0x100057ff
cmp dword [ebp - 0x14], ebx
je 0x10005897
mov eax, dword [ebp - 0x2c]
push ebx
lea eax, [eax*2 + 0x661f]
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
push 7
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x10005803
mov eax, 0x1000
jmp 0x1000589c
mov eax, 0x801000
lea ecx, [ebp - 8]
mov dword [ebp + 0xc], eax
push ecx
push ebx
push eax
push dword [ebp - 0x1c]
push dword [ebp - 4]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x10005803
push dword [ebp - 8]
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebp - 0x18], eax
test eax, eax
je 0x1000578e
cmp dword [ebp - 0xc], ebx
jne 0x100058e7
push dword [ebp - 8]
push 0x69
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
jmp 0x10005906
lea ecx, [ebp - 8]
push ecx
push eax
push dword [ebp + 0xc]
push dword [ebp - 0x1c]
push dword [ebp - 4]
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x10005803
cmp dword [ebp - 0x14], ebx
je 0x10005954
mov edx, dword [edi + 4]
lea eax, [ebp - 0x24]
mov ecx, dword [edi]
push eax
call fcn.1000b677
pop ecx
cmp eax, 0xffffffff
je 0x10005803
push dword [ebp - 0xc]
mov eax, dword [ebp - 0x18]
push dword [ebp - 0x24]
mov edx, dword [ebp - 4]
push dword [ebp - 8]
mov ecx, dword [edi]
push eax
push dword [edi + 8]
lea eax, [ebp - 0x40]
push eax
mov eax, dword [ebp + 8]
add eax, 4
push eax
call fcn.100054dd
add esp, 0x1c
test eax, eax
jne 0x10005966
jmp 0x10005803
mov eax, dword [ebp - 8]
add eax, 0xfffffff8
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x18]
add eax, 8
mov dword [ebp - 0x30], eax
mov edi, dword [sym.imp.CRYPT32.dll_CryptEncodeObject]
lea eax, [ebp - 0x20]
push eax
push ebx
lea eax, [ebp - 0x40]
push eax
push 0x2d
push 0x10001
call edi
test eax, eax
je 0x10005803
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp + 0x18]
cmp dword [ebp + 0x14], ebx
jne 0x10005995
mov dword [ecx], eax
jmp 0x100059bb
cmp dword [ecx], eax
jae 0x100059a2
mov esi, 0xea
mov dword [ecx], eax
jmp 0x100059be
push ecx
push dword [ebp + 0x14]
lea eax, [ebp - 0x40]
push eax
push 0x2d
push 0x10001
call edi
test eax, eax
je 0x10005803
xor ebx, ebx
inc ebx
cmp dword [ebp - 0x14], 0
mov edi, dword [sym.imp.KERNEL32.dll_LocalFree]
je 0x100059cf
push dword [ebp - 0x30]
call edi
push dword [ebp + 8]
call edi
push dword [ebp - 0x18]
call edi
push dword [ebp - 0x24]
call dword [sym.imp.msvcrt.dll_free]
cmp dword [ebp - 0x10], 0
mov edi, dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
pop ecx
je 0x100059f4
push dword [ebp - 0x10]
call edi
cmp dword [ebp - 4], 0
je 0x100059ff
push dword [ebp - 4]
call edi
test ebx, ebx
jne 0x10005a4e
mov ecx, 0x80090003
lea eax, [ecx + 0x13]
cmp esi, eax
ja 0x10005a2d
je 0x10005a47
cmp esi, 0x4c7
je 0x10005a47
cmp esi, ecx
je 0x10005a47
cmp esi, 0x8009000b
je 0x10005a47
cmp esi, 0x80090010
jmp 0x10005a43
cmp esi, 0x80090022
je 0x10005a47
cmp esi, 0x80090345
je 0x10005a47
cmp esi, 0x8010006e
je 0x10005a47
mov esi, ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, ebx
jmp 0x10005a5c
push 0x57
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x14