Function at 0x412fa0
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43dff5
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x40
push esi
push edi
push 0xf0000040
push 1
push 0
push 0
lea eax, [ebp - 0x2c]
mov dword [ebp - 0x28], edx
push eax
mov edi, ecx
mov dword [ebp - 0x2c], 0
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x18], 4
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
mov esi, eax
test esi, esi
je 0x41321c
mov ecx, dword [edi]
lea edx, [ebp - 0x14]
mov eax, dword [edi + 4]
push edx
push 0
push 0
sub eax, ecx
push eax
push ecx
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
mov esi, eax
test esi, esi
je 0x41321c
push 0
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x10]
push eax
push 8
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
mov esi, eax
test esi, esi
je 0x41321c
mov esi, dword [ebp - 0x10]
xor eax, eax
shr esi, 3
xor edi, edi
add esi, 0xfffffff5
mov dword [ebp - 0x40], edi
push ebx
xor ebx, ebx
mov dword [ebp - 0x10], esi
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x38], eax
test esi, esi
je 0x41309c
cmp esi, 0x7fffffff
ja 0x41324c
push esi
lea ecx, [ebp - 0x40]
call fcn.00409530
mov edi, dword [ebp - 0x40]
push esi
push ebx
push edi
call fcn.004228c0
mov eax, dword [ebp - 0x38]
lea ebx, [esi + edi]
mov esi, dword [ebp - 0x10]
add esp, 0xc
mov dword [ebp - 0x3c], ebx
mov dword [ebp - 0x20], eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 0x44], 0
mov byte [ebp - 4], 1
xor edx, edx
nop
mov eax, dword [ebp - 0x28]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub eax, ecx
sub eax, edx
cmp esi, eax
jae 0x4130d5
mov dword [ebp - 0x1c], esi
jmp 0x4130da
mov dword [ebp - 0x1c], eax
mov esi, eax
push esi
mov esi, dword [ebp - 0x24]
lea eax, [ecx + esi]
push eax
push edi
call fcn.00422340
mov ecx, dword [ebp - 0x28]
add esp, 0xc
mov eax, dword [ebp - 0x1c]
add esi, eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x24], esi
mov edx, dword [ecx + 4]
sub edx, dword [ecx]
lea ecx, [ebp - 0x18]
push 0
push ecx
push 0
cmp esi, edx
mov dword [ebp - 0x34], edx
push 0
sete al
push eax
push 0
push dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov esi, eax
test esi, esi
je 0x4131b2
mov esi, dword [ebp - 0x18]
mov ecx, ebx
sub ecx, edi
cmp esi, ecx
jbe 0x413173
jae 0x41313d
lea ebx, [edi + esi]
jmp 0x413170
jbe 0x413173
mov eax, dword [ebp - 0x20]
sub eax, edi
cmp esi, eax
jbe 0x413160
push ecx
push esi
lea ecx, [ebp - 0x40]
call fcn.00413560
mov eax, dword [ebp - 0x38]
mov ebx, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x40]
mov dword [ebp - 0x20], eax
jmp 0x413173
sub esi, ecx
push esi
push 0
push ebx
call fcn.004228c0
add esp, 0xc
add ebx, esi
mov dword [ebp - 0x3c], ebx
mov eax, ebx
sub eax, edi
push eax
lea eax, [ebp - 0x1c]
push eax
push edi
push 0
push dword [ebp - 0x30]
push 0
push dword [ebp - 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov esi, eax
test esi, esi
je 0x4131b2
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x4c]
push edi
push dword [ebp - 0x48]
call fcn.00413360
mov edx, dword [ebp - 0x24]
cmp edx, dword [ebp - 0x34]
je 0x4131b2
mov esi, dword [ebp - 0x10]
jmp 0x4130c0
mov ecx, dword [ebp - 0x28]
lea eax, [ebp - 0x4c]
push eax
call fcn.00413260
mov ecx, dword [ebp - 0x4c]
pop ebx
test ecx, ecx
je 0x4131ef
mov edx, dword [ebp - 0x44]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x4131e5
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x413251
push edx
push ecx
call fcn.00420d85
add esp, 8
test edi, edi
je 0x41321c
mov ecx, dword [ebp - 0x20]
mov eax, edi
sub ecx, edi
cmp ecx, 0x1000
jb 0x413212
mov edi, dword [eax - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x413251
push ecx
push edi
call fcn.00420d85
add esp, 8
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x41322a
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x41323a
push 0
push eax
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov ecx, dword [ebp - 0xc]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret
call fcn.00405ad0
call fcn.0042d25f
int3