Function at 0x4046d0
Capabilities:
Access peb ldr_data
Delete file
Get process heap flags
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
mov esi, dword fs:[0x18]
sub esp, 0xa8
mov dword [esp + 8], 0x28
mov dword [esp + 4], 0
mov eax, dword [esi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov dword [0x41a000], eax
call fcn.00401f30
call fcn.00403370
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x40000000
mov dword [esp], str.testfile.xx_
call dword [sym.imp.kernel32.dll_CreateFileA]
sub esp, 0x1c
mov ebx, eax
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1a9
xor eax, eax
cmp ebx, 0xffffffff
setne al
mov dword [esp + 4], str.Could_not_create_test_file_n
mov dword [esp], eax
call fcn.00401720
lea eax, [ebp - 0x98]
mov dword [esp], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0x24
mov dword [esp + 4], str.SZDD
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
mov edi, eax
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1ab
mov eax, dword [esi + 0x34]
mov dword [esp], edi
mov dword [esp + 8], eax
mov dword [esp + 4], str.WriteFile:_error__ld_n
call fcn.00401720
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1ac
xor eax, eax
mov dword [esp + 4], str.Wrote_wrong_number_of_bytes_with_WriteFile__n
cmp dword [ebp - 0x98], 0x24
sete al
mov dword [esp], eax
call fcn.00401720
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
lea eax, [ebp - 0x94]
sub esp, 4
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov dword [esp], str.testfile.xx_
call dword [sym.imp.lz32.dll_LZOpenFileA]
sub esp, 0xc
mov ebx, eax
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1b0
xor eax, eax
test ebx, ebx
setg al
mov dword [esp + 4], str.LZOpenFileA_failed_n
mov dword [esp], eax
call fcn.00401720
mov dword [esp + 8], 0x14
mov eax, dword [0x41a000]
mov esi, dword [sym.imp.lz32.dll_LZRead]
mov dword [esp], ebx
mov dword [esp + 4], eax
call esi
sub esp, 0xc
mov dword [ebp - 0x98], eax
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1b3
xor eax, eax
mov dword [esp + 4], str.Read_wrong_number_of_bytes_n
cmp dword [ebp - 0x98], 0x14
sete al
mov dword [esp], eax
call fcn.00401720
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1b6
mov dword [esp + 8], 0x14
mov dword [esp + 4], str.This_is_a_test_file.
mov eax, dword [0x41a000]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.buffer_contents_mismatch_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401720
mov edi, dword [0x41a050]
call fcn.00404ab0
mov ecx, dword [eax + 0x10]
mov dword [eax + 0x14], 1
lea edx, [ecx + ecx]
xor ecx, ecx
test edi, edi
setne cl
or edx, ecx
mov dword [eax + 0x10], edx
jmp 0x404975
mov dword [esp + 8], 0x14
mov eax, dword [0x41a000]
mov dword [esp], ebx
mov dword [esp + 4], eax
call esi
sub esp, 0xc
mov dword [ebp - 0x98], eax
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1bc
xor eax, eax
mov dword [esp + 4], str.Expected_read_past_EOF_to_return_LZERROR_READ_n
cmp dword [ebp - 0x98], 0xfffffffd
sete al
mov dword [esp], eax
call fcn.00401720
call fcn.00404ab0
shr dword [eax + 0x10], 1
call fcn.00404ab0
mov edx, dword [eax + 0x14]
mov dword [eax + 0x14], 0
test edx, edx
jne 0x404920
mov dword [esp], ebx
call dword [sym.imp.lz32.dll_LZClose]
sub esp, 4
mov dword [esp], str.testfile.xx_
call dword [sym.imp.kernel32.dll_DeleteFileA]
sub esp, 4
mov dword [ebp - 0x98], eax
call fcn.00404ab0
mov dword [eax], 0x408127
mov dword [eax + 4], 0x1c2
mov ebx, dword fs:[0x18]
mov eax, dword [ebx + 0x34]
mov dword [esp + 4], str.DeleteFileA:_error__ld_n
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x98]
mov dword [esp], eax
call fcn.00401720
call fcn.00401b40
mov eax, dword [0x41a000]
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_HeapFree]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret