Function at 0x512cb0
Capabilities:
Check if file exists

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x108
mov eax, dword [0x623ec0]
xor eax, ebp
mov dword [ebp - 4], eax
mov al, byte [ebp + 8]
push edi
mov edi, ecx
cmp al, 0x78
je 0x512ce4
cmp al, 0x58
je 0x512ce4
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0046676f
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [edi + 0x1a8820]
mov eax, dword [0x9c25ac]
push ebx
push esi
mov esi, dword [ecx + 0x28]
xor ebx, ebx
mov dword [ebp - 0x108], eax
test esi, esi
mov eax, dword [ecx]
sete bl
push ebx
call dword [eax + 0x60]
mov ecx, dword [edi + 0x1a8770]
push ebx
mov eax, dword [ecx]
call dword [eax + 0x8c]
test esi, esi
jne 0x512f77
push 0x100
lea eax, [ebp - 0x104]
push esi
push eax
call fcn.00468b40
mov eax, dword [0x6345e4]
add esp, 0xc
test eax, eax
jne 0x512d48
push str.QuestSubjects.txt
push str.LangPT_s
jmp 0x512d57
cmp eax, 1
jne 0x512d6b
push str.QuestSubjects.txt
push str.LangEN_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
lea eax, [ebp - 0x104]
push eax
call esi
test eax, eax
jne 0x512d9c
push str.QuestSubjects.txt
push str.LangPT_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
mov ebx, dword [ebp - 0x108]
mov ecx, 0xa
movsx eax, word [ebx + 0x95c]
cdq
idiv ecx
movsx eax, word [ebx + 0x92c]
push edx
inc eax
push eax
lea eax, [ebp - 0x104]
push eax
push dword [edi + 0x1a8838]
call fcn.005920f0
mov eax, dword [0x6345e4]
test eax, eax
jne 0x512de2
push str.QuestSubjects2.txt
push str.LangPT_s
jmp 0x512df1
cmp eax, 1
jne 0x512e05
push str.QuestSubjects2.txt
push str.LangEN_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
lea eax, [ebp - 0x104]
push eax
call esi
test eax, eax
jne 0x512e30
push str.QuestSubjects2.txt
push str.LangPT_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
movsx eax, word [ebx + 0x95c]
mov ecx, 0xa
cdq
idiv ecx
movsx eax, word [ebx + 0x92c]
push edx
inc eax
push eax
lea eax, [ebp - 0x104]
push eax
push dword [edi + 0x1a883c]
call fcn.005920f0
mov eax, dword [0x6345e4]
test eax, eax
jne 0x512e70
push str.QuestSubjects3.txt
push str.LangPT_s
jmp 0x512e7f
cmp eax, 1
jne 0x512e93
push str.QuestSubjects3.txt
push str.LangEN_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
lea eax, [ebp - 0x104]
push eax
call esi
test eax, eax
jne 0x512ebe
push str.QuestSubjects3.txt
push str.LangPT_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
movsx eax, word [ebx + 0x95c]
mov ecx, 0xa
cdq
idiv ecx
movsx eax, word [ebx + 0x92c]
push edx
inc eax
push eax
lea eax, [ebp - 0x104]
push eax
push dword [edi + 0x1a8840]
call fcn.005920f0
mov eax, dword [0x6345e4]
test eax, eax
jne 0x512efe
push str.QuestSubjects4.txt
push str.LangPT_s
jmp 0x512f0d
cmp eax, 1
jne 0x512f21
push str.QuestSubjects4.txt
push str.LangEN_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
lea eax, [ebp - 0x104]
push eax
call esi
test eax, eax
jne 0x512f4c
push str.QuestSubjects4.txt
push str.LangPT_s
lea eax, [ebp - 0x104]
push 0x80
push eax
call fcn.004459c0
add esp, 0x10
movsx eax, word [ebx + 0x95c]
mov ecx, 0xa
cdq
idiv ecx
movsx eax, word [ebx + 0x92c]
push edx
inc eax
push eax
lea eax, [ebp - 0x104]
push eax
push dword [edi + 0x1a8844]
call fcn.005920f0
mov eax, dword [edi]
mov ecx, edi
push 0
push 0x101633
call dword [eax + 0x58]
mov ecx, dword [0x9c25cc]
pop esi
pop ebx
test ecx, ecx
je 0x512fa9
push 0x33
call fcn.004a8da0
test eax, eax
je 0x512fa9
sub esp, 0xc
push 0
push ecx
mov ecx, eax
call fcn.004a86c0
mov ecx, dword [ebp - 4]
mov eax, 1
xor ecx, ebp
pop edi
call fcn.0046676f
mov esp, ebp
pop ebp
ret 8