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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
mov eax, 0x22b4
call fcn.0100e330
mov eax, dword [0x101348c]
push ebx
mov ebx, dword [ebp + 0xc]
push 3
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push 0xc0000000
push eax
mov dword [ebp - 0x22b0], 1
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call fcn.0100c756
cmp eax, 0xffffffff
mov dword [ebp - 0x22a8], eax
jne 0x1008553
xor eax, eax
jmp 0x10087d8
push esi
push edi
push 0x10015b4
lea eax, [ebp - 0x22a2]
push eax
mov word [ebp - 0x22a4], 0xfeff
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
mov ecx, dword [ebp + 0x10]
mov eax, dword [ebp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
xor edi, edi
push edi
add eax, ecx
push edi
push eax
push dword [ebp - 0x22a8]
mov dword [ebp - 0x22b4], eax
call esi
push edi
lea eax, [ebp - 0x22ac]
push eax
push 0xa0
lea eax, [ebp - 0xa4]
push eax
push dword [ebp - 0x22a8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x22ac], edi
je 0x10085c3
cmp word [ebp - 0xa4], 0x5b
je 0x10085c9
mov dword [ebp - 0x22b0], edi
push edi
push edi
push dword [ebp + 0x10]
push dword [ebp - 0x22a8]
call esi
cmp eax, dword [ebp + 0x10]
jne 0x10085f2
lea eax, [ebx + 0x104]
push eax
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call fcn.0100cb77
test eax, eax
jne 0x1008605
push dword [ebp - 0x22a8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x10087d6
push 0x7f02
push edi
call dword [sym.imp.USER32.dll_LoadCursorW]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
mov edi, dword [sym.imp.USER32.dll_wsprintfW]
push ebx
lea eax, [ebp - 0x2a4]
push 0x10015a0
push eax
call edi
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatW]
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
lea eax, [ebp - 0x22a4]
push eax
call esi
movzx eax, word [ebx + 0x100]
push eax
lea eax, [ebp - 0x2a4]
push 0x1001584
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
lea eax, [ebp - 0x22a4]
push eax
call esi
movzx eax, byte [ebx + 0x164]
push eax
lea eax, [ebp - 0x2a4]
push 0x1001564
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
lea eax, [ebp - 0x22a4]
push eax
call esi
lea eax, [ebx + 0x104]
push eax
push 0x30
lea eax, [ebp - 0xa4]
push eax
call fcn.0100b7db
and word [ebp - 0x44], 0
lea eax, [ebx + 0x104]
push eax
lea eax, [ebp - 0x2a4]
push 0x1001544
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
lea eax, [ebp - 0x22a4]
push eax
call esi
lea eax, [ebx + 0x166]
cmp word [eax], 0
jne 0x10086eb
mov word [eax], 0x3f
movzx eax, word [eax]
push eax
lea eax, [ebp - 0x2a4]
push 0x1001528
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
lea eax, [ebp - 0x22a4]
push eax
call esi
movzx eax, word [ebx + 0x168]
push eax
lea eax, [ebp - 0x2a4]
push 0x100150c
push eax
call edi
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
lea eax, [ebp - 0x22a4]
push eax
call esi
xor edi, edi
cmp dword [ebp - 0x22b0], edi
jne 0x1008751
push 0x10014f8
lea eax, [ebp - 0x22a4]
push eax
call esi
lea eax, [ebp - 0x22a4]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
mov eax, dword [ebp + 0x14]
shl esi, 1
cmp esi, eax
jbe 0x1008772
mov ecx, esi
push 1
sub ecx, eax
push ecx
jmp 0x1008776
push edi
sub eax, esi
push eax
push dword [ebp - 0x22b4]
push dword [ebp - 0x22a8]
call fcn.0100bea0
push edi
push edi
push dword [ebp + 0x10]
push dword [ebp - 0x22a8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
lea eax, [ebp - 0x22ac]
push eax
push esi
lea eax, [ebp - 0x22a4]
push eax
push dword [ebp - 0x22a8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x22a8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x7f00
push edi
call dword [sym.imp.USER32.dll_LoadCursorW]
push eax
call dword [sym.imp.USER32.dll_SetCursor]
xor eax, eax
inc eax
pop edi
pop esi
mov ecx, dword [ebp - 4]
pop ebx
call fcn.0100dd00
leave
ret 0x10