Function at 0x40d3af
Capabilities:
Get file size
Read file via mapping

Disassembly:
push ebp
lea ebp, [esp - 0x1a8]
sub esp, 0x228
mov eax, dword [0x419010]
xor eax, ebp
mov dword [ebp + 0x1a4], eax
mov eax, dword [ebp + 0x1b0]
or dword [ebp - 0x74], 0xffffffff
push esi
push edi
xor edi, edi
cmp eax, edi
mov dword [ebp - 0x7c], eax
mov dword [ebp - 0x70], ecx
mov dword [ebp - 0x80], edi
jne 0x40d3ef
mov esi, 0x80070057
jmp 0x40d6f9
cmp ecx, edi
jne 0x40d3fd
mov esi, 0x80004003
jmp 0x40d6f9
push edi
push edi
push 3
push edi
push 1
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0x74], esi
jne 0x40d424
mov esi, 0x80004005
jmp 0x40d6f9
push ebx
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
cmp ebx, 0xffffffff
jb 0x40d43e
mov esi, 0x80004005
jmp 0x40d6f3
push edi
push edi
push edi
push 2
push edi
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
cmp eax, edi
mov dword [ebp - 0x78], eax
jne 0x40d47c
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
test eax, eax
jg 0x40d467
call esi
mov esi, eax
jmp 0x40d6e5
call esi
mov esi, eax
and esi, 0xffff
or esi, 0x80070000
jmp 0x40d6e5
push edi
push edi
push edi
push 4
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edx, eax
cmp edx, edi
mov dword [ebp - 0x6c], edx
je 0x40d452
cmp ebx, 1
jbe 0x40d535
movzx eax, word [edx]
cmp ax, 0xfeff
jne 0x40d4e7
mov esi, ebx
shr esi, 1
xor ecx, ecx
push 2
pop edx
lea eax, [esi + 1]
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004138fd
mov edi, eax
test edi, edi
pop ecx
je 0x40d5da
mov eax, dword [ebp - 0x6c]
add ebx, 0xfffffffe
push ebx
add eax, 2
push eax
push edi
call sub.MSVCR80.dll_memcpy
add esp, 0xc
and word [edi + esi*2], 0
jmp 0x40d601
cmp ax, 0xfffe
jne 0x40d535
mov eax, ebx
shr eax, 1
xor ecx, ecx
push 2
inc eax
pop edx
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004138fd
mov edi, eax
test edi, edi
pop ecx
je 0x40d5da
and ebx, 0xfffffffe
lea eax, [ebx - 2]
push eax
mov eax, dword [ebp - 0x6c]
add eax, 2
push edi
push eax
call dword [sym.imp.MSVCR80.dll__swab]
shr ebx, 1
add esp, 0xc
and word [edi + ebx*2], 0
jmp 0x40d601
push 3
pop ecx
cmp ebx, ecx
jb 0x40d58f
mov edi, 0x404fb0
mov esi, edx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x40d54e
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40d58d
sub ebx, 3
xor ecx, ecx
push 2
pop edx
lea eax, [ebx + 1]
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004138fd
mov edi, eax
test edi, edi
pop ecx
je 0x40d5da
test ebx, ebx
jbe 0x40d588
mov eax, dword [ebp - 0x6c]
push ebx
push edi
push ebx
add eax, 3
push eax
call fcn.004152d1
jmp 0x40d5fc
mov eax, dword [ebp - 0x80]
jmp 0x40d5fc
xor edi, edi
lea ecx, [ebx - 1]
mov eax, 0xfa
cmp ecx, eax
jae 0x40d5b6
mov eax, ecx
jmp 0x40d5b6
movzx ecx, byte [edx]
inc edx
cmp ecx, 0x20
jae 0x40d5b5
xor esi, esi
inc esi
shl esi, cl
test esi, 0x8003780
je 0x40d5e4
dec eax
cmp eax, edi
jg 0x40d59f
xor ecx, ecx
push 2
lea esi, [ebx + 1]
pop edx
mov eax, esi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.004138fd
mov edi, eax
test edi, edi
pop ecx
jne 0x40d5ec
mov esi, 0x8007000e
jmp 0x40d6cf
xor esi, esi
inc esi
jmp 0x40d6dc
push esi
push edi
push ebx
push dword [ebp - 0x6c]
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
and word [edi + eax*2], 0
push dword [ebp - 0x70]
push edi
call fcn.0040d71d
mov esi, eax
test esi, esi
jl 0x40d6cf
push dword [ebp - 0x70]
call dword [sym.imp.SHLWAPI.dll_PathIsRelativeW]
test eax, eax
je 0x40d6cd
mov esi, 0x105
push esi
push dword [ebp - 0x7c]
lea eax, [ebp - 0x68]
push esi
push eax
call dword [sym.imp.MSVCR80.dll_wcsncpy_s]
add esp, 0x10
test eax, eax
jne 0x40d6c6
lea eax, [ebp - 0x68]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecW]
lea eax, [ebp - 0x68]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x40d654
mov ebx, dword [sym.imp.MSVCR80.dll_wcsncat_s]
sub eax, edx
sar eax, 1
mov ecx, 0x104
sub ecx, eax
push ecx
push 0x404fb4
lea eax, [ebp - 0x68]
push esi
push eax
call ebx
add esp, 0x10
test eax, eax
jne 0x40d6c6
lea eax, [ebp - 0x68]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x40d689
sub eax, edx
sar eax, 1
mov ecx, 0x104
sub ecx, eax
push ecx
push dword [ebp - 0x70]
lea eax, [ebp - 0x68]
push esi
push eax
call ebx
add esp, 0x10
test eax, eax
jne 0x40d6c6
push esi
lea eax, [ebp - 0x68]
push eax
push esi
push dword [ebp - 0x70]
call dword [sym.imp.MSVCR80.dll_wcsncpy_s]
add esp, 0x10
test eax, eax
je 0x40d6cd
mov esi, 0x80004005
jmp 0x40d6cf
xor esi, esi
test edi, edi
je 0x40d6da
push edi
call fcn.00413d16
pop ecx
xor edi, edi
push dword [ebp - 0x6c]
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
cmp dword [ebp - 0x78], edi
je 0x40d6f3
push dword [ebp - 0x78]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x74], edi
pop ebx
je 0x40d702
push dword [ebp - 0x74]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp + 0x1a4]
pop edi
mov eax, esi
xor ecx, ebp
pop esi
call fcn.00413c2a
add ebp, 0x1a8
leave
ret 4