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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff88
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00405738
xor eax, eax
push ebp
push 0x666e55
push dword fs:[eax]
mov dword fs:[eax], esp
mov dword [ebp - 0x10], 1
mov byte [ebp - 0x29], 0
mov dword [ebp - 0x28], 1
push 0
push 0x40000000
push 3
push 0
push 3
push 0xc0000000
mov eax, dword [ebp - 4]
call fcn.00405748
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0xffffffff
je 0x666bc4
push 0
lea eax, [ebp - 0x1c]
push eax
push 5
lea eax, [ebp - 0x49]
push eax
push 0x10
push 0x7d4bb0
push 0x8000e004
mov eax, dword [ebp - 0x44]
push eax
call sub.kernel32.dll_DeviceIoControl
test eax, eax
je 0x666bbb
cmp dword [ebp - 0x1c], 5
jne 0x666bb2
lea eax, [ebp - 0x49]
cmp dword [eax], 0
je 0x666ba9
mov byte [ebp - 0x29], 1
jmp 0x666bdf
mov dword [ebp - 0x10], 8
jmp 0x666bcb
mov dword [ebp - 0x10], 7
jmp 0x666bcb
mov dword [ebp - 0x10], 6
jmp 0x666bcb
mov dword [ebp - 0x10], 2
push 0x64
call sub.kernel32.dll_Sleep_1
inc dword [ebp - 0x28]
cmp dword [ebp - 0x28], 6
jne 0x666b47
cmp byte [ebp - 0x29], 0
je 0x666e3f
lea eax, [ebp - 0x49]
mov eax, dword [eax]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x18]
push eax
push 0x40
call sub.kernel32.dll_LocalAlloc_2
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0
je 0x666e2f
push 0
push 0
push 0
push 0
call sub.kernel32.dll_CreateEventA
mov dword [ebp - 0x3c], eax
cmp dword [ebp - 0x3c], 0
je 0x666e1d
xor eax, eax
mov dword [ebp - 0x64], eax
xor eax, eax
mov dword [ebp - 0x60], eax
xor eax, eax
mov dword [ebp - 0x5c], eax
xor eax, eax
mov dword [ebp - 0x58], eax
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x54], eax
lea eax, [ebp - 0x64]
push eax
push 0
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x30]
push eax
mov eax, dword [ebp - 0x44]
push eax
call sub.kernel32.dll_ReadFile_2
test eax, eax
je 0x666c5e
mov byte [ebp - 0x29], 1
jmp 0x666c6c
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
sete byte [ebp - 0x29]
cmp byte [ebp - 0x29], 0
je 0x666e0b
push 0
push 0
push 0
push 0
call sub.kernel32.dll_CreateEventA
mov dword [ebp - 0x40], eax
cmp dword [ebp - 0x40], 0
je 0x666e02
xor eax, eax
mov dword [ebp - 0x78], eax
xor eax, eax
mov dword [ebp - 0x74], eax
xor eax, eax
mov dword [ebp - 0x70], eax
xor eax, eax
mov dword [ebp - 0x6c], eax
mov eax, dword [ebp - 0x40]
mov dword [ebp - 0x68], eax
lea eax, [ebp - 0x78]
push eax
push 0
mov eax, dword [ebp - 0xc]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0x44]
push eax
call sub.kernel32.dll_WriteFile_2
test eax, eax
je 0x666ccb
mov byte [ebp - 0x29], 1
jmp 0x666ce6
call sub.kernel32.dll_GetLastError_1
cmp eax, 0x3e5
sete byte [ebp - 0x29]
cmp byte [ebp - 0x29], 0
je 0x666ce6
push 5
call sub.kernel32.dll_Sleep_1
cmp byte [ebp - 0x29], 0
je 0x666df0
push 0x64
mov eax, dword [ebp - 0x68]
push eax
call sub.kernel32.dll_WaitForSingleObject
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x666d11
cmp dword [ebp - 0x14], 0x80
jne 0x666de7
push 1
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x78]
push eax
mov eax, dword [ebp - 0x44]
push eax
call sub.kernel32.dll_GetOverlappedResult
test eax, eax
je 0x666dde
mov eax, dword [ebp - 0x24]
cmp eax, dword [ebp - 0xc]
jne 0x666dd5
push 0x64
mov eax, dword [ebp - 0x54]
push eax
call sub.kernel32.dll_WaitForSingleObject
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x666d55
cmp dword [ebp - 0x14], 0x80
jne 0x666dcc
push 1
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x64]
push eax
mov eax, dword [ebp - 0x44]
push eax
call sub.kernel32.dll_GetOverlappedResult
test eax, eax
je 0x666dc3
cmp dword [ebp - 0x20], 0
je 0x666dba
mov eax, dword [ebp - 0x20]
cmp eax, dword [ebp + 8]
ja 0x666dba
mov eax, dword [ebp - 0x30]
mov dword [ebp - 0x34], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x38], eax
mov eax, dword [ebp - 0x20]
dec eax
test eax, eax
jb 0x666db3
inc eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0x34]
mov edx, dword [ebp - 0x14]
mov al, byte [eax + edx]
mov edx, dword [ebp - 0x38]
mov ecx, dword [ebp - 0x14]
mov byte [edx + ecx], al
inc dword [ebp - 0x14]
dec dword [ebp - 0x50]
jne 0x666d99
xor eax, eax
mov dword [ebp - 0x10], eax
jmp 0x666df7
mov dword [ebp - 0x10], 0xf
jmp 0x666df7
mov dword [ebp - 0x10], 0xd
jmp 0x666df7
mov dword [ebp - 0x10], 0xb
jmp 0x666df7
mov dword [ebp - 0x10], 0x10
jmp 0x666df7
mov dword [ebp - 0x10], 0xe
jmp 0x666df7
mov dword [ebp - 0x10], 0xc
jmp 0x666df7
mov dword [ebp - 0x10], 4
mov eax, dword [ebp - 0x40]
push eax
call sub.kernel32.dll_CloseHandle_1
jmp 0x666e12
mov dword [ebp - 0x10], 0xa
jmp 0x666e12
mov dword [ebp - 0x10], 9
mov eax, dword [ebp - 0x3c]
push eax
call sub.kernel32.dll_CloseHandle_1
jmp 0x666e24
mov dword [ebp - 0x10], 3
mov eax, dword [ebp - 0x30]
push eax
call sub.kernel32.dll_LocalFree_1
jmp 0x666e36
mov dword [ebp - 0x10], 5
mov eax, dword [ebp - 0x44]
push eax
call sub.kernel32.dll_CloseHandle_1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x666e5c
lea eax, [ebp - 4]
call fcn.00405278
ret