Function at 0x10005c70
Capabilities:
Encrypt data using aes via winapi
Encrypt or decrypt via wincrypt

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x54
mov eax, dword [0x10043230]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x14]
push ebx
mov ebx, dword [ebp + 0x20]
push esi
mov esi, dword [ebp + 0x1c]
mov dword [ebp - 0x40], edx
mov edx, dword [ebp + 0x10]
mov byte [ebp - 0x31], cl
mov ecx, dword [ebp + 0x24]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0x18]
push edi
mov edi, dword [ebp + 8]
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x48], esi
mov dword [ebp - 0x4c], ebx
mov dword [ebp - 0x50], ecx
test esi, esi
je 0x10005f72
test ebx, ebx
je 0x10005f72
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x10005ce8
mov ecx, dword [ebp - 0x40]
mov edx, edi
call fcn.10005f90
mov dword [esi], eax
mov dword [ebx], edi
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001bb54
mov esp, ebp
pop ebp
ret
cmp eax, 4
je 0x10005d03
pop edi
pop esi
mov eax, 5
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001bb54
mov esp, ebp
pop ebp
ret
test edx, edx
je 0x10005f72
cmp dword [ebp - 0x3c], 0x10
jb 0x10005f72
call fcn.100059d0
mov ebx, eax
mov dword [ebp - 0x38], ebx
test ebx, ebx
jne 0x10005d37
pop edi
pop esi
lea eax, [ebx + 8]
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001bb54
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x44]
add eax, 0xfffffff0
add eax, dword [ebp - 0x3c]
push 0x10
push eax
xorps xmm0, xmm0
movq qword [ebp - 0x1f], xmm0
lea eax, [ebp - 0x14]
xor esi, esi
push 0x10
movq qword [ebp - 0x17], xmm0
push eax
mov dword [ebp - 0x24], esi
movq qword [ebp - 0xf], xmm0
mov word [ebp - 7], si
mov byte [ebp - 5], 0
mov dword [ebp - 0x20], 0x208
mov dword [ebp - 0x1c], 0x660e
mov dword [ebp - 0x18], 0x10
call fcn.1001d71b
add esp, 0x10
test eax, eax
je 0x10005d91
lea edi, [esi + 9]
jmp 0x10005f0b
lea eax, [ebp - 0x24]
push eax
push 0
push 0
push 0x1c
lea eax, [ebp - 0x20]
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x10005dc8
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov edx, esi
mov ecx, str.CryptImportKey_failed.
call fcn.10001720
mov edi, 8
jmp 0x10005f0b
mov esi, dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
push 0
lea eax, [ebp - 0x30]
push eax
push 3
push dword [ebp - 0x24]
mov dword [ebp - 0x30], 1
call esi
test eax, eax
jne 0x10005e04
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov edx, esi
mov ecx, str.CryptSetKeyParam_padding__failed.
call fcn.10001720
mov edi, 8
jmp 0x10005f0b
push 0
push dword [ebp - 0x54]
push 1
push dword [ebp - 0x24]
call esi
test eax, eax
jne 0x10005e32
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov edx, esi
mov ecx, str.CryptSetKeyParam_IV__failed.
call fcn.10001720
mov edi, 8
jmp 0x10005f0b
push 0
lea eax, [ebp - 0x2c]
push eax
push 4
push dword [ebp - 0x24]
mov dword [ebp - 0x2c], 1
call esi
test eax, eax
jne 0x10005e68
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov edx, esi
mov ecx, str.CryptSetKeyParam_mode__failed.
call fcn.10001720
mov edi, 8
jmp 0x10005f0b
lea esi, [edi + 0x10]
push esi
call fcn.1001c53a
mov ebx, eax
add esp, 4
test ebx, ebx
jne 0x10005e85
lea esi, [eax + 8]
lea edi, [eax + 1]
jmp 0x10005f08
push edi
push dword [ebp - 0x40]
push esi
push ebx
call fcn.1001d71b
mov esi, eax
add esp, 0x10
test esi, esi
je 0x10005ea0
mov edi, 9
jmp 0x10005eff
cmp byte [ebp - 0x31], 0
mov dword [ebp - 0x28], edi
je 0x10005ec3
lea eax, [edi + 0x10]
push eax
lea eax, [ebp - 0x28]
push eax
push ebx
push 0
push 1
push 0
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
jmp 0x10005ed7
lea eax, [ebp - 0x28]
push eax
push ebx
push 0
push 1
push 0
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
jne 0x10005f3e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp byte [ebp - 0x31], 0
mov esi, eax
mov edx, esi
mov ecx, str.CryptEncrypt_failed.
jne 0x10005ef5
mov ecx, str.CryptDecrypt_failed.
call fcn.10001720
mov edi, 8
push ebx
call fcn.1001c502
add esp, 4
mov ebx, dword [ebp - 0x38]
mov eax, dword [ebp - 0x50]
test eax, eax
je 0x10005f14
mov dword [eax], esi
mov eax, dword [ebp - 0x24]
test eax, eax
je 0x10005f22
push eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, edi
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001bb54
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x4c]
push dword [ebp - 0x24]
mov dword [eax], ebx
mov eax, dword [ebp - 0x28]
mov dword [ecx], eax
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
push 0
push dword [ebp - 0x38]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1001bb54
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
mov eax, 9
pop ebx
call fcn.1001bb54
mov esp, ebp
pop ebp
ret