Function at 0x403e30
Capabilities:
Set current directory

Disassembly:
sub rsp, 0x3e8
mov qword [rsp + 0x3e0], rbx
mov qword [rsp + 0x3d8], rbp
mov qword [rsp + 0x3d0], rsi
mov qword [rsp + 0x3c8], rdi
mov rdi, rdx
mov rbp, rcx
lea rdx, [0x0040c668]
mov rcx, rdi
mov qword [rsp + 0x3c0], r12
call qword [sym.imp.msvcrt.dll_fopen]
mov rcx, rbp
test rax, rax
mov rsi, rax
jne 0x403e9b
lea r8, str.Cant_open_data_file:__s_n
lea rdx, str.Error:
mov r9, rdi
call fcn.004025d0
jmp 0x4040d4
mov rdx, rdi
call fcn.00403d20
mov r12, qword [rbp + 0xaa8]
lea rdx, str.Current_Script
mov r8, rdi
mov rcx, rbp
mov qword [rbp + 0xaa8], rdi
call fcn.00402ae0
lea r9, [rsp + 0x20]
lea r8, [rsp + 0x230]
mov edx, 0x104
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetFullPathNameA]
lea rcx, [rsp + 0x230]
mov edx, 0x5c
call qword [sym.imp.msvcrt.dll__mbsrchr]
test rax, rax
jne 0x403f00
lea rax, [rsp + 0x230]
jmp 0x403f03
inc rax
lea r8, [rsp + 0x230]
lea rdx, str.Currentdir
mov rcx, rbp
mov byte [rax - 1], 0
call fcn.00402ae0
lea rcx, [rsp + 0x230]
call qword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
xor dil, dil
test byte [rsi + 0x18], 0x10
jne 0x4040bc
nop
nop
test dil, dil
jne 0x4040b4
mov rcx, rsi
lea rdi, [rsp + 0x30]
call qword [sym.imp.msvcrt.dll_fgetc]
mov byte [rsp + 0x30], al
test byte [rsi + 0x18], 0x10
jne 0x403f7a
cmp byte [rdi], 0xa
je 0x403f7a
mov rcx, rsi
inc rdi
call qword [sym.imp.msvcrt.dll_fgetc]
mov byte [rdi], al
test byte [rsi + 0x18], 0x10
je 0x403f61
mov byte [rdi], 0
cmp byte [rsp + 0x30], 0
je 0x40402f
xor eax, eax
lea rdi, [rsp + 0x30]
mov rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
lea rax, [rsp + 0x30]
not rcx
lea rdi, [rax + rcx - 2]
lea rcx, [0x0040c644]
movsx edx, byte [rdi]
call qword [sym.imp.msvcrt.dll__mbschr]
test rax, rax
je 0x403fdc
nop
nop
mov byte [rdi], 0
movsx edx, byte [rdi - 1]
dec rdi
lea rcx, [0x0040c644]
call qword [sym.imp.msvcrt.dll__mbschr]
test rax, rax
jne 0x403fc0
movsx edx, byte [rsp + 0x30]
lea rcx, [0x0040c644]
lea rdi, [rsp + 0x30]
call qword [sym.imp.msvcrt.dll__mbschr]
test rax, rax
je 0x404019
nop
nop
movsx edx, byte [rdi + 1]
inc rdi
lea rcx, [0x0040c644]
call qword [sym.imp.msvcrt.dll__mbschr]
test rax, rax
jne 0x404000
lea rcx, [rsp + 0x30]
sub rcx, rdi
movzx eax, byte [rdi]
inc rdi
test al, al
mov byte [rcx + rdi - 1], al
jne 0x404021
lea rcx, [rsp + 0x30]
mov edx, 0x5b
call qword [sym.imp.msvcrt.dll__mbschr]
test rax, rax
mov rbx, rax
jne 0x40404c
xor dil, dil
jmp 0x404098
mov edx, 0x5d
mov rcx, rax
call qword [sym.imp.msvcrt.dll__mbschr]
test rax, rax
mov rdi, rax
je 0x404098
lea rcx, [rsp + 0x30]
mov edx, 0x3b
call qword [sym.imp.msvcrt.dll__mbschr]
test rax, rax
je 0x404081
cmp rax, rdi
jae 0x404081
xor dil, dil
jmp 0x404098
mov byte [rdi], 0
lea rcx, [rbx + 1]
movzx eax, byte [rcx]
inc rcx
test al, al
jne 0x404088
mov byte [rdi], 0x5d
mov dil, 1
test dil, dil
jne 0x4040aa
lea rdx, [rsp + 0x30]
mov rcx, rbp
call fcn.00403690
test byte [rsi + 0x18], 0x10
je 0x403f40
mov rbx, qword [rsp + 0x3e0]
mov rcx, rsi
mov qword [rbp + 0xaa8], r12
call qword [sym.imp.msvcrt.dll_fclose]
mov r12, qword [rsp + 0x3c0]
mov rdi, qword [rsp + 0x3c8]
mov rsi, qword [rsp + 0x3d0]
mov rbp, qword [rsp + 0x3d8]
add rsp, 0x3e8
ret