Function at 0x401040
Capabilities:
Check if file exists
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x82c
mov eax, dword [0x4361b0]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
xor eax, eax
mov esi, ecx
push 0x206
push eax
lea ecx, [ebp - 0x61a]
push ecx
mov dword [ebp - 0x82c], esi
mov word [ebp - 0x61c], ax
call sub.MSVCR100.dll_memset
xor edx, edx
push 0x206
push edx
lea eax, [ebp - 0x412]
push eax
mov word [ebp - 0x414], dx
call sub.MSVCR100.dll_memset
mov edx, dword [0x437fb0]
add esp, 0x18
push 0x104
lea ecx, [ebp - 0x414]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x429c84
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
cmp dword [esi + 4], 0
mov edi, dword [sym.imp.MSVCR100.dll__snwprintf]
jne 0x4010fe
lea ecx, [ebp - 0x414]
push ecx
push str._sStormPlayer.dll
lea edx, [ebp - 0x61c]
push 0x104
push edx
call edi
add esp, 0x10
push 1
push 0
lea eax, [ebp - 0x61c]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [esi + 4], eax
cmp dword [esi + 8], 0
jne 0x4012dd
lea ecx, [ebp - 0x414]
push ecx
push str._sSkinStormPlayer.bftheme
lea edx, [ebp - 0x61c]
push 0x104
push edx
call edi
xor eax, eax
push 0x206
push eax
lea ecx, [ebp - 0x20a]
push ecx
mov word [ebp - 0x20c], ax
call sub.MSVCR100.dll_memset
push 0
push 0x104
lea edx, [ebp - 0x20c]
push edx
push str.ThemeFile
call dword [sym.imp.crt.dll_Ordinal_27]
xor eax, eax
add esp, 0x2c
cmp word [ebp - 0x20c], ax
jne 0x40118d
jmp 0x401170
movzx ecx, word [ebp + eax - 0x61c]
mov word [ebp + eax - 0x20c], cx
add eax, 2
test cx, cx
jne 0x401170
jmp 0x401258
push 0x206
lea ecx, [ebp - 0x822]
push 0
push ecx
mov word [ebp - 0x824], ax
call sub.MSVCR100.dll_memset
add esp, 0xc
cmp word [ebp - 0x20a], 0x3a
jne 0x4011da
cmp word [ebp - 0x208], 0x5c
jne 0x4011da
xor eax, eax
movzx ecx, word [ebp + eax - 0x20c]
mov word [ebp + eax - 0x824], cx
add eax, 2
test cx, cx
jne 0x4011c0
jmp 0x4011fe
lea edx, [ebp - 0x20c]
push edx
lea eax, [ebp - 0x414]
push eax
push str._sSkin_s
lea ecx, [ebp - 0x824]
push 0x104
push ecx
call edi
add esp, 0x14
lea edx, [ebp - 0x824]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40123a
xor eax, eax
jmp 0x401220
movzx ecx, word [ebp + eax - 0x824]
mov word [ebp + eax - 0x20c], cx
add eax, 2
test cx, cx
jne 0x401220
jmp 0x401258
xor eax, eax
lea esp, [esp]
movzx ecx, word [ebp + eax - 0x61c]
mov word [ebp + eax - 0x20c], cx
add eax, 2
test cx, cx
jne 0x401240
push 0
push 0
push 3
push 0
push 3
push 0xc0000000
lea eax, [ebp - 0x20c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x4012dd
push ebx
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
push ebx
call dword [sym.imp.MSVCR100.dll_void____cdecl_operator_new___unsigned_int_]
add esp, 4
push 0
lea ecx, [ebp - 0x828]
push ecx
push ebx
mov edi, eax
push edi
push esi
mov dword [ebp - 0x828], 0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4012d5
mov ebx, dword [ebp - 0x828]
mov edx, dword [ebp - 0x82c]
push edi
lea ecx, [ebp - 0x20c]
call fcn.004012f0
push edi
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete___void__]
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0042391e
mov esp, ebp
pop ebp
ret