Function at 0x670650
Capabilities:
Encrypt data using aes via winapi

Disassembly:
push ebp
lea ebp, [esp - 0x70]
sub esp, 0x70
push 0xffffffffffffffff
push 0x7c6fa8
mov eax, dword fs:[0]
push eax
sub esp, 0x34
mov eax, dword [0x89b044]
xor eax, ebp
mov dword [ebp + 0x6c], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x10], esp
mov esi, dword [ebp + 0x78]
mov ebx, ecx
mov eax, dword [ebx + 8]
lea edi, [ebx + 8]
mov dword [ebp + 0x2c], ebx
mov dword [ebp + 0x38], esi
test eax, eax
je 0x6706a9
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov dword [edi], 0
mov byte [ebx + 0x10], 0
cmp dword [ebx + 4], 0
mov dword [ebp - 4], 0
jne 0x6706de
lea eax, [ebp + 0x24]
push eax
lea ecx, [ebp + 0x18]
mov dword [ebp + 0x24], str.SetKey:_Provider_is_not_valid
call fcn.007203fb
push 0x870120
lea ecx, [ebp + 0x18]
push ecx
mov dword [ebp + 0x18], vtable.WinAESException.0
call fcn.0072039e
test esi, esi
jne 0x67070a
lea edx, [ebp + 0x38]
push edx
lea ecx, [ebp]
mov dword [ebp + 0x38], str.SetKey:_Key_buffer_is_NULL
call fcn.007203fb
push 0x870120
lea eax, [ebp]
push eax
mov dword [ebp], vtable.WinAESException.0
call fcn.0072039e
mov esi, dword [ebp + 0x7c]
cmp esi, 0x10
je 0x670737
cmp esi, 0x18
je 0x670737
cmp esi, 0x20
je 0x670737
push str.SetKey:_Key_size_is_not_valid
lea ecx, [ebp - 0x28]
call fcn.00670360
push 0x870120
lea ecx, [ebp - 0x28]
push ecx
call fcn.0072039e
push 0x2c
lea edx, [ebp + 0x40]
push 0
push edx
call fcn.007202b0
xor eax, eax
add esp, 0xc
mov byte [ebp + 0x40], 8
mov byte [ebp + 0x41], 2
mov word [ebp + 0x42], ax
mov byte [ebp - 4], 1
cmp esi, 0x10
je 0x67079f
cmp esi, 0x18
je 0x670791
cmp esi, 0x20
je 0x670783
push str.SetKey:_Key_size_is_not_valid
lea ecx, [ebp - 0x40]
call fcn.00670360
push 0x870120
lea ecx, [ebp - 0x40]
push ecx
call fcn.0072039e
mov dword [ebp + 0x44], 0x6610
mov eax, 0x20
jmp 0x6707ab
mov dword [ebp + 0x44], 0x660f
mov eax, 0x18
jmp 0x6707ab
mov dword [ebp + 0x44], 0x660e
mov eax, 0x10
mov edx, dword [ebp + 0x38]
push esi
push edx
push eax
mov dword [ebp + 0x48], eax
lea eax, [ebp + 0x4c]
push eax
call fcn.0071ffd1
add esp, 0x10
test eax, eax
je 0x6707ec
lea ecx, [ebp + 0x34]
push ecx
lea ecx, [ebp - 0x1c]
mov dword [ebp + 0x34], str.SetKey:_Unable_to_copy_key
call fcn.007203fb
push 0x870120
lea edx, [ebp - 0x1c]
push edx
mov dword [ebp - 0x1c], vtable.WinAESException.0
call fcn.0072039e
mov ecx, dword [ebx + 4]
push edi
push 0
push 0
lea eax, [esi + 0xc]
push eax
lea eax, [ebp + 0x40]
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x67082f
lea edx, [ebp + 0x28]
push edx
lea ecx, [ebp + 0xc]
mov dword [ebp + 0x28], str.SetKey:_Import_key_failed
call fcn.007203fb
push 0x870120
lea eax, [ebp + 0xc]
push eax
mov dword [ebp + 0xc], vtable.WinAESException.0
call fcn.0072039e
mov edx, dword [edi]
push 0
lea ecx, [ebp + 0x30]
push ecx
push 4
push edx
mov dword [ebp + 0x30], 1
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
jne 0x6708a6
push str.SetKey:_Set_CBC_mode_failed
lea ecx, [ebp - 0x34]
call fcn.00670360
push 0x870120
lea eax, [ebp - 0x34]
push eax
call fcn.0072039e
mov ecx, dword [ebp + 0x2c]
test byte [ecx + 0x14], 0x10
je 0x670878
push 0
push 0
call fcn.0072039e
mov byte [ebp + 0x3f], 0
mov eax, 0x670882
ret
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x6c]
xor ecx, ebp
call fcn.0071fe0b
add ebp, 0x70
mov esp, ebp
pop ebp
ret 8
mov al, 1
mov edx, 4
lea ecx, [ebp + 0x40]
test edx, edx
je 0x670885
mov byte [ecx], 0
inc ecx
dec edx
jmp 0x6708b0