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

Disassembly:
sub esp, 0x10
push ebx
mov ebx, dword [esp + 0x18]
mov eax, ebx
push esi
test ebx, ebx
push edi
mov dword [esp + 0xc], eax
jl 0x10009fdf
push ebp
push 0x400
call fcn.10039ff8
mov esi, dword [esp + 0x2c]
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, eax
add esp, 4
test ebp, ebp
je 0x10009fcc
mov eax, dword [esp + 0x2c]
test eax, eax
jle 0x10009ef5
push 2
push 0
push 0
push esi
call edi
mov edx, dword [esp + 0x2c]
mov ecx, 0xfffffc00
mov ebx, eax
sub ecx, edx
mov dword [esp + 0x1c], ecx
lea eax, [ebx + edx]
jmp 0x10009dfd
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x1c]
lea edx, [ecx + eax]
mov ecx, dword [esp + 0x24]
cmp edx, ecx
jle 0x10009e8c
sub ebx, 0x400
push 0
push 0
sub eax, 0x400
push ebx
push esi
mov dword [esp + 0x38], eax
call edi
lea eax, [esp + 0x14]
push 0
push eax
push 0x400
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10009ee8
cmp dword [esp + 0x14], 0x400
jne 0x10009ee8
mov ecx, dword [esp + 0x28]
push 0
push 0
push ecx
push esi
call edi
lea edx, [esp + 0x18]
push 0
push edx
push 0x400
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10009e7f
cmp dword [esp + 0x18], 0x400
je 0x10009df5
mov dword [esp + 0x10], 0xffffffff
jmp 0x10009fc3
cmp ebx, ecx
jle 0x10009fc3
push 0
push 0
push ecx
push esi
sub ebx, ecx
call edi
lea eax, [esp + 0x14]
push 0
push eax
push ebx
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x10009ee8
cmp dword [esp + 0x14], ebx
jne 0x10009ee8
mov ecx, dword [esp + 0x24]
mov edx, dword [esp + 0x2c]
push 0
add ecx, edx
push 0
push ecx
push esi
call edi
lea eax, [esp + 0x18]
push 0
push eax
push ebx
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10009ee8
cmp dword [esp + 0x18], ebx
je 0x10009fc3
mov dword [esp + 0x10], 0xffffffff
jmp 0x10009fc3
jge 0x10009fc3
neg eax
mov dword [esp + 0x24], ebx
mov dword [esp + 0x28], eax
add ebx, eax
mov dword [esp + 0x2c], 0
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x10009f9d
push 0
push 0
push ebx
push esi
call edi
lea ecx, [esp + 0x14]
push 0
push ecx
push 0x400
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
mov eax, dword [esp + 0x14]
je 0x10009f7b
test eax, eax
jbe 0x10009f7b
mov edx, dword [esp + 0x24]
push 0
push 0
push edx
push esi
call edi
mov ecx, dword [esp + 0x14]
lea eax, [esp + 0x18]
push 0
push eax
push ecx
push ebp
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
mov eax, dword [esp + 0x14]
je 0x10009f71
cmp dword [esp + 0x18], eax
je 0x10009f83
mov dword [esp + 0x10], 0xffffffff
jmp 0x10009f83
mov dword [esp + 0x2c], 1
mov ecx, dword [esp + 0x24]
add ebx, eax
add ecx, eax
mov eax, dword [esp + 0x10]
test eax, eax
mov dword [esp + 0x24], ecx
jge 0x10009f0f
jmp 0x10009fc3
mov eax, dword [esp + 0x10]
test eax, eax
jl 0x10009fc3
push 2
push 0
push 0
push esi
call edi
mov edx, dword [esp + 0x28]
push 0
sub eax, edx
push 0
push eax
push esi
call edi
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push ebp
call fcn.10039f0f
add esp, 4
mov ebx, dword [esp + 0x10]
pop ebp
test ebx, ebx
jl 0x10009fdd
push 0
push 0
push ebx
push esi
call edi
mov eax, ebx
pop edi
pop esi
pop ebx
add esp, 0x10
ret