Function at 0x100035f0
Capabilities:
Create new key via cryptacquirecontext
Encrypt or decrypt via wincrypt
Generate random numbers via winapi

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
mov esi, eax
xor eax, eax
push 0xf0000040
push 0x18
mov dword [esi], eax
push eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
push eax
mov dword [esi + 0xc], eax
push esi
mov dword [ebp - 0x20], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x28], 4
mov dword [esi + 0x10], eax
call edi
test eax, eax
jne 0x1000366c
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
mov dword [ebp - 8], eax
cmp eax, 0x80090016
jne 0x100038ee
push 0xf0000048
push 0x18
push 0
push 0
push esi
call edi
test eax, eax
jne 0x1000366c
call ebx
mov dword [ebp - 8], eax
jmp 0x100038ee
mov eax, dword [ebp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0x80
push 8
mov dword [eax], 0x80
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
call ebx
mov ecx, dword [ebp + 0x10]
push 0x20
push 8
mov dword [ecx], eax
call edi
push eax
call ebx
mov edx, dword [ebp + 0x10]
cmp dword [edx], 0
mov edi, eax
mov dword [ebp - 0x20], edi
je 0x100038e7
test edi, edi
je 0x100038e7
mov eax, dword [esi]
push edi
push 0x20
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
jne 0x100036d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov ecx, edi
call fcn.10003540
mov dword [ebp - 8], eax
test eax, eax
jne 0x100038ee
mov edx, dword [ebp + 0xc]
mov edi, dword [sym.imp.CRYPT32.dll_CryptDecodeObject]
lea ecx, [ebp - 0xc]
push ecx
push eax
push eax
push edx
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
push eax
push 8
push 1
call edi
test eax, eax
jne 0x10003713
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov ecx, dword [ebp - 0xc]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
mov dword [ebp - 0x18], eax
test eax, eax
jne 0x10003737
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov ecx, dword [ebp + 8]
lea edx, [ebp - 0xc]
push edx
push eax
mov eax, dword [ebp + 0xc]
push 0
push eax
push ecx
push 8
push 1
call edi
test eax, eax
jne 0x1000375e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov eax, dword [ebp - 0x18]
mov ecx, dword [eax + 0xc]
lea edx, [ebp - 0xc]
push edx
mov edx, dword [eax + 0x10]
push 0
push 0
push ecx
push edx
push 0x13
push 1
call edi
test eax, eax
jne 0x10003789
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov eax, dword [ebp - 0xc]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call ebx
mov ebx, eax
mov dword [ebp - 0x24], ebx
test ebx, ebx
jne 0x100037af
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov eax, dword [ebp - 0x18]
mov edx, dword [eax + 0xc]
mov eax, dword [eax + 0x10]
lea ecx, [ebp - 0xc]
push ecx
push ebx
push 0
push edx
push eax
push 0x13
push 1
call edi
test eax, eax
jne 0x100037d9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
push 0xf0000040
push 1
push 0
push 0
lea ecx, [ebp - 0x1c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x10003800
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 0x1c]
lea edx, [ebp - 0x14]
push edx
push 0
push 0
push eax
push ebx
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x10003829
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov ecx, dword [ebp - 0x14]
push 0
lea edx, [ebp - 0x28]
push edx
lea eax, [ebp - 0x10]
push eax
push 9
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
test eax, eax
jne 0x10003851
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov edx, dword [ebp + 0x10]
mov eax, dword [ebp - 0x20]
mov edi, dword [edx]
shr dword [ebp - 0x10], 3
push 0x20
push eax
push edi
call fcn.1000b320
mov eax, dword [ebp + 0x14]
add dword [eax], 0xfffffff5
add esp, 0xc
cmp dword [ebp - 0x10], 0x80
je 0x10003883
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov ecx, dword [ebp - 0x14]
push 0x80
push eax
push edi
push 0
push 1
push 0
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
jne 0x100038a9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 8], eax
jmp 0x100038ee
mov edx, dword [ebp - 0x10]
xor eax, eax
test edx, 0xfffffffe
jbe 0x100038ee
mov ecx, dword [ebp + 0x10]
mov edi, dword [ecx]
mov ecx, edi
lea ecx, [ecx]
movzx ebx, byte [edi + eax]
mov dl, byte [ecx + edx - 1]
mov byte [ebp - 1], bl
mov byte [edi + eax], dl
mov edx, dword [ebp - 0x10]
movzx ebx, bl
mov byte [ecx + edx - 1], bl
mov edx, dword [ebp - 0x10]
mov ebx, edx
inc eax
shr ebx, 1
dec ecx
cmp eax, ebx
jb 0x100038c0
jmp 0x100038ee
mov dword [ebp - 8], 8
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x100038fe
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x1000390c
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [ebp - 0x24]
mov edi, dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
test eax, eax
je 0x10003927
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x10003936
push eax
push 0
call ebx
push eax
call edi
cmp dword [ebp - 8], 0
je 0x100039a9
mov eax, dword [ebp + 0x10]
mov eax, dword [eax]
test eax, eax
je 0x1000395f
push eax
push 0
call ebx
push eax
call edi
mov ecx, dword [ebp + 0x10]
mov edx, dword [ebp + 0x14]
mov dword [ecx], 0
mov dword [edx], 0
mov eax, dword [esi + 4]
test eax, eax
je 0x1000396d
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [esi + 8]
test eax, eax
je 0x1000397b
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [esi + 0xc]
test eax, eax
je 0x1000398a
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [esi]
test eax, eax
je 0x10003999
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov eax, dword [ebp - 0x20]
test eax, eax
je 0x100039b8
push eax
push 0
call ebx
push eax
call edi
mov eax, dword [ebp - 8]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret