Function at 0x12a997c
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
xor ebx, ebx
cmp dword [ebp + 8], ebx
push esi
push edi
mov dword [ebp - 0x14], ecx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ebx
je 0x12a9b98
cmp dword [ebp + 0x10], ebx
je 0x12a9b98
mov eax, dword [ebp + 0x14]
cmp eax, ebx
je 0x12a9b98
cmp dword [ecx + 0x20], ebx
jne 0x12a99c3
mov dword [ebp - 4], 0x80049e51
jmp 0x12a9b9f
mov edx, dword [eax]
push 4
mov dword [ebp - 0x10], edx
mov dword [eax], ebx
mov eax, dword [ebp + 8]
mov edx, 0x1021090
pop edi
mov si, word [eax]
cmp si, word [edx]
jne 0x12a99f9
cmp si, bx
je 0x12a99f5
mov si, word [eax + 2]
cmp si, word [edx + 2]
jne 0x12a99f9
add eax, edi
add edx, edi
cmp si, bx
jne 0x12a99d5
xor eax, eax
jmp 0x12a99fe
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x12a9a0a
cmp dword [ecx + 8], 1
push 0x10
jmp 0x12a9a86
mov eax, dword [ebp + 8]
mov edx, 0x1021038
mov si, word [eax]
cmp si, word [edx]
jne 0x12a9a36
cmp si, bx
je 0x12a9a32
mov si, word [eax + 2]
cmp si, word [edx + 2]
jne 0x12a9a36
add eax, edi
add edx, edi
cmp si, bx
jne 0x12a9a12
xor eax, eax
jmp 0x12a9a3b
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x12a9a47
cmp dword [ecx + 8], 2
push 0x18
jmp 0x12a9a86
mov eax, dword [ebp + 8]
mov edx, 0x1020fe0
mov si, word [eax]
cmp si, word [edx]
jne 0x12a9a73
cmp si, bx
je 0x12a9a6f
mov si, word [eax + 2]
cmp si, word [edx + 2]
jne 0x12a9a73
add eax, edi
add edx, edi
cmp si, bx
jne 0x12a9a4f
xor eax, eax
jmp 0x12a9a78
sbb eax, eax
sbb eax, 0xffffffff
cmp eax, ebx
jne 0x12a9b8f
cmp dword [ecx + 8], 3
push 0x20
pop esi
je 0x12a9a95
mov dword [ebp - 4], 0x80049e2e
jmp 0x12a9b9f
mov eax, dword [ebp + 0xc]
lea edi, [esi + eax]
push edi
lea eax, [ebp - 8]
push eax
push ebx
push ebx
push 1
push ebx
push dword [ecx + 0x20]
mov ebx, dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov dword [ebp - 8], edi
call ebx
test eax, eax
jne 0x12a9ad3
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x12a9acb
and eax, 0xffff
or eax, 0x80070000
mov dword [ebp - 4], eax
jmp 0x12a9b9f
cmp dword [ebp + 0x18], 0
mov eax, dword [ebp - 8]
mov ecx, dword [ebp + 0x14]
mov dword [ecx], eax
je 0x12a9b9f
cmp dword [ebp - 0x10], eax
jae 0x12a9af6
mov dword [ebp - 4], 0x80049e19
jmp 0x12a9b9f
push eax
mov dword [ebp + 0x14], eax
mov dword [ebp - 8], edi
call fcn.01043ba8
mov edi, eax
test edi, edi
pop ecx
mov dword [ebp - 0xc], edi
jne 0x12a9b18
mov dword [ebp - 4], 0x8007000e
jmp 0x12a9b9f
push dword [ebp + 0x14]
push 0
push edi
call sub.msvcrt.dll_memset
push dword [ebp + 0xc]
lea eax, [edi + esi]
push dword [ebp + 0x10]
push eax
call sub.msvcrt.dll_memcpy
push 0
call dword [sym.imp.msvcrt.dll_time]
push eax
call dword [sym.imp.msvcrt.dll_srand]
and dword [ebp + 8], 0
add esp, 0x20
test esi, esi
jbe 0x12a9b60
call dword [sym.imp.msvcrt.dll_rand]
mov ecx, dword [ebp + 8]
inc dword [ebp + 8]
cmp dword [ebp + 8], esi
mov byte [ecx + edi], al
jb 0x12a9b4c
push dword [ebp + 0x14]
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0x14]
push edi
push 0
push 1
push 0
push dword [eax + 0x20]
call ebx
test eax, eax
je 0x12a9ab7
push dword [ebp - 8]
push edi
push dword [ebp + 0x18]
call sub.msvcrt.dll_memcpy
add esp, 0xc
jmp 0x12a9b9f
mov dword [ebp - 4], 0x80049e5b
jmp 0x12a9b9f
mov dword [ebp - 4], 0x80070057
push dword [ebp - 0xc]
call fcn.01043bb7
mov eax, dword [ebp - 4]
pop ecx
pop edi
pop esi
pop ebx
leave
ret 0x14