Function at 0x402808
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 0x402866
mov dword [esp], str.Failed_to_open_file_for_reading.
call sym._LogToFile
jmp 0x402a76
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 0x4028a4
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 0x402a76
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4028d7
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 0x402a76
mov dword [ebp - 0x18], 0
mov dword [esp + 0x10], 0
lea eax, [ebp - 0x18]
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 0x402937
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 0x402a76
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._CloseHandle_4
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
lea eax, [ebp - 0x1c]
mov dword [esp + 0x14], eax
mov eax, dword [ebp - 0x14]
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._CryptDecrypt_24
sub esp, 0x18
test eax, eax
jne 0x40299f
mov dword [esp], str.Failed_to_decrypt_file.
call sym._LogToFile
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._free
jmp 0x402a76
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 0x4029ff
mov dword [esp], str.Failed_to_open_file_for_writing.
call sym._LogToFile
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._free
jmp 0x402a76
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
lea edx, [ebp - 0x20]
mov dword [esp + 0xc], edx
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._WriteFile_20
sub esp, 0x14
test eax, eax
jne 0x402a43
mov dword [esp], str.Failed_to_write_decrypted_data_to_file.
call sym._LogToFile
jmp 0x402a4f
mov dword [esp], str.File_decrypted_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 - 0x14]
mov dword [esp], eax
call sym._free
leave
ret