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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x248
mov eax, dword [0x1010f16c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
mov dword [ebp - 0x234], 0
push esi
xor ecx, ecx
mov dword [ebp - 0x248], ebx
push edi
xor edi, edi
mov dword [ebp - 0x220], ecx
xor esi, esi
mov dword [ebp - 0x218], edi
xor edx, edx
mov dword [ebp - 0x244], ecx
mov dword [ebp - 0x228], esi
mov dword [ebp - 0x224], edx
cmp dword [ebx + 8], ecx
je 0x1005a6b0
cmp byte [ebx + 0x14], cl
jne 0x1005a5d3
mov dword [ebp - 0x21c], ecx
cmp ecx, 0x10
jge 0x1005a2a8
nop
test esi, esi
je 0x1005a16e
mov eax, dword [esi]
dec edx
mov dword [ebp - 0x228], eax
lea eax, [esi + 0x84]
mov dword [ebp - 0x224], edx
mov dword [esi + 0x20], eax
jmp 0x1005a17d
call fcn.100566d0
mov esi, eax
test esi, esi
je 0x1005a296
push esi
push 0
xorps xmm0, xmm0
movups xmmword [esi], xmm0
mov dword [esi + 0x10], 0
push 0x76c
push dword [esi + 0x20]
mov byte [esi + 0x24], 0
push dword [ebx + 0x28]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x1005a26d
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp edi, 0x3e5
je 0x1005a26d
push esi
push 0x10115c70
call dword [sym.imp.KERNEL32.dll_InterlockedPushEntrySList]
push edi
push str.TunWin32:_ReadFile_failed_0x_X
call fcn.10056110
add esp, 8
cmp edi, 0x3e3
je 0x1005a1e9
cmp edi, 2
jne 0x1005a273
push edi
push str.TAP_driver_stopped_communicating._Attempting_to_restart.
call fcn.10056110
mov edi, dword [ebx + 0x24]
push 0x18
call fcn.10090929
add esp, 0xc
lea ecx, [edi + 0xc]
mov edx, edi
mov esi, eax
neg edx
lea eax, [edi + 0x25a0]
sbb edx, edx
and edx, ecx
mov dword [esi], 0
push eax
mov dword [esi + 0x14], edx
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov eax, dword [edi + 0x2594]
inc dword [edi + 0x2598]
mov dword [eax], esi
lea eax, [edi + 0x25a0]
cmp dword [edi + 0x259c], 0
mov dword [edi + 0x2594], esi
push eax
je 0x1005a5be
mov dword [edi + 0x259c], 0
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
push dword [edi + 0x25a4]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x1005a5d3
inc dword [ebp - 0x220]
mov eax, dword [ebp - 0x21c]
inc eax
mov dword [ebp - 0x21c], eax
cmp eax, 0x10
jge 0x1005a296
mov esi, dword [ebp - 0x228]
mov edx, dword [ebp - 0x224]
jmp 0x1005a150
mov esi, dword [ebp - 0x228]
mov edi, dword [ebp - 0x218]
mov edx, dword [ebp - 0x224]
cmp edx, 0x20
jl 0x1005a2d9
push edx
push dword [ebp - 0x22c]
mov edx, esi
mov ecx, 0x10115c70
call dword [sym.imp.KERNEL32.dll_InterlockedPushListSList]
lea esi, [ebp - 0x228]
mov dword [ebp - 0x224], 0
mov dword [ebp - 0x22c], esi
jmp 0x1005a2ee
test esi, esi
lea eax, [ebp - 0x228]
cmovne eax, dword [ebp - 0x22c]
mov dword [ebp - 0x22c], eax
push 0
push 0xffffffffffffffff
lea eax, [ebp - 0x23c]
mov dword [ebp - 0x23c], 0
push eax
push 0x21
lea eax, [ebp - 0x214]
push eax
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_GetQueuedCompletionStatusEx]
test eax, eax
je 0x1005a5c6
xor ecx, ecx
mov dword [ebp - 0x238], 0
lea edx, [ebp - 0x244]
mov dword [ebp - 0x21c], ecx
mov dword [ebp - 0x230], edx
cmp dword [ebp - 0x23c], ecx
jbe 0x1005a421
lea esi, [ebp - 0x210]
mov dword [ebp - 0x218], esi
mov esi, dword [esi]
test esi, esi
je 0x1005a3f9
cmp byte [esi + 0x24], 0
mov eax, dword [esi]
jne 0x1005a3b8
dec dword [ebp - 0x220]
test eax, eax
je 0x1005a397
push eax
push str.TunWin32::ReadComplete_error_0x_X
call fcn.10056110
add esp, 8
push esi
push 0x10115c70
call dword [sym.imp.KERNEL32.dll_InterlockedPushEntrySList]
mov ecx, dword [ebp - 0x21c]
mov edx, dword [ebp - 0x230]
jmp 0x1005a3f9
mov eax, dword [esi + 4]
mov dword [esi + 0x1c], eax
mov eax, dword [ebx + 4]
add eax, 0x24
inc dword [ebp - 0x238]
mov dword [esi + 0x14], eax
mov dword [edx], esi
mov edx, esi
mov dword [ebp - 0x230], edx
jmp 0x1005a3f9
dec edi
test eax, eax
je 0x1005a3e5
push eax
push str.TunWin32::WriteComplete_error_0x_X
call fcn.10056110
add esp, 8
push esi
push 0x10115c70
call dword [sym.imp.KERNEL32.dll_InterlockedPushEntrySList]
mov ecx, dword [ebp - 0x21c]
mov edx, dword [ebp - 0x230]
jmp 0x1005a3f9
mov eax, dword [ebp - 0x22c]
inc dword [ebp - 0x224]
mov dword [ebp - 0x22c], esi
mov dword [eax], esi
mov esi, dword [ebp - 0x218]
inc ecx
add esi, 0x10
mov dword [ebp - 0x21c], ecx
mov dword [ebp - 0x218], esi
cmp ecx, dword [ebp - 0x23c]
jb 0x1005a353
mov dword [ebp - 0x218], edi
mov eax, dword [ebp - 0x22c]
mov dword [edx], 0
mov dword [eax], 0
mov eax, dword [ebp - 0x244]
mov dword [ebp - 0x21c], eax
test eax, eax
je 0x1005a4d7
mov esi, dword [ebx + 4]
lea eax, [esi + 0x10]
push eax
mov dword [ebp - 0x240], eax
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov eax, dword [esi + 8]
cmp eax, 0x19000
jb 0x1005a492
mov eax, dword [ebp - 0x240]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, dword [ebp - 0x238]
mov eax, dword [ebp - 0x230]
mov edx, dword [ebp - 0x21c]
push ecx
push eax
mov ecx, 0x10115c70
call dword [sym.imp.KERNEL32.dll_InterlockedPushListSList]
jmp 0x1005a4d7
add eax, dword [ebp - 0x238]
mov ecx, dword [ebp - 0x21c]
mov dword [esi + 8], eax
mov eax, dword [esi + 4]
mov dword [eax], ecx
cmp dword [esi + 0xc], 0
mov eax, dword [ebp - 0x230]
mov dword [esi + 4], eax
lea eax, [esi + 0x10]
push eax
je 0x1005a4d1
mov dword [esi + 0xc], 0
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
push dword [esi + 0x14]
call dword [sym.imp.KERNEL32.dll_SetEvent]
jmp 0x1005a4d7
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
cmp edi, 0x10
jge 0x1005a5a1
mov eax, dword [ebp - 0x234]
test eax, eax
jne 0x1005a52f
cmp dword [ebx + 0x1c], eax
lea edi, [ebx + 0x1c]
je 0x1005a59b
lea esi, [ebx + 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_AcquireSRWLockExclusive]
mov eax, dword [edi]
push esi
mov dword [ebp - 0x234], eax
mov dword [ebx + 0x20], edi
mov dword [edi], 0
mov dword [ebx + 0x18], 0
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov eax, dword [ebp - 0x234]
mov edi, dword [ebp - 0x218]
test eax, eax
je 0x1005a5a1
mov esi, eax
xorps xmm0, xmm0
mov eax, dword [eax]
push esi
push 0
movups xmmword [esi], xmm0
mov dword [esi + 0x10], 0
push dword [esi + 0x1c]
mov byte [esi + 0x24], 1
push dword [esi + 0x20]
mov dword [ebp - 0x234], eax
push dword [ebx + 0x28]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1005a589
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x1005a589
push eax
push str.TunWin32:_WriteFile_failed_0x_X
call fcn.10056110
add esp, 8
push esi
push 0x10115c70
call dword [sym.imp.KERNEL32.dll_InterlockedPushEntrySList]
jmp 0x1005a590
inc edi
mov dword [ebp - 0x218], edi
cmp edi, 0x10
jl 0x1005a4e0
jmp 0x1005a5a1
mov edi, dword [ebp - 0x218]
cmp byte [ebx + 0x14], 0
jne 0x1005a5d3
mov esi, dword [ebp - 0x228]
mov ecx, dword [ebp - 0x220]
mov edx, dword [ebp - 0x224]
jmp 0x1005a140
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x1005a5d3
push str.GetQueuedCompletionStatusEx_failed.
call fcn.100561a0
add esp, 4
push dword [ebx + 0x28]
call dword [sym.imp.KERNEL32.dll_CancelIo]
mov esi, dword [ebp - 0x218]
mov ecx, dword [ebp - 0x220]
lea eax, [esi + ecx]
test eax, eax
je 0x1005a671
push 0
push 0xffffffffffffffff
lea eax, [ebp - 0x240]
mov dword [ebp - 0x240], 0
push eax
push 1
lea eax, [ebp - 0x214]
mov edi, ecx
push eax
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_GetQueuedCompletionStatusEx]
test eax, eax
je 0x1005a664
mov eax, dword [ebp - 0x210]
test eax, eax
je 0x1005a655
mov bl, byte [eax + 0x24]
push eax
push 0x10115c70
call dword [sym.imp.KERNEL32.dll_InterlockedPushEntrySList]
test bl, bl
lea ecx, [edi - 1]
mov ebx, dword [ebp - 0x248]
lea eax, [esi - 1]
cmovne ecx, edi
cmovne esi, eax
mov dword [ebp - 0x220], ecx
jmp 0x1005a65b
mov ecx, dword [ebp - 0x220]
lea eax, [esi + ecx]
test eax, eax
jne 0x1005a5f3
jmp 0x1005a671
push str.GetQueuedCompletionStatusEx_failed.
call fcn.100561a0
add esp, 4
mov eax, dword [ebp - 0x228]
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedPushEntrySList]
test eax, eax
je 0x1005a691
mov esi, dword [eax]
push eax
push 0x10115c70
call ebx
mov eax, esi
test esi, esi
jne 0x1005a681
mov eax, dword [ebp - 0x234]
test eax, eax
je 0x1005a6b0
nop dword [eax + eax]
mov esi, dword [eax]
push eax
push 0x10115c70
call ebx
mov eax, esi
test esi, esi
jne 0x1005a6a0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100908e7
mov esp, ebp
pop ebp
ret