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

Disassembly:
sub esp, 0x74c
mov dword [0x9dd478], 0
push ebx
push ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
call esi
mov ebp, dword [esp + 0x764]
mov dword [0x9dd480], eax
test ebp, ebp
jne 0x681dd4
mov dword [0x9dd478], 1
mov dword [0x9dd47c], 0x1ef2
call esi
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x74c
ret
mov eax, dword [0x9dd484]
test eax, eax
jne 0x681e05
mov dword [0x9dd478], 2
mov dword [0x9dd47c], 0x1ef8
call esi
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x74c
ret
mov edx, dword [esp + 0x768]
mov esi, dword [esp + 0x760]
mov eax, dword [esp + 0x76c]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [esp + 0x10]
push 0
push ecx
push edx
push esi
mov dword [esp + 0x20], eax
call ebx
mov ecx, 0xf3
xor eax, eax
lea edi, [esp + 0x38d]
mov byte [esp + 0x38c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
cmp esi, 0xffffffff
stosb byte es:[edi], al
je 0x681eae
lea eax, [esp + 0x38c]
test eax, eax
je 0x681eae
push esi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x681ecd
mov ecx, 0xf4
xor eax, eax
lea edi, [esp + 0x38c]
push eax
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x18]
lea edx, [esp + 0x390]
push ecx
push 0x3d0
push edx
push esi
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x681ef9
mov dword [0x9dd478], 0xd
mov dword [0x9dd47c], 0x2809
jmp 0x681ec2
mov dword [0x9dd478], 1
mov dword [0x9dd47c], 0x27fc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x9dd480], eax
mov dword [0x9dd478], 0xf
mov dword [0x9dd47c], 0x1f04
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x74c
ret
mov ecx, 0xdb
xor eax, eax
lea edi, [esp + 0x1d]
mov byte [esp + 0x1c], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x38c]
push eax
push ecx
call fcn.00684ce0
add esp, 8
test eax, eax
jne 0x681f53
mov dword [0x9dd478], 0x14
mov dword [0x9dd47c], 0x1f0c
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x74c
ret
mov edx, dword [esp + 0x378]
mov eax, dword [esp + 0x76c]
mov edi, dword [esp + 0x374]
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x768]
lea ecx, [esp + 0x10]
push 0
push ecx
push edx
push esi
mov dword [esp + 0x20], eax
call ebx
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x10]
push 1
push ecx
push edi
push esi
mov dword [esp + 0x20], eax
call ebx
mov eax, dword [ebp + 0x68]
mov edx, eax
shl edx, 4
add edx, eax
mov eax, dword [ebp + 0x64]
lea ecx, [eax + edx*8]
mov edx, dword [ebp + 0x6c]
lea eax, [edx + ecx*2 + 0x82]
mov edx, dword [esp + 0x3ac]
push eax
lea ecx, [esp + 0x378]
push ebp
push ecx
push edx
push esi
call fcn.00684580
add esp, 0x14
test eax, eax
jne 0x681ffa
mov dword [0x9dd478], 0x10
mov dword [0x9dd47c], 0x1f1b
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x74c
ret
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x1c]
lea edx, [esp + 0x38c]
push ecx
push edx
mov dword [esp + 0x37c], edi
mov dword [esp + 0x380], eax
call fcn.00684b90
add esp, 8
test eax, eax
jne 0x682051
mov dword [0x9dd478], 0x13
mov dword [0x9dd47c], 0x1f24
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x74c
ret
mov edx, dword [esp + 0x768]
mov eax, dword [esp + 0x76c]
lea ecx, [esp + 0x10]
push 0
push ecx
push edx
push esi
mov dword [esp + 0x20], eax
call ebx
lea eax, [esp + 0x14]
push 0
push eax
lea ecx, [esp + 0x394]
push 0x3d0
push ecx
push esi
mov dword [esp + 0x28], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x6820de
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x9dd478], 0xe
mov dword [0x9dd47c], 0x281b
call esi
mov dword [0x9dd480], eax
mov dword [0x9dd478], 0x10
mov dword [0x9dd47c], 0x1f2d
call esi
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x74c
ret
mov eax, dword [esp + 0x770]
test eax, eax
je 0x6820f0
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x74c
ret