Function at 0x412850
Capabilities:
Check if file exists
Read file on windows

Disassembly:
sub esp, 0x8a8
mov eax, dword [esp + 0x8ac]
push ebx
push ebp
push esi
xor esi, esi
push edi
push esi
push 0x80
push 3
push esi
push esi
push SysReAllocStringLen
mov ebp, ecx
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x412891
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
lea ecx, [esp + 0x10]
push esi
push ecx
lea edx, [esp + 0x38]
push 5
push edx
push ebx
mov dword [esp + 0x24], esi
mov dword [esp + 0x3c], esi
mov byte [esp + 0x44], 0
mov dword [esp + 0x45], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4128ee
cmp ebx, esi
je 0x4128c5
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
cmp dword [esp + 0x10], 5
je 0x412929
cmp ebx, esi
je 0x412900
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
mov ecx, 5
lea edi, [esp + 0x30]
mov esi, str.XS01
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x412971
test ebx, ebx
je 0x412948
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
push 0x874
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
jne 0x4129b8
test ebx, ebx
je 0x41298f
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea ecx, [esp + 0x10]
push 0
push ecx
lea edx, [esp + 0x30]
push 4
push edx
push ebx
call edi
test eax, eax
jne 0x412a0e
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x4129e5
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
cmp dword [esp + 0x10], 4
je 0x412a50
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x412a27
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
cmp dword [esp + 0x28], 0x874
je 0x412a95
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x412a6c
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
lea eax, [esp + 0x10]
push 0
push eax
push 0x874
push esi
push ebx
call edi
test eax, eax
jne 0x412ae4
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x412abb
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
cmp dword [esp + 0x10], 0x874
je 0x412b29
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x412b00
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
lea ecx, [ebp + 0x10]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
lea ecx, [ebp + 0x10]
push 0x200
mov dword [esp + 0x18], ecx
call fcn.0040f2f0
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push eax
push 0xffffffffffffffff
push esi
push 0
push 0
call edi
mov ecx, dword [esp + 0x14]
push 0x200
call fcn.0040f300
push eax
lea ecx, [esi + 0x200]
push 0xffffffffffffffff
push ecx
push 0
push 0
call edi
mov ecx, dword [esp + 0x14]
push 0x200
call fcn.0040f2e0
push eax
lea edx, [esi + 0x400]
push 0xffffffffffffffff
push edx
push 0
push 0
call edi
mov eax, dword [esi + 0x800]
mov edi, 1
mov dword [ebp + 0xc18], eax
mov cl, byte [esi + 0x804]
mov byte [ebp + 0xc1d], cl
mov dl, byte [esi + 0x805]
mov byte [ebp + 0xc1e], dl
mov eax, dword [esi + 0x808]
mov dword [ebp + 0xc20], eax
mov eax, dword [esi + 0x80c]
mov ecx, 3
cmp eax, ecx
ja case.default.0x412bca
jmp dword [eax*4 + 0x41324c]
mov dword [ebp + 0xc24], 0
jmp case.default.0x412bca
mov dword [ebp + 0xc24], edi
jmp case.default.0x412bca
mov dword [ebp + 0xc24], 5
jmp case.default.0x412bca
mov dword [ebp + 0xc24], ecx
mov eax, dword [esi + 0x810]
cmp eax, ecx
ja case.default.0x412c01
jmp dword [eax*4 + 0x41325c]
xor edx, edx
mov dword [ebp + 0xc28], edx
jmp 0x412c2e
mov dword [ebp + 0xc28], edi
jmp case.default.0x412c01
mov dword [ebp + 0xc28], 5
jmp case.default.0x412c01
mov dword [ebp + 0xc28], ecx
xor edx, edx
mov eax, dword [esi + 0x814]
mov dword [esp + 0x1c], edx
mov dword [esp + 0x18], eax
fild qword [esp + 0x18]
mov dword [esp + 0x1c], edx
fstp qword [ebp + 0xc30]
mov eax, dword [esi + 0x818]
mov byte [ebp + 0xc60], 1
mov dword [esp + 0x18], eax
mov al, byte [esp + 0x8c0]
fild qword [esp + 0x18]
cmp al, 2
fstp qword [ebp + 0xc38]
jae 0x412dae
mov eax, dword [esi + 0x81c]
mov dword [ebp + 0xc40], eax
mov eax, dword [esi + 0x820]
mov dword [ebp + 0xc44], eax
mov eax, dword [esi + 0x824]
cmp eax, ecx
ja case.default.0x412c96
jmp dword [eax*4 + 0x41326c]
mov dword [ebp + 0xc48], edx
jmp case.default.0x412c96
mov dword [ebp + 0xc48], edi
jmp case.default.0x412c96
mov dword [ebp + 0xc48], 5
jmp case.default.0x412c96
mov dword [ebp + 0xc48], ecx
mov eax, dword [esi + 0x828]
cmp eax, ecx
ja case.default.0x412cc9
jmp dword [eax*4 + 0x41327c]
mov dword [ebp + 0xc4c], edx
jmp case.default.0x412cc9
mov dword [ebp + 0xc4c], edi
jmp case.default.0x412cc9
mov dword [ebp + 0xc4c], 5
jmp case.default.0x412cc9
mov dword [ebp + 0xc4c], ecx
lea ecx, [esi + 0x82c]
mov edi, dword [sym.imp.KERNEL32.dll_SystemTimeToFileTime]
mov eax, dword [ecx]
mov dword [esp + 0x18], eax
mov eax, dword [ecx + 4]
mov dword [esp + 0x1c], eax
mov eax, dword [ecx + 8]
mov dword [esp + 0x20], eax
mov ax, word [esi + 0x854]
mov ecx, dword [ecx + 0xc]
mov word [esp + 0x20], ax
mov ax, word [esi + 0x858]
mov dword [esp + 0x24], ecx
mov cx, word [esi + 0x856]
mov word [esp + 0x26], dx
mov word [esp + 0x22], cx
lea ecx, [ebp + 0xc50]
lea edx, [esp + 0x18]
push ecx
push edx
mov word [esp + 0x2c], ax
call edi
lea eax, [esi + 0x83c]
mov ecx, dword [esi + 0x83c]
mov dword [esp + 0x18], ecx
mov edx, dword [eax + 4]
mov dword [esp + 0x1c], edx
mov ecx, dword [eax + 8]
mov dword [esp + 0x20], ecx
mov cx, word [esi + 0x866]
mov edx, dword [eax + 0xc]
mov ax, word [esi + 0x864]
mov word [esp + 0x20], ax
mov word [esp + 0x22], cx
lea eax, [ebp + 0xc58]
mov dword [esp + 0x24], edx
mov dx, word [esi + 0x868]
lea ecx, [esp + 0x18]
push eax
push ecx
mov word [esp + 0x2c], dx
mov word [esp + 0x2e], 0
call edi
mov dl, byte [esi + 0x870]
mov byte [ebp + 0xc14], dl
mov al, byte [esi + 0x86f]
mov byte [ebp + 0xc68], al
mov dword [ebp + 0xc64], 0x90
mov al, byte [esi + 0x86c]
neg al
sbb eax, eax
xor ecx, ecx
and eax, 2
or al, 0x90
mov dword [ebp + 0xc64], eax
mov dl, byte [esi + 0x86d]
test dl, dl
setne cl
or ecx, eax
mov al, byte [esp + 0x8c0]
mov dword [ebp + 0xc64], ecx
mov dl, byte [esi + 0x86e]
neg dl
sbb edx, edx
and edx, 4
or edx, ecx
test al, al
mov dword [ebp + 0xc64], edx
jbe 0x412e2e
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x413232
jmp 0x41322b
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esp + 0x10]
push 0
push eax
lea ecx, [esp + 0x34]
push 4
push ecx
push ebx
mov dword [esp + 0x40], 0
call edi
test eax, eax
jne 0x412e8d
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x412e63
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
cmp dword [esp + 0x10], 4
je 0x412ed0
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x412ea6
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
mov eax, dword [esp + 0x2c]
test eax, eax
ja 0x412eec
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x413232
jmp 0x41322b
test eax, eax
mov dword [esp + 0x18], 0
jbe 0x413220
lea edx, [esp + 0x10]
push 0
push edx
lea eax, [esp + 0x30]
push 4
push eax
push ebx
call edi
test eax, eax
je 0x4130b8
cmp dword [esp + 0x10], 4
jne 0x4130f4
cmp dword [esp + 0x28], 0x2a0
jne 0x413130
lea ecx, [esp + 0x10]
push 0
push ecx
push 0x2a0
push esi
push ebx
call edi
test eax, eax
je 0x41316c
cmp dword [esp + 0x10], 0x2a0
jne 0x4131a8
lea edx, [esp + 0x64]
push 0x104
push edx
xor eax, eax
push 0xffffffffffffffff
mov ecx, 0x120
lea edi, [esp + 0x44]
push esi
push eax
push eax
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov edi, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [esp + 0x288]
push 0x105
push eax
lea ecx, [esi + 0x104]
push 0xffffffffffffffff
push ecx
push 0
push 0
call edi
lea edx, [esp + 0x26c]
push 0xe
push edx
lea eax, [esi + 0x284]
push 0xffffffffffffffff
push eax
push 0
push 0
call edi
mov ecx, dword [esi + 0x210]
cmp word [esp + 0x64], 0
mov dword [esp + 0x58], ecx
mov edx, dword [esi + 0x214]
mov dword [esp + 0x54], edx
mov eax, dword [esi + 0x268]
mov dword [esp + 0x4c], eax
mov ecx, dword [esi + 0x26c]
mov dword [esp + 0x50], ecx
mov edx, dword [esi + 0x270]
mov dword [esp + 0x3c], edx
mov eax, dword [esi + 0x274]
mov dword [esp + 0x40], eax
mov ecx, dword [esi + 0x278]
mov dword [esp + 0x44], ecx
mov edx, dword [esi + 0x27c]
mov dword [esp + 0x48], edx
mov eax, dword [esi + 0x280]
mov dword [esp + 0x38], eax
je 0x413098
mov al, byte [ebp + 0xd62]
test al, al
je 0x41307a
mov ecx, 0xff
xor eax, eax
lea edi, [esp + 0x4ba]
mov word [esp + 0x4b8], 0
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x288]
lea edx, [esp + 0x4b8]
push ecx
push edx
stosw word es:[edi], ax
call fcn.004330d3
add esp, 8
lea eax, [esp + 0x64]
lea ecx, [esp + 0x4b8]
push eax
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAppendW]
lea edx, [esp + 0x4b8]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x413098
lea eax, [esp + 0x38]
mov ecx, ebp
push eax
call fcn.00411b30
test edx, edx
jl 0x4131e4
jg 0x413098
test eax, eax
jb 0x4131e4
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x2c]
inc eax
cmp eax, ecx
mov dword [esp + 0x18], eax
jae 0x413220
mov edi, dword [sym.imp.KERNEL32.dll_ReadFile]
jmp 0x412efc
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x4130ca
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x413106
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x413142
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x41317e
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x4131ba
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x4131f6
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
mov ecx, ebp
call fcn.004101f0
mov ecx, dword [esp + 0x14]
call fcn.0040f270
pop edi
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x8a8
ret 8
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
test ebx, ebx
je 0x413232
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp + 0xcc8]
call fcn.0040f780
pop edi
pop esi
pop ebp
mov al, 1
pop ebx
add esp, 0x8a8
ret 8