Function at 0x4089c0
Capabilities:
Access peb ldr_data
Create new key via cryptacquirecontext
Encrypt or decrypt via wincrypt
Get process heap flags

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea eax, [ebp - 0x120]
push ebx
mov esi, dword fs:[0x18]
sub esp, 0x138
mov edi, dword [sym.imp.advapi32.dll_CryptAcquireContextA]
mov dword [esp + 0x10], 0x10
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], str.winetest
mov dword [esp], eax
mov dword [ebp - 0x124], edi
call edi
lea eax, [ebp - 0x120]
sub esp, 0x14
mov dword [esp + 0x10], 8
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], str.winetest
mov dword [esp], eax
call edi
lea edi, [ebp - 0x118]
sub esp, 0x14
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc22
mov eax, dword [esi + 0x34]
mov dword [esp], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptAcquireContextA_failed:__08lx_n
call fcn.00401ac0
lea eax, [ebp - 0x11c]
mov dword [esp + 8], 1
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0xa400
mov eax, dword [ebp - 0x120]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptGenKey]
sub esp, 0x10
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc24
mov eax, dword [esi + 0x34]
mov dword [esp], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptGenKey_with_CALG_RSA_KEYX_failed_with_error__08lx_n
call fcn.00401ac0
mov dword [esp + 8], edi
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x120]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptGetUserKey]
sub esp, 0xc
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc26
mov eax, dword [esi + 0x34]
mov dword [esp], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptGetUserKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [str.Well_this_is_a_fine_how_do_you_do.]
mov dword [ebp - 0x114], 0x23
mov dword [ebp - 0x10c], eax
mov eax, dword [0x418804]
mov dword [ebp - 0x108], eax
mov eax, dword [0x418808]
mov dword [ebp - 0x104], eax
mov eax, dword [0x41880c]
mov dword [ebp - 0x100], eax
mov eax, dword [0x418810]
mov dword [ebp - 0xfc], eax
mov eax, dword [0x418814]
mov dword [ebp - 0xf8], eax
mov eax, dword [0x418818]
mov dword [ebp - 0xf4], eax
mov eax, dword [0x41881c]
mov dword [ebp - 0xf0], eax
mov eax, dword [0x41881f]
mov dword [ebp - 0xed], eax
lea eax, [ebp - 0x114]
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x10c]
mov dword [esp + 0x18], 0x100
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x118]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptEncrypt]
sub esp, 0x1c
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc2c
mov eax, dword [esi + 0x34]
test ebx, ebx
jne 0x408f08
mov ecx, dword [0x42b050]
test ecx, ecx
je 0x408f78
mov dword [esp + 8], eax
mov dword [esp], ebx
mov dword [esp + 4], str.CryptEncrypt_failed:__08lx_n
mov ebx, dword fs:[0x18]
call fcn.00401ac0
lea ecx, [ebp - 0x110]
mov dword [esp + 0x10], 0
mov esi, dword [sym.imp.advapi32.dll_CryptExportKey]
mov dword [esp + 0x14], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x118]
mov dword [esp], eax
call esi
sub esp, 0x18
mov dword [ebp - 0x128], eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc32
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x128]
mov dword [esp], edx
call fcn.00401ac0
mov eax, dword [ebp - 0x110]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
lea ecx, [ebp - 0x110]
sub esp, 0xc
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], eax
mov dword [ebp - 0x128], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x118]
mov dword [esp], eax
call esi
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc36
mov eax, dword [ebx + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x118]
mov esi, dword [sym.imp.advapi32.dll_CryptDestroyKey]
mov dword [esp], eax
call esi
mov eax, dword [ebp - 0x11c]
sub esp, 4
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov eax, dword [ebp - 0x110]
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x128]
mov dword [esp + 4], edx
mov eax, dword [ebp - 0x120]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptImportKey]
sub esp, 0x18
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc3c
mov eax, dword [ebx + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptImportKey_failed:__08lx_n
call fcn.00401ac0
mov edx, dword [ebp - 0x128]
mov dword [esp + 4], 0
mov dword [esp + 8], edx
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
lea eax, [ebp - 0x114]
sub esp, 0xc
mov dword [esp + 0x14], eax
lea eax, [ebp - 0x10c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x118]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptDecrypt]
sub esp, 0x18
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc42
mov eax, dword [ebx + 0x34]
test edi, edi
je 0x408f18
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptDecrypt_failed:__08lx_n
mov dword [esp], 1
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc47
mov eax, dword [ebp - 0x114]
mov dword [esp + 4], str.unexpected_size__ld_n
cmp eax, 0x23
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xc48
lea eax, [ebp - 0x10c]
mov dword [esp + 8], 0x23
mov dword [esp + 4], str.Well_this_is_a_fine_how_do_you_do.
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.unexpected_value_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
mov eax, dword [ebp - 0x118]
mov dword [esp], eax
call esi
sub esp, 4
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x120]
mov dword [esp], eax
call dword [sym.imp.advapi32.dll_CryptReleaseContext]
lea eax, [ebp - 0x120]
sub esp, 8
mov dword [esp + 0x10], 0x10
mov dword [esp + 0xc], 1
mov dword [esp + 8], 0
mov dword [esp + 4], str.winetest
mov dword [esp], eax
mov eax, dword [ebp - 0x124]
call eax
sub esp, 0x14
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ebx, 1
jmp 0x408bec
mov edx, dword [0x42b050]
test edx, edx
jne 0x408f58
cmp eax, 0x80090003
je 0x408fa0
cmp dword [ebx + 0x34], 0x80090010
jne 0x408f58
mov dword [esp + 8], 0x80090010
mov dword [esp + 4], str.CryptDecrypt_failed:__08lx_n
mov dword [esp], 1
call fcn.00401ac0
jmp 0x408ea0
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptDecrypt_failed:__08lx_n
mov dword [esp], 0
call fcn.00401ac0
jmp 0x408ea0
mov ebx, 1
cmp eax, 0x80090003
je 0x408bec
xor ebx, ebx
cmp eax, 0x80090010
sete bl
jmp 0x408bec
mov dword [esp + 8], 0x80090003
mov dword [esp + 4], str.CryptDecrypt_failed:__08lx_n
mov dword [esp], 1
call fcn.00401ac0
jmp 0x408ea0