Function at 0x431310
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
push 0
lea eax, [ebp - 0x20]
mov dword [ebp - 8], 1
push eax
lea eax, [ebp - 8]
mov byte [ebp - 1], 1
push eax
mov ebx, ecx
mov dword [ebp - 0x20], 4
push 8
push ebx
mov esi, edx
mov dword [ebp - 0x14], ebx
call dword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
test eax, eax
jne 0x431352
xor al, al
mov byte [ebp - 1], al
jmp 0x4314d2
mov ecx, dword [ebp - 8]
shr ecx, 3
mov dword [ebp - 8], ecx
mov ebx, ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ecx
push edi
mov edi, ecx
test ecx, ecx
jne 0x431386
mov ecx, 1
mov dword [ebp - 8], 1
mov dword [ebp - 0x18], ecx
mov edi, ecx
mov dword [ebp - 0x20], ecx
mov ebx, ecx
mov dword [ebp - 0x1c], ecx
mov eax, dword [esi + 0x10]
xor edx, edx
mov dword [ebp - 0xc], eax
div ecx
xor edx, edx
mov ecx, eax
mov eax, dword [ebp - 0xc]
div dword [ebp - 0x18]
test edx, edx
je 0x4313a1
inc ecx
test edx, edx
cmove ebx, dword [ebp - 0x1c]
test edx, edx
cmove edi, dword [ebp - 0x20]
cmp dword [esi + 0x14], 0xf
jbe 0x4313c6
mov eax, dword [esi]
lea edx, [esi + 0x10]
imul ecx, ebx
mov edi, eax
mov dword [ebp - 0x20], edx
sub ecx, dword [ebp - 0xc]
add eax, dword [ebp - 0xc]
jmp 0x4313d8
imul ecx, edi
lea eax, [esi + 0x10]
mov dword [ebp - 0x20], eax
mov edi, esi
mov eax, dword [ebp - 0xc]
sub ecx, eax
add eax, esi
push 0
push ecx
sub eax, edi
mov ecx, esi
push eax
call fcn.0042ad20
mov ecx, 0x3e8
xor edx, edx
mov eax, ecx
xor ebx, ebx
div dword [ebp - 8]
sub ecx, edx
xor edi, edi
mov dword [ebp - 0x10], ecx
nop word [eax + eax]
mov eax, dword [ebp - 0xc]
sub eax, edi
cmp eax, ecx
jg 0x431411
mov dword [ebp - 0x10], eax
mov ebx, 1
cmp byte [ebp + 8], 0
mov ecx, esi
mov eax, dword [esi + 0x14]
je 0x431443
cmp eax, 0xf
jbe 0x431423
mov ecx, dword [esi]
mov eax, dword [ebp - 0x20]
mov eax, dword [eax]
sub eax, edi
push eax
lea eax, [ebp - 0x10]
push eax
lea eax, [ecx + edi]
push eax
push 0
push ebx
push 0
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
jmp 0x431460
cmp eax, 0xf
jbe 0x43144a
mov ecx, dword [esi]
lea eax, [ebp - 0x10]
push eax
lea eax, [ecx + edi]
push eax
push 0
push ebx
push 0
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x43146f
mov ecx, dword [ebp - 0x10]
add edi, ecx
test ebx, ebx
je 0x431400
jmp 0x431474
xor al, al
mov byte [ebp - 1], al
mov ecx, dword [esi + 0x10]
cmp edi, ecx
ja 0x43148c
mov dword [esi + 0x10], edi
cmp dword [esi + 0x14], 0xf
jbe 0x431486
mov esi, dword [esi]
mov byte [esi + edi], 0
jmp 0x4314cb
mov edx, dword [esi + 0x14]
mov ebx, edi
mov eax, edx
sub ebx, ecx
sub eax, ecx
cmp ebx, eax
ja 0x4314b9
mov dword [esi + 0x10], edi
cmp edx, 0xf
jbe 0x4314a5
mov esi, dword [esi]
push ebx
add esi, ecx
push 0
push esi
call fcn.0053fb70
add esp, 0xc
mov byte [esi + ebx], 0
jmp 0x4314cb
push 0
push ebx
mov byte [ebp - 0x20], 0
mov ecx, esi
push dword [ebp - 0x20]
push ebx
call fcn.0042be60
mov ebx, dword [ebp - 0x14]
mov al, byte [ebp - 1]
pop edi
test ebx, ebx
je 0x4314e0
push ebx
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov al, byte [ebp - 1]
pop esi
pop ebx
mov esp, ebp
pop ebp
ret