Function at 0x4059c4
Capabilities:
Get file size
Read .ini file
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [ebp + 0x1c]
push ebx
mov ebx, dword [ebp + 0x20]
push esi
push edi
xor edi, edi
push edi
push 0x80
push 3
mov dword [eax], edi
pop eax
push eax
push edi
push eax
push SysReAllocString
push dword [ebp + 0xc]
mov dword [ebp - 8], edi
mov dword [ebx], edi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 0x10], esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [0x5bd018], eax
cmp esi, 0xffffffff
jne 0x405a20
or dword [0x561f80], 0xffffffff
or dword [0x561f84], 0xffffffff
xor eax, eax
jmp 0x4060b3
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0x5b7cb8
push 1
mov dword [ebp - 0xc], eax
add eax, 0xa
push str.FileLoadWarningMB
push 0x561750
mov dword [ebp - 4], eax
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntW]
push 2
pop ecx
test eax, eax
je 0x405a7e
shl eax, 0x14
cmp eax, dword [ebp - 0xc]
jae 0x405a7e
push 0xc361
push str.MsgFileSizeWarning
push ecx
call fcn.004028f0
add esp, 0xc
cmp eax, 6
je 0x405a7e
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx], 1
jmp 0x405a0b
push dword [ebp - 4]
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
lea eax, [ebp + 0x20]
push edi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
sub eax, 2
push eax
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x10]
mov dword [0x5bd018], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test esi, esi
jne 0x405ac9
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x4060a3
cmp dword [0x5bd1a0], edi
je 0x405b0f
mov esi, dword [ebp + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 0xfffffffc
lea eax, [esi + eax*2]
mov dword [ebp - 0x10], eax
cmp eax, esi
jb 0x405b0f
mov esi, dword [sym.imp.KERNEL32.dll_lstrcmpiW]
push str..nfo
push eax
call esi
test eax, eax
je 0x405b08
push str..diz
push dword [ebp - 0x10]
call esi
test eax, eax
jne 0x405b0f
mov dword [ebp - 8], 1
mov esi, dword [0x5bd1ac]
push esi
call fcn.0040ae6d
neg eax
pop ecx
sbb edx, edx
and edx, esi
cmp dword [ebp - 8], edi
mov esi, dword [0x561f84]
mov dword [0x5bd1ac], edx
cmovne edx, dword [0x5c0ba0]
mov dword [ebp - 0xc], edx
cmp esi, 0xffffffff
je 0x405b52
push esi
call fcn.0040ae6d
mov edx, dword [ebp - 0xc]
test eax, eax
pop ecx
cmovne edx, esi
mov dword [ebp - 0xc], edx
mov esi, dword [ebp + 0x14]
mov dword [esi], edi
cmp dword [ebp + 0x20], edi
jne 0x405bea
mov eax, dword [0x5bd198]
mov ecx, dword [eax*4 + 0x561f8c]
mov eax, dword [ebp + 0x18]
mov dword [eax], ecx
mov eax, dword [0x561f80]
cmp eax, 0xffffffff
jne 0x405b93
cmp dword [0x5bd1a4], edi
je 0x405b8d
cmp dword [ebp - 8], edi
jne 0x405b8d
push 6
pop eax
jmp 0x405b8f
mov eax, edx
mov dword [esi], eax
jmp 0x405b95
mov dword [esi], eax
mov esi, dword [sym.imp.USER32.dll_SendMessageW]
imul eax, eax, 0x50
push edi
test byte [eax + 0x55f128], 1
mov eax, 0xfde9
cmovne eax, dword [0x5bcd44]
push eax
push 0x7f5
push dword [ebp + 8]
call esi
push edi
push 0x5b67fa
push dword [ebp + 8]
call fcn.0040532b
mov eax, dword [0x5bd198]
add esp, 0xc
push edi
push dword [eax*4 + 0x561f8c]
push 0x7ef
push dword [ebp + 8]
call esi
jmp 0x406099
mov ecx, dword [0x561f80]
mov dword [ebp - 4], ecx
cmp dword [ebp + 0x10], edi
jne 0x405f1d
push 5
pop edx
push 4
pop eax
cmp ecx, 0xffffffff
je 0x405c13
cmp ecx, eax
je 0x405e17
cmp ecx, edx
jne 0x405c5a
cmp ecx, eax
je 0x405e17
cmp ecx, edx
je 0x405e10
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 0x10]
push eax
push dword [ebp + 0x20]
push ebx
call fcn.0040aedd
add esp, 0x10
test eax, eax
je 0x405c57
cmp byte [ebx], 0xef
jne 0x405c4c
cmp byte [ebx + 1], 0xbb
jne 0x405c4c
cmp byte [ebx + 2], 0xbf
je 0x405c57
mov eax, dword [ebp - 0x10]
mov dword [ebp - 8], eax
jmp 0x405e2e
mov ecx, dword [ebp - 4]
cmp ecx, 0xffffffff
je 0x405c6d
cmp ecx, 6
je 0x405c6d
cmp ecx, 7
jne 0x405f1d
cmp byte [ebx], 0xef
jne 0x405c82
cmp byte [ebx + 1], 0xbb
jne 0x405c82
cmp byte [ebx + 2], 0xbf
je 0x405d4d
push 0x5bcd60
call fcn.0040b07e
pop ecx
test eax, eax
jne 0x405d4d
mov eax, dword [ebp - 4]
cmp eax, 6
je 0x405d4d
cmp eax, 7
je 0x405d4d
cmp dword [ebp - 8], edi
jne 0x405cbb
cmp dword [0x5bd1a4], edi
jne 0x405d4d
push dword [ebp + 0x20]
push ebx
call fcn.0040aee0
pop ecx
pop ecx
test eax, eax
je 0x405f1a
mov cl, byte [ebx]
cmp cl, 0xef
jne 0x405ce6
cmp byte [ebx + 1], 0xbb
jne 0x405ce6
cmp byte [ebx + 2], 0xbf
jne 0x405ce6
lea edx, [ebx + 3]
jmp 0x405cf9
mov edx, ebx
cmp cl, 0xef
jne 0x405d01
cmp byte [ebx + 1], 0xbb
jne 0x405d01
cmp byte [ebx + 2], 0xbf
jne 0x405d01
mov eax, dword [ebp + 0x20]
add eax, 0xfffffffd
jmp 0x405d15
mov eax, dword [ebp + 0x20]
cmp cl, 0xef
jne 0x405d1a
cmp byte [ebx + 1], 0xbb
jne 0x405d1a
cmp byte [ebx + 2], 0xbf
jne 0x405d1a
lea ecx, [ebx + 3]
jmp 0x405d1c
mov ecx, ebx
push eax
push ecx
call fcn.0040c789
push edx
mov ecx, eax
call fcn.0040c78c
add esp, 0xc
dec eax
cmp eax, ecx
jne 0x405d4d
cmp dword [ebp - 8], edi
jne 0x405f1a
imul eax, dword [ebp - 0xc], 0x50
test byte [eax + 0x55f128], 2
je 0x405f1a
push 0x5bcd60
call fcn.0040b081
pop ecx
test eax, eax
je 0x405d6d
mov ecx, dword [ebp - 4]
cmp ecx, 6
je 0x405d6d
cmp ecx, 7
jne 0x405f1d
push edi
push 0xfde9
push 0x7f5
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_SendMessageW]
push edi
mov edi, dword [ebp + 8]
push 0x5b7826
push edi
call fcn.0040532b
add esp, 0xc
cmp byte [ebx], 0xef
jne 0x405de7
cmp byte [ebx + 1], 0xbb
jne 0x405de7
cmp byte [ebx + 2], 0xbf
jne 0x405de7
mov eax, dword [ebp + 0x20]
lea ecx, [ebx + 3]
add eax, 0xfffffffd
push eax
push ecx
push edi
call fcn.0040532b
add esp, 0xc
mov dword [esi], 7
cmp byte [ebx], 0xef
jne 0x405dd2
cmp byte [ebx + 1], 0xbb
jne 0x405dd2
cmp byte [ebx + 2], 0xbf
lea ecx, [ebx + 3]
je 0x405dd4
mov ecx, ebx
mov eax, dword [ebp + 0x20]
add eax, 0xfffffffd
push eax
push ecx
push edi
call fcn.00405989
add esp, 0xc
jmp 0x405e04
push dword [ebp + 0x20]
push ebx
push edi
call fcn.0040532b
push dword [ebp + 0x20]
mov dword [esi], 6
push ebx
push edi
call fcn.00405989
add esp, 0x18
mov ecx, eax
mov eax, dword [ebp + 0x18]
mov dword [eax], ecx
jmp 0x406099
mov esi, 0xfffe
jmp 0x405e1c
mov esi, 0xfeff
xor eax, eax
cmp word [ebx], si
mov esi, dword [ebp + 0x14]
sete al
mov dword [ebp - 8], eax
cmp ecx, edx
je 0x405e3b
push 4
test eax, eax
pop eax
push 2
pop ecx
cmovne eax, ecx
jmp 0x405e57
push dword [ebp + 0x20]
push ebx
push ebx
call fcn.004d884e
add esp, 0xc
cmp dword [ebp - 8], edi
push 5
pop eax
push 3
pop ecx
push 2
cmovne eax, ecx
pop ecx
mov dword [esi], eax
imul eax, dword [ebp + 0x20], 3
add eax, ecx
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, dword [ebp + 0x20]
mov edx, eax
mov ecx, dword [ebp - 8]
shr esi, 1
mov dword [ebp - 0xc], edx
test ecx, ecx
jne 0x405e7a
inc esi
test ecx, ecx
mov dword [ebp - 8], ebx
push edi
lea eax, [ebx + 2]
mov ecx, ebx
push edi
cmovne ecx, eax
push edx
mov dword [ebp - 8], ecx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push dword [ebp - 0xc]
push esi
push dword [ebp - 8]
push edi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp + 0x20], eax
test eax, eax
jne 0x405ed5
mov esi, dword [ebp - 0xc]
push edi
push edi
push esi
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push esi
push 0xffffffffffffffff
push dword [ebp - 8]
push edi
push edi
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp + 0x20], eax
mov eax, dword [ebp + 0x1c]
mov dword [eax], 1
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
push ebx
call edi
mov esi, dword [ebp + 8]
xor ebx, ebx
push ebx
push 0xfde9
push 0x7f5
push esi
call dword [sym.imp.USER32.dll_SendMessageW]
push ebx
push 0x5b67fb
push esi
call fcn.0040532b
mov eax, dword [ebp + 0x20]
mov ebx, dword [ebp - 0xc]
dec eax
push eax
push ebx
push esi
call fcn.0040532b
mov eax, dword [ebp + 0x20]
dec eax
push eax
jmp 0x406042
mov ecx, dword [ebp - 4]
cmp ecx, 0xffffffff
je 0x405f26
mov dword [esi], ecx
jmp 0x405f65
push 0x5bcd60
call fcn.0040b087
mov dword [esi], eax
pop ecx
cmp eax, 0xffffffff
jne 0x405f65
test byte [0x5bcd60], 0x40
je 0x405f45
mov dword [esi], edi
jmp 0x405f65
mov eax, dword [0x561f84]
cmp eax, 0xffffffff
je 0x405f60
imul eax, eax, 0x50
test byte [eax + 0x55f128], 0x3f
mov eax, dword [0x5bd1ac]
jne 0x405f63
mov eax, dword [ebp - 0xc]
mov dword [esi], eax
imul ecx, dword [esi], 0x50
mov eax, 0xfde8
test byte [ecx + 0x55f128], 0x40
je 0x405f82
mov esi, dword [ecx + 0x55f12c]
cmp esi, eax
jne 0x405fa3
jmp 0x405f8e
cmp dword [ecx + 0x55f12c], eax
jne 0x406056
push dword [ebp + 0x20]
mov esi, eax
push ebx
call fcn.0040af1a
pop ecx
pop ecx
test eax, eax
je 0x406056
mov eax, dword [ebp + 0x20]
lea eax, [eax*2 + 0x10]
push eax
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov edi, eax
push edi
call dword [sym.imp.KERNEL32.dll_GlobalSize]
shr eax, 1
push eax
push edi
push dword [ebp + 0x20]
push ebx
push 0
push esi
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push ebx
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
imul ecx, esi, 3
add ecx, 0x10
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
xor eax, eax
push eax
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalSize]
push eax
push ebx
push esi
push edi
xor esi, esi
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GlobalFree]
mov dword [ebp + 0x20], eax
call edi
push esi
mov esi, dword [ebp + 8]
push 0xfde9
push 0x7f5
push esi
call dword [sym.imp.USER32.dll_SendMessageW]
push 0
push 0x5b7827
push esi
call fcn.0040532b
push dword [ebp + 0x20]
push ebx
push esi
call fcn.0040532b
push dword [ebp + 0x20]
push ebx
push esi
call fcn.00405989
mov ecx, dword [ebp + 0x18]
add esp, 0x24
push ebx
mov dword [ecx], eax
call edi
jmp 0x4060a0
mov esi, dword [ebp + 8]
push edi
push dword [0x5bcd44]
push 0x7f5
push esi
call dword [sym.imp.USER32.dll_SendMessageW]
push edi
push 0x5b7828
push esi
call fcn.0040532b
push dword [ebp + 0x20]
push ebx
push esi
call fcn.0040532b
push dword [ebp + 0x20]
mov eax, dword [ebp + 0x14]
push ebx
push esi
mov dword [eax], edi
call fcn.00405989
mov ecx, dword [ebp + 0x18]
add esp, 0x24
mov dword [ecx], eax
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor edi, edi
inc edi
or dword [0x561f80], 0xffffffff
mov eax, edi
or dword [0x561f84], 0xffffffff
pop edi
pop esi
pop ebx
leave
ret