Function at 0x406f20
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x18], 0
mov dword [ebp - 0x48], 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x20], 0
xor eax, eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x44], 0
xor ecx, ecx
mov dword [ebp - 0x40], ecx
mov dword [ebp - 0x3c], 0xc0000001
mov dword [ebp - 0x10], 0
cmp dword [ebp + 8], 0
jne 0x406f78
mov eax, 0xc000000d
jmp 0x407193
mov edx, dword [ebp + 8]
add edx, 0xc
mov dword [ebp - 0x14], edx
mov eax, dword [ebp + 8]
add eax, 4
mov dword [ebp - 4], eax
mov dword [ebp - 0x38], 0x18
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x2c], 0x240
mov ecx, dword [ebp - 4]
mov dword [ebp - 0x30], ecx
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
push 0
push 0x100
push 0
push 0
push 0
push 0
push 0x68
push 1
push 1
push 0x80
push 0
lea edx, [ebp - 0x44]
push edx
lea eax, [ebp - 0x38]
push eax
push 0x100001
lea ecx, [ebp - 0x4c]
push ecx
call dword [sym.imp.ntoskrnl.exe_IoCreateFile]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jge 0x406ff4
jmp 0x40715e
mov dword [ebp - 0x38], 0x18
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x2c], 0x240
mov edx, dword [ebp - 0x14]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
push 0
push 0x100
push 0
push 0
push 0
push 0
push 0x68
push 3
push 1
push 0x80
push 0
lea eax, [ebp - 0x44]
push eax
lea ecx, [ebp - 0x38]
push ecx
push 0x100002
lea edx, [ebp - 0x18]
push edx
call dword [sym.imp.ntoskrnl.exe_IoCreateFile]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jge 0x40705e
jmp 0x40715e
push 0x7d000
push 1
call dword [sym.imp.ntoskrnl.exe_ExAllocatePool]
mov dword [ebp - 0x48], eax
cmp dword [ebp - 0x48], 0
jne 0x407080
mov dword [ebp - 0x3c], 0xc0000017
jmp 0x40715e
mov eax, 1
test eax, eax
je 0x407156
mov dword [ebp - 8], 0x7d000
push 0
lea ecx, [ebp - 0x20]
push ecx
mov edx, dword [ebp - 8]
push edx
mov eax, dword [ebp - 0x48]
push eax
lea ecx, [ebp - 0x44]
push ecx
push 0
push 0
push 0
mov edx, dword [ebp - 0x4c]
push edx
call dword [sym.imp.ntoskrnl.exe_ZwReadFile]
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jge 0x4070d4
cmp dword [ebp - 0x3c], 0xc0000011
jne 0x4070d4
mov dword [ebp - 0x3c], 0
jmp 0x40715e
mov eax, dword [ebp - 0x40]
mov dword [ebp - 8], eax
mov ecx, dword [ebp - 0x48]
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], 0
jmp 0x4070f2
mov edx, dword [ebp - 0xc]
add edx, 1
mov dword [ebp - 0xc], edx
mov eax, dword [ebp - 0xc]
cmp eax, dword [ebp - 8]
jae 0x407112
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0xc]
movsx edx, byte [ecx]
mov eax, dword [ebp + 8]
xor edx, dword [eax]
mov ecx, dword [ebp - 0x10]
add ecx, dword [ebp - 0xc]
mov byte [ecx], dl
jmp 0x4070e9
push 0
lea edx, [ebp - 0x20]
push edx
mov eax, dword [ebp - 8]
push eax
mov ecx, dword [ebp - 0x48]
push ecx
lea edx, [ebp - 0x44]
push edx
push 0
push 0
push 0
mov eax, dword [ebp - 0x18]
push eax
call sub.ntoskrnl.exe_NtWriteFile
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
jge 0x40713e
jmp 0x40715e
mov ecx, dword [ebp - 8]
xor edx, edx
add ecx, dword [ebp - 0x20]
mov eax, dword [ebp - 0x1c]
adc eax, edx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], eax
jmp 0x407080
xor ecx, ecx
jne 0x406f8a
cmp dword [ebp - 0x4c], 0
je 0x40716e
mov edx, dword [ebp - 0x4c]
push edx
call dword [sym.imp.ntoskrnl.exe_ZwClose]
cmp dword [ebp - 0x18], 0
je 0x40717e
mov eax, dword [ebp - 0x18]
push eax
call dword [sym.imp.ntoskrnl.exe_ZwClose]
cmp dword [ebp - 0x48], 0
je 0x407190
push 0
mov ecx, dword [ebp - 0x48]
push ecx
call dword [sym.imp.ntoskrnl.exe_ExFreePoolWithTag]
mov eax, dword [ebp - 0x3c]
mov esp, ebp
pop ebp
ret 4