Function at 0x412570
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43c545
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 0x4127ec
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 0x4127ec
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 0x4127ec
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 0x41266c
cmp esi, 0x7fffffff
ja 0x41281c
push esi
lea ecx, [ebp - 0x40]
call fcn.00408a60
mov edi, dword [ebp - 0x40]
push esi
push ebx
push edi
call fcn.00420e90
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 0x4126a5
mov dword [ebp - 0x1c], esi
jmp 0x4126aa
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.00420910
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 0x412782
mov esi, dword [ebp - 0x18]
mov ecx, ebx
sub ecx, edi
cmp esi, ecx
jbe 0x412743
jae 0x41270d
lea ebx, [edi + esi]
jmp 0x412740
jbe 0x412743
mov eax, dword [ebp - 0x20]
sub eax, edi
cmp esi, eax
jbe 0x412730
push ecx
push esi
lea ecx, [ebp - 0x40]
call fcn.00412b30
mov eax, dword [ebp - 0x38]
mov ebx, dword [ebp - 0x3c]
mov edi, dword [ebp - 0x40]
mov dword [ebp - 0x20], eax
jmp 0x412743
sub esi, ecx
push esi
push 0
push ebx
call fcn.00420e90
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 0x412782
push dword [ebp - 0x1c]
lea ecx, [ebp - 0x4c]
push edi
push dword [ebp - 0x48]
call fcn.00412930
mov edx, dword [ebp - 0x24]
cmp edx, dword [ebp - 0x34]
je 0x412782
mov esi, dword [ebp - 0x10]
jmp 0x412690
mov ecx, dword [ebp - 0x28]
lea eax, [ebp - 0x4c]
push eax
call fcn.00412830
mov ecx, dword [ebp - 0x4c]
pop ebx
test ecx, ecx
je 0x4127bf
mov edx, dword [ebp - 0x44]
mov eax, ecx
sub edx, ecx
cmp edx, 0x1000
jb 0x4127b5
mov ecx, dword [eax - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x412821
push edx
push ecx
call fcn.0041f22a
add esp, 8
test edi, edi
je 0x4127ec
mov ecx, dword [ebp - 0x20]
mov eax, edi
sub ecx, edi
cmp ecx, 0x1000
jb 0x4127e2
mov edi, dword [eax - 4]
add ecx, 0x23
sub eax, edi
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x412821
push ecx
push edi
call fcn.0041f22a
add esp, 8
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x4127fa
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x41280a
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.00405400
call fcn.0042b82f
int3