Function at 0x10004178
Capabilities:
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x130
push ebx
push esi
push edi
push 0x103
lea eax, [ebp - 0x12f]
mov byte [ebp - 0x130], 0
push 0
push eax
mov ebx, ecx
call fcn.10017e80
mov esi, dword [ebp + 8]
lea eax, [ebx + 0x1c]
add esp, 0xc
lea edi, [esi + 0x22]
push 0xc800
push 0
push eax
call fcn.10017e80
mov eax, dword [esi]
add esp, 0xc
mov dword [ebx + 0x26], eax
mov esi, 0x104
movzx eax, word [edi + 0xa]
add eax, edi
push eax
lea eax, [ebp - 0x130]
push esi
push eax
call fcn.1001864a
add esp, 0xc
lea ecx, [ebp - 0x130]
mov edx, esi
call fcn.1000760e
xor eax, eax
push eax
push eax
push 3
push eax
push 3
push 0x80000000
lea eax, [ebp - 0x130]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 8], eax
lea esi, [ebx + 0x48]
cmp eax, 0xffffffff
jne 0x1000423a
push 0xa
pop eax
mov word [esi], ax
call dword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, word [esi]
mov dword [esi + 6], eax
mov word [esi + 2], cx
movzx eax, word [edi + 0xa]
add eax, edi
add ecx, esi
push eax
push 0x104
push ecx
jmp 0x10004481
and dword [esi + 2], 0
and dword [esi + 6], 0
push 0xe
pop eax
mov word [esi], ax
mov word [esi + 0xa], ax
movzx eax, word [edi + 0xa]
add eax, edi
push eax
lea eax, [esi + 0xe]
push 0x104
push eax
call fcn.1001864a
movzx eax, word [esi + 0xa]
add esp, 0xc
add eax, esi
push eax
call fcn.10018710
inc eax
add word [esi], ax
pop ecx
mov cx, word [esi]
mov word [esi + 0xc], cx
movzx eax, word [edi + 0xc]
add eax, edi
push eax
movzx eax, cx
add eax, esi
push 0x104
push eax
call fcn.1001864a
movzx eax, word [esi + 0xc]
add esp, 0xc
add eax, esi
push eax
call fcn.10018710
inc eax
add word [esi], ax
movzx eax, word [esi]
pop ecx
add eax, 0x2c
mov ecx, ebx
push eax
push 0xc
pop eax
push eax
call fcn.1000369a
cmp eax, 1
je 0x100042c5
xor eax, eax
jmp 0x100044e2
push 0xc7d4
push 0
push esi
call fcn.10017e80
add esp, 0xc
push 0xc
pop eax
mov word [esi], ax
mov word [esi + 0xa], ax
movzx eax, word [edi + 0xc]
add eax, edi
push eax
lea eax, [esi + 0xc]
push 0x104
push eax
call fcn.1001864a
movzx eax, word [esi + 0xa]
add esp, 0xc
add eax, esi
push eax
call fcn.10018710
inc eax
add word [esi], ax
mov ax, word [esi]
pop ecx
movzx ecx, ax
push 0
push dword [ebp - 8]
add ecx, 0x2c
mov word [esi + 8], ax
and dword [ebp + 8], 0
mov dword [ebp - 0x18], ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
and dword [ebp - 0xc], 0
mov ecx, dword [edi + 2]
mov edx, dword [edi + 6]
mov dword [ebp - 0x14], eax
mov dword [ebp - 4], edx
test ecx, ecx
je 0x10004341
lea eax, [ecx + edx]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x18]
mov ecx, 0xc800
and dword [ebp - 0x10], 0
sub ecx, eax
add eax, 0x1c
mov dword [ebp - 0x28], ecx
add eax, ebx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
sub eax, edx
mov edx, 0xc000
push ecx
cmp eax, edx
push 0
push dword [ebp - 0x1c]
cmovg eax, edx
mov dword [ebp + 8], eax
call fcn.10017e80
add esp, 0xc
push 0
push 0
push dword [ebp - 4]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp + 8]
push eax
push dword [ebp + 8]
push dword [ebp - 0x1c]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ax, word [ebp + 8]
mov ecx, dword [ebp - 4]
mov dword [esi + 2], ecx
mov word [esi + 6], ax
mov eax, dword [ebp + 8]
add ecx, eax
add eax, dword [ebp - 0x18]
push eax
mov dword [ebp - 4], ecx
mov ecx, ebx
push 0xd
call fcn.1000369a
cmp eax, 1
je 0x10004417
push eax
push str.0x01__SSD_failed__d.
call fcn.10001dcc
and dword [ebp - 0x20], 0
pop ecx
pop ecx
mov eax, dword [ebp + 8]
mov ecx, ebx
add eax, dword [ebp - 0x18]
push eax
push 0xd
call fcn.1000369a
mov dword [ebp - 0x24], eax
cmp eax, 1
je 0x1000440e
push eax
push str.0x01__SSD_failed__d.
call fcn.10001dcc
mov eax, dword [ebp - 0x20]
inc eax
mov dword [ebp - 0x20], eax
pop ecx
pop ecx
cmp eax, 3
jl 0x100043d8
mov eax, dword [ebp - 0x24]
jmp 0x10004412
and dword [ebp - 0xc], 0
cmp eax, 1
jne 0x1000442e
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 4]
inc eax
mov dword [ebp - 0x10], eax
cmp edx, dword [ebp - 0x14]
jge 0x10004434
mov ecx, dword [ebp - 0x28]
jmp 0x1000435a
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
test eax, eax
jle 0x10004448
push eax
push 0xd
push str.0x01___d_d_times.
call fcn.10001dcc
add esp, 0xc
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xc7d4
push 0
push esi
call fcn.10017e80
mov eax, dword [ebp - 0xc]
add esp, 0xc
mov dword [esi + 6], eax
push 0xa
pop eax
mov word [esi], ax
mov word [esi + 2], ax
movzx eax, word [edi + 0xa]
add eax, edi
push eax
push 0x104
lea eax, [esi + 0xa]
push eax
call fcn.1001864a
movzx eax, word [esi + 2]
add esp, 0xc
add eax, esi
push eax
call fcn.10018710
inc eax
add word [esi], ax
pop ecx
mov cx, word [esi]
mov word [esi + 4], cx
movzx eax, word [edi + 0xc]
add eax, edi
push eax
movzx eax, cx
add eax, esi
push 0x104
push eax
call fcn.1001864a
movzx eax, word [esi + 4]
add esp, 0xc
add eax, esi
push eax
call fcn.10018710
inc eax
add word [esi], ax
movzx eax, word [esi]
pop ecx
add eax, 0x2c
mov ecx, ebx
push eax
push 0xe
call fcn.1000369a
dec eax
neg eax
sbb eax, eax
inc eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 4