Function at 0x401560
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2a4
mov eax, dword [0x408004]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
mov dword [ebp - 0x28c], eax
mov eax, dword [ebp + 0xc]
push esi
mov dword [ebp - 0x290], eax
mov eax, dword [ebp + 0x10]
push edi
mov dword [ebp - 0x294], eax
mov eax, dword [ebp + 0x14]
push 0x100
mov dword [ebp - 0x2a0], eax
lea eax, [ebp - 0x270]
push 0
push eax
mov dword [ebp - 0x288], edx
mov dword [ebp - 0x284], ecx
call sub.VCRUNTIME140.dll_memset
movups xmm0, xmmword [str.amnesia_settings.txt]
mov eax, dword [0x406750]
lea edi, [ebp - 0x170]
mov dword [ebp - 0xc], eax
mov ecx, 0x2b
movzx eax, byte [0x406754]
mov esi, str.skip_flashbacks:_n_r_ndelay_maps:_y_r_nallow_unexpected_game_versions:_n_r_ncheck_for_tool_updates:_y_r_nallow_not_fully_updated_tool:_n_r_nmilliseconds_remaining_before_unwait:_435_r_n
movups xmmword [ebp - 0x1c], xmm0
mov byte [ebp - 8], al
add esp, 0xc
movups xmm0, xmmword [str.skip_flashbacks:]
movzx eax, byte [0x406768]
rep movsd dword es:[edi], dword [esi]
movups xmmword [ebp - 0x3c], xmm0
mov byte [ebp - 0x2c], al
movq xmm0, qword [str.delay_maps:]
mov eax, dword [0x406774]
movq qword [ebp - 0x28], xmm0
movups xmm0, xmmword [str.allow_unexpected_game_versions:]
mov dword [ebp - 0x20], eax
mov eax, dword [0x4067c8]
movups xmmword [ebp - 0xbc], xmm0
mov dword [ebp - 0x44], eax
movups xmm0, xmmword [0x406788]
movzx eax, word [0x4067cc]
mov word [ebp - 0x40], ax
mov eax, dword [0x4067f0]
movups xmmword [ebp - 0xac], xmm0
mov dword [ebp - 0x64], eax
movups xmm0, xmmword [str.check_for_tool_updates:]
movzx eax, word [0x4067f4]
mov word [ebp - 0x60], ax
xor al, al
movups xmmword [ebp - 0x9c], xmm0
mov byte [ebp - 0x279], al
movq xmm0, qword [0x4067a8]
movq qword [ebp - 0x8c], xmm0
movups xmm0, xmmword [str.allow_not_fully_updated_tool:]
mov byte [ebp - 0x27a], al
mov byte [ebp - 0x27b], al
movups xmmword [ebp - 0x5c], xmm0
mov byte [ebp - 0x27c], al
movq xmm0, qword [0x4067c0]
movq qword [ebp - 0x4c], xmm0
movups xmm0, xmmword [str.milliseconds_remaining_before_unwait:]
mov byte [ebp - 0x27d], al
lea eax, [ebp - 0x1c]
push 0x406190
movups xmmword [ebp - 0x84], xmm0
push eax
movups xmm0, xmmword [0x4067e0]
lea eax, [ebp - 0x274]
movsw word es:[edi], word [esi]
mov edi, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen_s]
push eax
movups xmmword [ebp - 0x74], xmm0
mov dword [ebp - 0x274], 0
call edi
add esp, 0xc
test eax, eax
jne 0x401b52
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x401b52
push eax
push 0x100
lea eax, [ebp - 0x270]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
push dword [ebp - 0x274]
mov ebx, dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
mov esi, eax
call ebx
add esp, 0x14
mov dword [ebp - 0x274], 0
cmp esi, 0x100
jne 0x4017ab
lea eax, [ebp - 0x1c]
push eax
push esi
push eax
push str._s_should_be_smaller_than__zu_bytes_nresetting__s_n
call fcn.00401010
push 0x406840
lea eax, [ebp - 0x1c]
push eax
lea eax, [ebp - 0x274]
push eax
call edi
add esp, 0x1c
test eax, eax
jne 0x401b52
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x401b52
push eax
push 0xad
lea eax, [ebp - 0x170]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push dword [ebp - 0x274]
call ebx
add esp, 0x14
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004044d2
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncmp]
lea esi, [ebp - 0x270]
mov ebx, dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strcspn]
xor eax, eax
mov dword [ebp - 0x298], eax
mov dword [ebp - 0x278], eax
mov dword [ebp - 0x29c], eax
cmp byte [esi], 0
je 0x401a41
push str.__f_n_r_t_v
push esi
call dword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strspn]
add esi, eax
lea eax, [ebp - 0x3c]
push 0x10
push eax
push esi
call edi
add esp, 0x14
test eax, eax
jne 0x401850
add esi, 0x11
push str._nNyY_n
push esi
call ebx
add esi, eax
add esp, 8
mov al, byte [esi]
cmp al, 0x79
je 0x401825
cmp al, 0x59
je 0x401825
cmp al, 0x6e
je 0x40181a
cmp al, 0x4e
jne 0x40182e
mov eax, dword [ebp - 0x284]
mov byte [eax], 0
jmp 0x40182e
mov eax, dword [ebp - 0x284]
mov byte [eax], 1
mov al, byte [esi]
cmp al, 0xa
je 0x401844
test al, al
je 0x401844
mov byte [ebp - 0x279], 1
jmp 0x401a2b
mov byte [ebp - 0x279], 0
jmp 0x401a2b
push 0xb
lea eax, [ebp - 0x28]
push eax
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x4018b8
add esi, 0xc
push str._nNyY_n
push esi
call ebx
add esi, eax
add esp, 8
mov al, byte [esi]
cmp al, 0x79
je 0x40188d
cmp al, 0x59
je 0x40188d
cmp al, 0x6e
je 0x401882
cmp al, 0x4e
jne 0x401896
mov eax, dword [ebp - 0x288]
mov byte [eax], 0
jmp 0x401896
mov eax, dword [ebp - 0x288]
mov byte [eax], 1
mov al, byte [esi]
cmp al, 0xa
je 0x4018ac
test al, al
je 0x4018ac
mov byte [ebp - 0x27a], 1
jmp 0x401a2b
mov byte [ebp - 0x27a], 0
jmp 0x401a2b
push 0x1f
lea eax, [ebp - 0xbc]
push eax
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x401923
add esi, 0x20
push str._nNyY_n
push esi
call ebx
add esi, eax
add esp, 8
mov al, byte [esi]
cmp al, 0x79
je 0x4018f8
cmp al, 0x59
je 0x4018f8
cmp al, 0x6e
je 0x4018ed
cmp al, 0x4e
jne 0x401901
mov eax, dword [ebp - 0x28c]
mov byte [eax], 0
jmp 0x401901
mov eax, dword [ebp - 0x28c]
mov byte [eax], 1
mov al, byte [esi]
cmp al, 0xa
je 0x401917
test al, al
je 0x401917
mov byte [ebp - 0x27b], 1
jmp 0x401a2b
mov byte [ebp - 0x27b], 0
jmp 0x401a2b
push 0x17
lea eax, [ebp - 0x9c]
push eax
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x40198e
add esi, 0x18
push str._nNyY_n
push esi
call ebx
add esi, eax
add esp, 8
mov al, byte [esi]
cmp al, 0x79
je 0x401963
cmp al, 0x59
je 0x401963
cmp al, 0x6e
je 0x401958
cmp al, 0x4e
jne 0x40196c
mov eax, dword [ebp - 0x290]
mov byte [eax], 0
jmp 0x40196c
mov eax, dword [ebp - 0x290]
mov byte [eax], 1
mov al, byte [esi]
cmp al, 0xa
je 0x401982
test al, al
je 0x401982
mov byte [ebp - 0x27c], 1
jmp 0x401a2b
mov byte [ebp - 0x27c], 0
jmp 0x401a2b
push 0x1d
lea eax, [ebp - 0x5c]
push eax
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x4019f0
add esi, 0x1e
push str._nNyY_n
push esi
call ebx
add esi, eax
add esp, 8
mov al, byte [esi]
cmp al, 0x79
je 0x4019cb
cmp al, 0x59
je 0x4019cb
cmp al, 0x6e
je 0x4019c0
cmp al, 0x4e
jne 0x4019d4
mov eax, dword [ebp - 0x294]
mov byte [eax], 0
jmp 0x4019d4
mov eax, dword [ebp - 0x294]
mov byte [eax], 1
mov al, byte [esi]
cmp al, 0xa
je 0x4019e7
test al, al
je 0x4019e7
mov byte [ebp - 0x27d], 1
jmp 0x401a2b
mov byte [ebp - 0x27d], 0
jmp 0x401a2b
push 0x25
lea eax, [ebp - 0x84]
push eax
push esi
call edi
add esp, 0xc
test eax, eax
jne 0x401a2b
push 0xa
lea ecx, [ebp - 0x278]
lea eax, [esi + 0x26]
push ecx
push eax
mov dword [ebp - 0x298], eax
call dword [sym.imp.api_ms_win_crt_convert_l1_1_0.dll_strtol]
mov esi, dword [ebp - 0x278]
add esp, 0xc
mov dword [ebp - 0x29c], eax
push 0xa
push esi
call dword [sym.imp.VCRUNTIME140.dll_strchr]
mov esi, eax
add esp, 8
test esi, esi
jne 0x4017d1
mov eax, dword [ebp - 0x298]
cmp eax, dword [ebp - 0x278]
jne 0x401a60
push str.couldnt_read__milliseconds_remaining_before_unwait__setting_n
call fcn.00401010
add esp, 4
xor ecx, ecx
jmp 0x401a84
mov ecx, dword [ebp - 0x29c]
test ecx, ecx
jns 0x401a7b
push str.milliseconds_remaining_before_unwait_cant_be_less_than_zero_n
call fcn.00401010
add esp, 4
xor ecx, ecx
jmp 0x401a84
xor eax, eax
test ecx, ecx
sete al
add ecx, eax
cmp byte [ebp - 0x279], 0
movd xmm0, ecx
cvtdq2pd xmm0, xmm0
mov eax, dword [ebp - 0x2a0]
divsd xmm0, qword [0x407070]
movsd qword [eax], xmm0
je 0x401ae2
cmp byte [ebp - 0x27a], 0
je 0x401ae2
cmp byte [ebp - 0x27b], 0
je 0x401ae2
cmp byte [ebp - 0x27c], 0
je 0x401ae2
cmp byte [ebp - 0x27d], 0
je 0x401ae2
test ecx, ecx
jle 0x401ae2
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004044d2
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x1c]
push eax
push eax
push str.couldnt_read_all_settings_in__s_nresetting__s_n
call fcn.00401010
add esp, 0xc
lea eax, [ebp - 0x1c]
push 0x406840
push eax
lea eax, [ebp - 0x274]
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen_s]
add esp, 0xc
test eax, eax
jne 0x401b52
mov eax, dword [ebp - 0x274]
test eax, eax
je 0x401b52
push eax
push 0xad
lea eax, [ebp - 0x170]
push 1
push eax
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push dword [ebp - 0x274]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x14
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004044d2
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x1c]
push eax
push str.couldnt_open__s_n
call fcn.00401010
mov ecx, dword [ebp - 4]
add esp, 8
xor ecx, ebp
xor al, al
pop edi
pop esi
pop ebx
call fcn.004044d2
mov esp, ebp
pop ebp
ret