Function at 0x14008d5e0
Capabilities:
Write file on windows

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rdi
mov eax, 0x4870
call sub.ntdll.dll___chkstk
sub rsp, rax
mov rax, qword [0x14042d950]
xor rax, rsp
mov qword [rsp + 0x4860], rax
mov edi, r8d
mov rbx, rdx
lea rcx, [rsp + 0x62]
xor edx, edx
mov r8d, reloc.MFC80U.DLL_Ordinal_1022
mov word [rsp + 0x60], 0
call sub.ntdll.dll_memset
lea rcx, [rsp + 0x60]
mov edx, reloc.MFC80U.DLL_Ordinal_512
call qword [sym.imp.KERNEL32.dll_GetSystemWindowsDirectoryW]
test eax, eax
jne 0x14008d71a
call fcn.140049470
lea rbx, [0x140433fd0]
xor edx, edx
mov rcx, rbx
mov r8d, 0x80
mov rsi, rax
call sub.ntdll.dll_memset
lea rcx, str...updatecfg.cpp
mov edx, 0x5c
call qword [sym.imp.ntdll.dll_strrchr]
test rax, rax
mov rdi, rax
jne 0x14008d681
xor ebx, ebx
jmp 0x14008d700
xor eax, eax
lea rdx, [0x1402dfd08]
lea rcx, [rsp + 0x48]
mov r8d, 0x337
mov byte [rsp + 0x48], 0
mov qword [rsp + 0x49], rax
mov word [rsp + 0x51], ax
mov byte [rsp + 0x53], al
call qword [sym.imp.ntdll.dll_sprintf]
lea rdx, [rdi + 1]
mov rcx, rbx
sub rcx, rdx
nop
nop
movzx eax, byte [rdx]
add rdx, 1
test al, al
mov byte [rcx + rdx - 1], al
jne 0x14008d6c0
xor eax, eax
or rcx, 0xffffffffffffffff
mov rdi, rbx
repne scasb al, byte [rdi]
xor ecx, ecx
lea rdx, [rsp + 0x48]
nop
nop
nop
nop
movzx eax, byte [rdx + rcx]
add rcx, 1
test al, al
mov byte [rdi + rcx - 2], al
jne 0x14008d6f0
mov rax, qword [rsi]
lea rdx, str._s:_Failed_to_GetSystemWindowsDirectory_in_WriteConfigFile.
mov r8, rbx
mov rcx, rsi
call qword [rax + 0x10]
xor eax, eax
jmp 0x14008d86e
lea rcx, [rsp + 0x462]
xor edx, edx
mov r8d, reloc.MFC80U.DLL_Ordinal_1022
mov qword [rsp + 0x4880], rbp
mov word [rsp + 0x460], 0
call sub.ntdll.dll_memset
lea r8, [rsp + 0x60]
lea rdx, str._s_ampa.ini
lea rcx, [rsp + 0x460]
call qword [sym.imp.MSVCR80.dll__swprintf]
lea rcx, [rsp + 0x862]
xor edx, edx
mov r8d, 0x3ffe
mov word [rsp + Ordinal_2149], 0
call sub.ntdll.dll_memset
lea rdx, str._s_r_n
lea rcx, [rsp + 0x860]
mov r8, rbx
call qword [sym.imp.MSVCR80.dll__swprintf]
mov edx, 4
mov ebp, 2
test edi, edi
lea rcx, [rsp + 0x460]
lea r8d, [rbp - 1]
cmovne edx, ebp
xor ebx, ebx
xor r9d, r9d
mov qword [rsp + 0x30], rbx
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], edx
mov edx, 0x40000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
cmp rax, 0xffffffffffffffff
mov rsi, rax
jne 0x14008d807
call fcn.140049470
lea rcx, str...updatecfg.cpp
mov edx, 0x351
mov rbx, qword [rax]
mov rdi, rax
call fcn.14008d3f0
lea rdx, str._s:_Failed_to_CreateFile_in_WriteConfigFile.
mov rcx, rdi
mov r8, rax
call qword [rbx + 0x10]
xor eax, eax
jmp 0x14008d866
mov r9d, ebp
xor r8d, r8d
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
or rcx, 0xffffffffffffffff
xor eax, eax
lea rdi, [rsp + 0x860]
lea r9, [rsp + 0x40]
lea rdx, [rsp + 0x860]
repne scasw ax, word [rdi]
mov dword [rsp + 0x40], ebx
mov qword [rsp + 0x20], rbx
not rcx
lea r8d, [rcx + rcx - 2]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_WriteFile]
mov rcx, rsi
mov edi, eax
call qword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, edi
mov rbp, qword [rsp + 0x4880]
mov rcx, qword [rsp + 0x4860]
xor rcx, rsp
call fcn.140161080
lea r11, [rsp + 0x4870]
mov rbx, qword [r11 + 0x20]
mov rsi, qword [r11 + 0x28]
mov rsp, r11
pop rdi
ret