Function at 0x4dd9b0
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x28]
test edi, edi
jne 0x4dd9c9
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push edi
call fcn.004e1e10
add esp, 4
test eax, eax
jne 0x4dd9de
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ebx, dword [esp + 0x34]
test ebx, ebx
jg 0x4dd9f0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
mov eax, dword [edi]
mov dword [esp + 0x10], 0
cmp eax, 1
jne 0x4ddace
mov edi, dword [edi + 4]
push eax
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x28], ebp
jne 0x4dda27
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push 0
push edi
mov dword [esp + 0x18], 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
sub esi, ebx
sub esi, ebp
test esi, esi
jle 0x4ddabb
push esi
call fcn.004fc4e3
add esp, 4
mov ebp, eax
push 1
push 0
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call ebx
lea eax, [esp + 0x18]
push 0
push eax
push esi
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4dda82
push ebp
call fcn.004fc50c
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ecx, dword [esp + 0x28]
push 0
push 0
push ecx
push edi
call ebx
lea edx, [esp + 0x18]
push 0
push edx
push esi
push ebp
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4ddaa6
mov dword [esp + 0x10], eax
push ebp
call fcn.004fc50c
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x4ddc79
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
cmp eax, 2
jne 0x4ddb4f
mov esi, dword [edi + 4]
mov ecx, esi
mov eax, dword [esi]
call dword [eax + 0x14]
mov ecx, esi
mov ebp, eax
call fcn.004e2420
mov edi, eax
mov dword [esp + 0x10], 1
sub edi, ebx
sub edi, ebp
test edi, edi
jle 0x4ddb3b
mov edx, dword [esi]
push 1
push ebx
mov ecx, esi
call dword [edx + 0x18]
push edi
call fcn.004fc4e3
add esp, 4
mov ebx, eax
mov eax, dword [esi]
mov ecx, esi
push edi
push ebx
call dword [eax + 0x20]
mov edx, dword [esi]
push 0
push ebp
mov ecx, esi
call dword [edx + 0x18]
mov eax, dword [esi]
push edi
push ebx
mov ecx, esi
call dword [eax + 0x24]
mov edx, dword [esi]
mov ecx, esi
call dword [edx + 0x14]
push ebx
mov ebp, eax
call fcn.004fc50c
add esp, 4
mov eax, dword [esi]
push ebp
mov ecx, esi
call dword [eax + 0x1c]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
cmp eax, 3
jne 0x4ddc79
mov esi, dword [edi + 4]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
mov dword [esp + 0x14], eax
jne 0x4ddb7b
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x10
ret
push 0
push esi
mov dword [esp + 0x18], 1
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [esp + 0x14]
mov ebp, eax
sub ebp, ebx
sub ebp, ecx
test ebp, ebp
jle 0x4ddc72
push ebp
call fcn.004fc4e3
mov ecx, dword [esp + 0x38]
add esp, 4
mov ebx, eax
push 1
push 0
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea edx, [esp + 0x18]
push 0
push edx
push ebp
push ebx
push esi
mov dword [esp + 0x3c], eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4ddbf1
push ebx
call fcn.004fc50c
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret
mov ebp, dword [esp + 0x18]
lea eax, [edi + 0x10]
push eax
mov eax, dword [edi + 0xc]
lea ecx, [edi + 0x34]
push eax
mov dword [esp + 0x24], ecx
push ecx
mov ecx, dword [esp + 0x34]
push ebp
push ebx
push ecx
call fcn.004e1800
mov edx, dword [esp + 0x2c]
add esp, 0x18
push 0
push 0
push edx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 1
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esp + 0x1c]
lea ecx, [edi + 0x10]
push ecx
mov ecx, dword [edi + 0xc]
push ecx
push edx
push ebp
push ebx
push eax
call fcn.004e1800
add esp, 0x18
lea eax, [esp + 0x18]
push 0
push eax
push ebp
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x4ddc61
mov dword [esp + 0x10], eax
push ebx
call fcn.004fc50c
mov eax, dword [esp + 0x14]
add esp, 4
test eax, eax
je 0x4ddc79
push esi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret