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

Disassembly:
sub esp, 0x76c
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 + 0x784]
mov dword [0x9dd480], eax
test ebp, ebp
jne 0x6807e4
mov dword [0x9dd478], 1
mov dword [0x9dd47c], 0x1c44
call esi
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
mov eax, dword [0x9dd484]
test eax, eax
jne 0x680815
mov dword [0x9dd478], 2
mov dword [0x9dd47c], 0x1c4a
call esi
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
mov ebx, dword [esp + 0x780]
push 0
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, 0xf7
xor eax, eax
lea edi, [esp + 0x15]
mov byte [esp + 0x14], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
cmp ebx, 0xffffffff
stosb byte es:[edi], al
je 0x680899
lea eax, [esp + 0x14]
test eax, eax
je 0x680899
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 1
jne 0x6808b4
mov ecx, 0xf8
xor eax, eax
lea edi, [esp + 0x14]
push eax
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x14]
lea edx, [esp + 0x18]
push ecx
push 0x3e0
push edx
push ebx
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x6808dc
mov dword [0x9dd478], 0xd
mov dword [0x9dd47c], 0x2809
jmp 0x6808ad
mov dword [0x9dd478], 1
mov dword [0x9dd47c], 0x27fc
call esi
mov dword [0x9dd480], eax
mov dword [0x9dd478], 0xf
mov dword [0x9dd47c], 0x1c55
call esi
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
mov esi, dword [esp + 0x38]
push ebp
not esi
shr esi, 5
and esi, 1
call fcn.0068d740
add esp, 4
mov ebp, eax
test esi, esi
je 0x6808ff
test ebp, ebp
jne 0x680bda
mov ecx, 0xe1
xor eax, eax
lea edi, [esp + 0x3f5]
mov byte [esp + 0x3f4], 0
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [esp + 0x3f4]
lea ecx, [esp + 0x14]
push eax
push ecx
call fcn.006855a0
add esp, 8
test eax, eax
jne 0x68095f
mov dword [0x9dd478], 0x14
mov dword [0x9dd47c], 0x1c65
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
xor edi, edi
cmp esi, edi
jne 0x680a19
cmp ebp, edi
jne 0x680a19
mov edx, dword [esp + 0x774]
push edx
call fcn.008325b4
mov esi, eax
add esp, 4
cmp esi, edi
je 0x680a19
mov ecx, dword [esp + 0x774]
lea eax, [esp + 0x10]
push eax
push ecx
lea edx, [esp + 0x1c]
push esi
lea eax, [esp + 0x400]
push edx
push eax
push ebx
mov dword [esp + 0x28], edi
call fcn.00680160
add esp, 0x18
test eax, eax
je 0x680a07
mov ecx, dword [esp + 0x10]
cmp ecx, 0x78
jb 0x680a07
mov eax, dword [esi + 0x70]
mov ebp, dword [esi + 0x6c]
add eax, ebp
lea edx, [eax + eax*4]
mov eax, dword [esi + 0x74]
lea edx, [eax + edx*2]
lea eax, [edx + edx + 0x7a]
cmp eax, ecx
jne 0x680a07
mov ebp, dword [esp + 0x784]
push esi
push ebp
call fcn.0068d7c0
add esp, 8
test eax, eax
je 0x680a0e
push esi
call fcn.008325dd
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x76c
ret
mov ebp, dword [esp + 0x784]
push esi
call fcn.008325dd
add esp, 4
jmp 0x680a20
mov ebp, dword [esp + 0x784]
mov eax, dword [esp + 0x430]
cmp eax, edi
jne 0x680a3f
mov dword [esp + 0x76c], 0x3e0
mov dword [esp + 0x770], edi
jmp 0x680a72
mov ecx, dword [esp + 0x434]
push edi
dec eax
push ecx
push edi
push eax
call fcn.005fd650
mov ecx, dword [esp + 0x438]
xor esi, esi
add eax, ecx
adc edx, esi
add eax, 0x3e0
adc edx, edi
mov dword [esp + 0x76c], eax
mov dword [esp + 0x770], edx
mov eax, dword [esp + 0x34]
lea edx, [esp + 0x3f4]
push ebp
push edx
push eax
push ebx
call fcn.00680bf0
add esp, 0x10
test eax, eax
jne 0x680ab9
mov dword [0x9dd478], 0x10
mov dword [0x9dd47c], 0x1c93
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
push ebp
call fcn.0068d740
add esp, 4
test eax, eax
mov eax, dword [esp + 0x38]
je 0x680ace
and al, 0xdf
jmp 0x680ad0
or al, 0x20
mov dword [esp + 0x38], eax
or al, 4
push ebp
mov dword [esp + 0x3c], eax
call fcn.006a3480
add esp, 4
test eax, eax
mov eax, dword [esp + 0x38]
jne 0x680aef
or al, 1
jmp 0x680af1
and al, 0xfe
add ebp, 0x10
mov dword [esp + 0x38], eax
push ebp
call fcn.006a3480
add esp, 4
test eax, eax
mov eax, dword [esp + 0x38]
jne 0x680b0d
or al, 2
jmp 0x680b0f
and al, 0xfd
lea ecx, [esp + 0x3f4]
lea edx, [esp + 0x14]
push ecx
push edx
mov dword [esp + 0x40], eax
call fcn.00685810
add esp, 8
test eax, eax
jne 0x680b58
mov dword [0x9dd478], 0x13
mov dword [0x9dd47c], 0x1cab
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
push edi
push edi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [esp + 0x10]
push edi
push eax
lea ecx, [esp + 0x1c]
push 0x3e0
push ecx
push ebx
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x680bca
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], 0x1cb3
call esi
pop edi
pop esi
mov dword [0x9dd480], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x76c
ret
cmp dword [esp + 0x788], edi
je 0x680bda
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x76c
ret