Function at 0x404460
Capabilities:
Encrypt or decrypt data via bcrypt
Generate random numbers via winapi

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
xorps xmm0, xmm0
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, edx
push edi
mov dword [ebp - 0x40], eax
xor edi, edi
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x48], eax
mov eax, dword [ebp + 0x14]
push str.___Encrypt_A_data
push 3
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x3c], esi
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], 0
movlpd qword [ebp - 0x38], xmm0
movups xmmword [ebp - 0x24], xmm0
mov dword [ebp - 0x28], 0
movups xmmword [ebp - 0x14], xmm0
call fcn.00408d60
mov eax, dword [ebp - 0x48]
add esp, 8
push edi
push edi
mov dword [eax], edi
lea eax, [ebp - 0x30]
push 0x4cb24c
push eax
mov dword [esi], edi
call dword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
test eax, eax
jns 0x404500
push eax
push str.Error_opening_alg:0x_X
push 1
call fcn.00408d60
add esp, 0xc
mov ebx, esi
jmp 0x4047d9
push 0
push 0x1e
push str.ChainingModeCBC
push str.ChainingMode
push dword [ebp - 0x30]
call dword [sym.imp.bcrypt.dll_BCryptSetProperty]
test eax, eax
jns 0x404532
push eax
push str.Error_setting_chmode_prop:0x_X
push 1
call fcn.00408d60
add esp, 0xc
mov ebx, esi
jmp 0x4047d9
push 0
lea eax, [ebp - 0x28]
push eax
push 4
lea eax, [ebp - 0x38]
push eax
push str.ObjectLength
push dword [ebp - 0x30]
call dword [sym.imp.bcrypt.dll_BCryptGetProperty]
test eax, eax
jns 0x404567
push eax
push str.Error_getting_k_size:0x_X
push 1
call fcn.00408d60
add esp, 0xc
mov ebx, esi
jmp 0x4047d9
push dword [ebp - 0x38]
mov esi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call esi
inc dword [0x4de7b4]
mov dword [ebp - 0x34], eax
test eax, eax
jne 0x40459c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_allocating_k_obj:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
push 2
push 0x20
lea eax, [ebp - 0x24]
push eax
push 0
call dword [sym.imp.bcrypt.dll_BCryptGenRandom]
test eax, eax
jns 0x4045c0
push eax
push str.Error_generating_random_buff:0x_X
push 1
call fcn.00408d60
add esp, 0xc
mov eax, dword [ebp - 0x38]
lea ecx, [ebp - 0x24]
push 0
push eax
push ecx
push eax
push dword [ebp - 0x34]
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 0x30]
call dword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
test eax, eax
jns 0x4045f4
push eax
push str.Error_generating_key:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
push 1
push dword [ebp - 0x40]
push 0
push 0
push 0
push 0
push 0
push ebx
push dword [ebp - 0x44]
push dword [ebp - 0x2c]
call dword [sym.imp.bcrypt.dll_BCryptEncrypt]
test eax, eax
jns 0x404629
push eax
push str.Error_getting_size_of_the_enc_buffer:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
mov eax, dword [ebp - 0x40]
push dword [eax]
push 0x40
call esi
mov ecx, dword [ebp - 0x3c]
inc dword [0x4de7b4]
mov dword [ecx], eax
test eax, eax
jne 0x40465c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_allocating_mem_for_encrypted_buffer:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
mov edx, dword [ebp - 0x40]
mov esi, dword [edx]
test ebx, ebx
je 0x40467e
mov ecx, dword [ebp - 0x44]
test ecx, ecx
je 0x4046b4
cmp esi, ebx
jb 0x4046b4
push ebx
push ecx
push eax
call fcn.004ae080
mov edx, dword [ebp - 0x40]
add esp, 0xc
mov ebx, dword [ebp - 0x3c]
mov eax, dword [edx]
push 0
push edx
mov ecx, dword [ebx]
push eax
push ecx
push 0
push 0
push 0
push eax
push ecx
push dword [ebp - 0x2c]
call dword [sym.imp.bcrypt.dll_BCryptEncrypt]
test eax, eax
jns 0x40470a
push eax
push str.Error_encrypting_data:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d9
push esi
push 0
push eax
call fcn.004ad600
add esp, 0xc
cmp dword [ebp - 0x44], edi
jne 0x4046ef
call fcn.004b3319
mov dword [eax], 0x16
call fcn.004b3238
mov eax, 0x16
push eax
push str.Error_copying_key_data_blob:0x_0X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
cmp esi, ebx
jae 0x4046d5
call fcn.004b3319
mov dword [eax], 0x22
call fcn.004b3238
mov eax, 0x22
jmp 0x4046da
mov ebx, dword [sym.imp.bcrypt.dll_BCryptExportKey]
lea eax, [ebp - 0x28]
push 0
push eax
push 4
push 0
push str.KeyDataBlob
push 0
push dword [ebp - 0x2c]
call ebx
test eax, eax
jns 0x40473f
push eax
push str.Error_exporting_key:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
push dword [ebp - 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push 0x40
call esi
inc dword [0x4de7b4]
mov edi, eax
test edi, edi
jne 0x404770
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_allocating_mem_for_key_blob:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
push 0
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 0x28]
push edi
push str.KeyDataBlob
push 0
push dword [ebp - 0x2c]
call ebx
test eax, eax
js 0x40472a
mov eax, dword [ebp - 0x28]
mov ebx, dword [ebp - 0x50]
push eax
push 0x40
mov dword [ebx], eax
call esi
mov ecx, dword [ebp - 0x48]
inc dword [0x4de7b4]
mov dword [ecx], eax
test eax, eax
jne 0x4047be
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.Error_allocating_mem_for_key_data:0x_X
push 1
call fcn.00408d60
add esp, 0xc
jmp 0x4047d6
mov ecx, dword [ebx]
test ecx, ecx
je 0x4047cf
push ecx
push edi
push eax
call fcn.004ae080
add esp, 0xc
mov dword [ebp - 0x4c], 1
mov ebx, dword [ebp - 0x3c]
mov eax, dword [ebp - 0x2c]
test eax, eax
je 0x4047e7
push eax
call dword [sym.imp.bcrypt.dll_BCryptDestroyKey]
mov eax, dword [ebp - 0x30]
test eax, eax
je 0x4047f7
push 0
push eax
call dword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov eax, dword [ebp - 0x34]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
je 0x40480d
push eax
call esi
dec dword [0x4de7b4]
test edi, edi
je 0x40481a
push edi
call esi
dec dword [0x4de7b4]
mov edi, dword [ebp - 0x4c]
test edi, edi
jne 0x40484a
mov eax, dword [ebx]
test eax, eax
je 0x404832
push eax
call esi
dec dword [0x4de7b4]
mov dword [ebx], edi
mov ebx, dword [ebp - 0x48]
mov eax, dword [ebx]
test eax, eax
je 0x40484a
push eax
call esi
dec dword [0x4de7b4]
mov dword [ebx], 0
push str.Encrypt_A_data___
push 3
call fcn.00408d60
mov ecx, dword [ebp - 4]
add esp, 8
mov eax, edi
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.004ac4d4
mov esp, ebp
pop ebp
ret