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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
xor ebx, ebx
push esi
push edi
mov dword [ebp - 8], ebx
mov dword [ebp - 4], ebx
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0xc], ebx
cmp dword [ebp + 8], ebx
je 0x40d3a0
cmp dword [ebp + 0x14], 1
jl 0x40d3a0
mov edi, dword [ebp + 0x10]
cmp edi, 1
jl 0x40d3a0
mov ecx, dword [ebp + 0x18]
cmp ecx, ebx
je 0x40d3a0
mov eax, dword [ebp + 0x1c]
cmp eax, ebx
je 0x40d3a0
fldz
push ebx
push 0x80
push 3
push ebx
push 3
push SQLAllocEnv
push dword [ebp + 8]
mov byte [ecx], bl
fstp qword [eax]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp + 8], esi
cmp esi, ebx
je 0x40d3a0
cmp esi, 0xffffffff
je 0x40d3a0
mov eax, dword [ebp + 0x14]
dec eax
movzx eax, ax
mov dword [ebp - 0x10], eax
dec edi
movzx eax, di
push ebx
push esi
mov dword [ebp - 0x14], eax
mov dword [ebp + 0x10], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
lea ecx, [eax + 0x1000]
mov dword [ebp - 8], eax
mov eax, 0x1000
cmp ecx, eax
jbe 0x40d1cc
mov eax, ecx
push 1
push eax
call fcn.00452b24
pop ecx
pop ecx
mov dword [ebp + 0x14], eax
cmp eax, ebx
je 0x40d394
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
push ebx
push ebx
push esi
call edi
push ebx
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push dword [ebp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
xor esi, esi
cmp dword [ebp - 8], ebx
jbe 0x40d387
mov eax, dword [ebp + 0x14]
mov cl, byte [esi + eax]
cmp cl, 9
jne 0x40d22a
cmp byte [esi + eax + 1], 8
jne 0x40d22a
add esi, 6
mov cl, byte [esi + eax]
cmp cl, 0x10
jne 0x40d22a
inc dword [ebp + 0x10]
cmp cl, 0x7e
jne 0x40d258
cmp byte [esi + eax + 1], 2
jne 0x40d258
movzx edx, byte [esi + eax + 4]
cmp dx, word [ebp - 0x10]
jne 0x40d258
movzx edx, byte [esi + eax + 6]
cmp dx, word [ebp - 0x14]
jne 0x40d258
mov edx, dword [ebp + 0x10]
cmp edx, dword [ebp + 0xc]
je 0x40d32b
cmp cl, 3
jne 0x40d286
cmp byte [esi + eax + 1], 2
jne 0x40d286
movzx edx, byte [esi + eax + 4]
cmp dx, word [ebp - 0x10]
jne 0x40d286
movzx edx, byte [esi + eax + 6]
cmp dx, word [ebp - 0x14]
jne 0x40d286
mov edx, dword [ebp + 0xc]
cmp dword [ebp + 0x10], edx
je 0x40d361
cmp cl, 4
jne 0x40d31f
cmp byte [esi + eax + 1], 2
jne 0x40d31f
movzx ecx, byte [esi + eax + 4]
cmp cx, word [ebp - 0x10]
jne 0x40d31f
movzx ecx, byte [esi + eax + 6]
cmp cx, word [ebp - 0x14]
jne 0x40d31f
mov ecx, dword [ebp + 0xc]
cmp dword [ebp + 0x10], ecx
jne 0x40d31f
push ebx
push ebx
add esi, 0xa
push esi
push dword [ebp + 8]
mov dword [ebp - 4], 2
call edi
push ebx
lea eax, [ebp - 4]
push eax
push dword [ebp - 4]
lea eax, [ebp - 0x18]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push ebx
push ebx
add esi, 2
push esi
push dword [ebp + 8]
mov dword [ebp - 0xc], eax
call edi
mov ecx, dword [ebp - 0x18]
mov eax, 0xff
mov dword [ebp - 4], ecx
cmp ecx, eax
jl 0x40d2ff
mov dword [ebp - 4], eax
push ebx
lea eax, [ebp - 4]
push eax
push dword [ebp - 4]
push dword [ebp + 0x18]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp + 0x18]
mov byte [eax + ecx], bl
mov eax, dword [ebp + 0x14]
inc esi
cmp esi, dword [ebp - 8]
jb 0x40d20a
jmp 0x40d38a
push ebx
push ebx
add esi, 0xa
push esi
push dword [ebp + 8]
call edi
push 4
pop eax
push ebx
lea ecx, [ebp - 4]
push ecx
push eax
mov dword [ebp - 4], eax
lea eax, [ebp - 0x1c]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 0x1c]
mov dword [ebp - 0xc], eax
call fcn.0040bd49
mov eax, dword [ebp + 0x1c]
fstp qword [eax]
jmp 0x40d387
push ebx
push ebx
add esi, 0xa
push esi
push dword [ebp + 8]
call edi
push 8
pop eax
push ebx
lea ecx, [ebp - 4]
push ecx
push eax
push dword [ebp + 0x1c]
mov dword [ebp - 4], eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 0x14]
push eax
call fcn.00452756
mov esi, dword [ebp + 8]
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0xc]
jmp 0x40d3a2
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 0x18