Function at 0x4077a9
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using des via winapi
Encrypt or decrypt via wincrypt

Disassembly:
sub esp, 0x30
push ebx
push ebp
push esi
push edi
push 0xf0000000
push 0x18
xor edi, edi
lea eax, [esp + 0x2c]
push edi
push edi
mov ebp, edi
mov esi, edx
push eax
mov ebx, ecx
mov dword [esp + 0x2c], ebp
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x407b27
lea eax, [esp + 0x20]
push eax
push edi
push edi
push dword [esp + 0x50]
push esi
push dword [esp + 0x38]
call dword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
je 0x407b1c
mov eax, dword [ebx + 4]
mov edi, dword [sym.imp.KERNEL32.dll_LocalAlloc]
push eax
push 0x40
mov dword [esp + 0x18], eax
call edi
mov esi, eax
test esi, esi
je 0x407b10
push dword [esp + 0x10]
push dword [ebx + 0x1c]
push esi
call fcn.0049fa90
add esp, 0xc
lea eax, [esp + 0x10]
push eax
push esi
push ebp
push 1
push ebp
push dword [esp + 0x34]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
mov ebp, dword [sym.imp.KERNEL32.dll_LocalFree]
test eax, eax
je 0x407af6
push str._nRSA_decrypt_is_a_success_n
call fcn.00409cda
push dword [esi]
push str.__MasterKey_len:__u_n
call fcn.00409cda
mov edx, dword [esi]
lea ecx, [esi + 8]
push 0x100001
call fcn.0040f762
push dword [esi + 4]
push str.__SuppKey___len:__u_n
call fcn.00409cda
mov ecx, dword [esi]
mov edx, dword [esi + 4]
add ecx, 8
push 0x100001
add ecx, esi
call fcn.0040f762
mov edx, dword [esi]
lea eax, [esp + 0x44]
push eax
lea eax, [esp + 0x34]
add edx, 8
push eax
push 0
add edx, esi
mov ecx, 0x6603
push 0x18
call fcn.00403cc7
add esp, 0x2c
test eax, eax
je 0x407b09
mov eax, dword [esi]
push 0
add eax, 0x20
add eax, esi
push eax
push 1
push dword [esp + 0x20]
call dword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x407abe
mov eax, dword [ebx + 8]
push eax
push 0x40
mov dword [esp + 0x18], eax
call edi
mov edi, eax
test edi, edi
je 0x407ad1
push dword [esp + 0x10]
push dword [ebx + 0x20]
push edi
call fcn.0049fa90
add esp, 0xc
lea eax, [esp + 0x10]
push eax
push edi
xor eax, eax
push eax
push eax
push eax
push dword [esp + 0x28]
call dword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x407aa6
mov ebx, dword [edi + 4]
add ebx, 8
add ebx, edi
push str._n3DES_decrypt_is_a_success_too_n
mov dword [esp + 0x20], ebx
call fcn.00409cda
mov edx, dword [esp + 0x14]
mov ecx, edi
mov dword [esp], 0x100001
call fcn.0040f762
mov dword [esp], 0x4c75d0
call fcn.00409cda
mov dword [esp], str.__nonce____:
call fcn.00409cda
mov edx, dword [edi + 4]
lea ecx, [edi + 8]
push 0
call fcn.0040f762
push 0x4c75d0
call fcn.00409cda
push str.__SID______:
call fcn.00409cda
mov ecx, ebx
call fcn.0040f8d2
mov ebx, 0x4c75d0
push ebx
call fcn.00409cda
push str.__SHA1_____:
call fcn.00409cda
mov ecx, dword [esp + 0x28]
push 0
add ecx, 0xffffffec
push 0x14
add ecx, edi
pop edx
call fcn.0040f762
push ebx
call fcn.00409cda
push 0x14
lea eax, [esp + 0x50]
mov edx, edi
push eax
mov eax, dword [esp + 0x38]
mov ecx, 0x8004
add eax, 0xffffffec
push eax
call fcn.004032e8
add esp, 0x2c
test eax, eax
je 0x407ab9
push str.___Calc_SHA1:
call fcn.00409cda
push 0
push 0x14
pop edx
lea ecx, [esp + 0x34]
call fcn.0040f762
push ebx
call fcn.00409cda
mov edx, dword [esp + 0x1c]
lea ebx, [esp + 0x38]
add esp, 0xc
add edx, edi
xor ecx, ecx
mov eax, dword [edx + ecx*4 - 0x14]
cmp eax, dword [ebx + ecx*4]
jne 0x407ab9
inc ecx
cmp ecx, 5
jne 0x4079fe
mov eax, dword [esi]
mov ebx, dword [esp + 0x4c]
push eax
push 0x40
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov ecx, dword [esp + 0x48]
mov dword [ecx], eax
test eax, eax
je 0x407ab9
push dword [ebx]
lea ecx, [esi + 8]
push ecx
push eax
call fcn.0049fa90
mov ebx, dword [esp + 0x5c]
add esp, 0xc
and dword [esp + 0x18], 0
push dword [esp + 0x1c]
and dword [ebx], 0
call dword [sym.imp.ADVAPI32.dll_GetLengthSid]
push eax
push 0x40
mov dword [esp + 0x18], eax
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov dword [ebx], eax
test eax, eax
je 0x407a7f
push dword [esp + 0x1c]
push eax
push dword [esp + 0x18]
call dword [sym.imp.ADVAPI32.dll_CopySid]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x407ab9
mov eax, dword [esp + 0x48]
cmp dword [eax], 0
je 0x407a92
push dword [eax]
call ebp
mov ecx, dword [esp + 0x48]
mov dword [ecx], eax
cmp dword [ebx], 0
je 0x407a9d
push dword [ebx]
call ebp
mov dword [ebx], eax
mov eax, dword [esp + 0x4c]
and dword [eax], 0
jmp 0x407ab9
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___CryptDecrypt__0x_08x__n
call fcn.00409cda
pop ecx
pop ecx
push edi
call ebp
jmp 0x407ad1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___CryptSetKeyParam__0x_08x__n
call fcn.00409cda
pop ecx
pop ecx
push dword [esp + 0x14]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov ecx, dword [esp + 0x28]
call fcn.004035a7
test eax, eax
jne 0x407b09
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___kull_m_crypto_close_hprov_delete_container__0x_08x__n
jmp 0x407b02
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ERROR_kull_m_dpapi_unprotect_domainkey_with_key___CryptDecrypt__0x_08x__n
call fcn.00409cda
pop ecx
pop ecx
push esi
call ebp
mov ebp, dword [esp + 0x18]
push dword [esp + 0x20]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
xor edi, edi
push edi
push dword [esp + 0x28]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
pop edi
pop esi
mov eax, ebp
pop ebp
pop ebx
add esp, 0x30
ret