Function at 0x40ef65
Capabilities:
Get common file path
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push ebx
push esi
push edi
mov eax, 0x4dc5c0
lea ecx, [ebp - 0x48]
mov dx, word [eax]
mov word [ecx], dx
mov al, byte [eax + 2]
mov byte [ecx + 2], al
mov esi, str.device_SystemRoot__system32haspdos.sys
lea edi, [ebp - 0x44]
mov ecx, 0xa
rep movsd dword es:[edi], dword [esi]
movsb byte es:[edi], byte [esi]
push 0x2710
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov dword [0x42d5b8], eax
cmp dword [0x42d5b8], 0
jne 0x40efc5
push 5
call fcn.004064f2
add esp, 4
mov eax, 0xffffffff
jmp 0x40f6c6
push 0x200
push 0x42d3b0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x4dc5f0
push 0x42d3b0
call fcn.0041d138
add esp, 8
push 0x42d3b0
push 0x42cd40
call fcn.0041d13c
add esp, 8
push 0x4dc5f4
push 0x42d3b0
call fcn.0041d138
add esp, 8
push str.config.hsp
push 0x42cd40
call fcn.0041d138
add esp, 8
cmp dword [ebp + 8], 0
jne 0x40f03b
push 0
push 0x42cd40
push 0x42d3b0
call fcn.00408230
add esp, 0xc
push 0
push pe_nt_image_headers32
push 4
push 0
push 1
push 0x80000000
push 0x42d3b0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x42d5b0], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40f076
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [0x42d5b0], 0xffffffff
jne 0x40f0a6
push 0x40003
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
push 0
lea eax, [ebp - 8]
push eax
push 0x270f
mov eax, dword [0x42d5b8]
push eax
mov eax, dword [0x42d5b0]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x40f0ff
push 0x4000a
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x42d5b0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, 0xffffffff
jmp 0x40f6c6
mov eax, dword [0x42d5b0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40f136
push 0x40005
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
mov dword [ebp - 4], 1
mov dword [ebp - 0x14], 0
jmp 0x40f14c
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 8], eax
jbe 0x40f1d3
cmp dword [ebp - 4], 1
jne 0x40f1d3
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
xor edx, edx
mov dl, byte [eax + ecx]
movsx eax, byte [0x4dbfd8]
cmp edx, eax
jne 0x40f1ce
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x40f195
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 0xb
jae 0x40f1ce
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
xor edx, edx
mov dl, byte [eax + ecx]
mov eax, dword [ebp - 0x18]
movsx eax, byte [eax + 0x4dbfd8]
cmp edx, eax
je 0x40f1c9
mov dword [ebp - 4], 1
jmp 0x40f192
jmp 0x40f149
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 8], eax
jne 0x40f3c9
cmp dword [ebp - 4], 1
jne 0x40f3c9
cmp dword [ebp + 8], 0
jne 0x40f3b1
mov eax, dword [ebp - 8]
mov ecx, dword [0x42d5b8]
xor edx, edx
mov dl, byte [eax + ecx - 1]
cmp edx, 0x1a
jne 0x40f213
dec dword [ebp - 8]
jmp 0x40f233
mov eax, dword [ebp - 8]
mov ecx, dword [0x42d5b8]
mov byte [eax + ecx], 0xd
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
mov ecx, dword [0x42d5b8]
mov byte [eax + ecx], 0xa
inc dword [ebp - 8]
mov dword [ebp - 0x18], 0
mov eax, dword [ebp - 8]
mov dword [ebp - 0x14], eax
jmp 0x40f24b
inc dword [ebp - 0x14]
inc dword [ebp - 0x18]
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov cl, byte [ebp + eax - 0x44]
test ecx, ecx
je 0x40f274
mov eax, dword [ebp - 0x18]
mov al, byte [ebp + eax - 0x44]
mov ecx, dword [ebp - 0x14]
mov edx, dword [0x42d5b8]
mov byte [ecx + edx], al
jmp 0x40f245
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
mov byte [eax + ecx], 0xd
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
mov byte [eax + ecx + 1], 0xa
push 0x200
push 0x42d3b0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x4dc60c
push 0x42d3b0
call fcn.0041d138
add esp, 8
push 0x4dc610
push 0x42d3b0
call fcn.0041d138
add esp, 8
push 0
push pe_nt_image_headers32
push 4
push 0
push 0
push 0xc0000000
push 0x42d3b0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x42d5b0], eax
cmp dword [0x42d5b0], 0xffffffff
jne 0x40f315
push 0x40003
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [ebp - 0x14]
inc eax
push eax
mov eax, dword [0x42d5b8]
push eax
mov eax, dword [0x42d5b0]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x40f362
push 0x40004
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
mov eax, dword [0x42d5b0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40f399
push 0x40005
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40f6c6
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40f6c6
dec dword [ebp - 0x14]
jmp 0x40f3d4
dec dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
xor edx, edx
mov dl, byte [eax + ecx]
cmp edx, 0xa
je 0x40f3f0
jmp 0x40f3d1
inc dword [ebp - 0x14]
jmp 0x40f3fb
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
xor edx, edx
mov dl, byte [eax + ecx]
cmp edx, 0x14
jne 0x40f417
jmp 0x40f3f8
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x40f42d
inc dword [ebp - 0x18]
cmp dword [ebp - 0x18], 3
jae 0x40f48a
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
xor edx, edx
mov dl, byte [eax + ecx]
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov cl, byte [ebp + eax - 0x48]
cmp edx, ecx
je 0x40f485
mov eax, dword [ebp - 0x18]
add eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
xor edx, edx
mov dl, byte [eax + ecx]
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov cl, byte [ebp + eax - 0x48]
sub ecx, 0x20
cmp edx, ecx
je 0x40f485
mov dword [ebp - 4], 1
jmp 0x40f42a
cmp dword [ebp - 4], 1
jne 0x40f4d3
cmp dword [ebp + 8], 1
jne 0x40f4d3
mov eax, dword [0x42d5b8]
push eax
mov eax, dword [ebp - 8]
push eax
mov eax, dword [ebp - 0x14]
push eax
call fcn.0040f6cb
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40f4d3
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
cmp dword [ebp - 4], 1
jne 0x40f4fa
cmp dword [ebp + 8], 0
jne 0x40f4fa
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40f6c6
cmp dword [ebp - 4], 0
jne 0x40f521
cmp dword [ebp + 8], 1
jne 0x40f521
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40f6c6
cmp dword [ebp - 4], 0
jne 0x40f6b3
cmp dword [ebp + 8], 0
jne 0x40f6b3
jmp 0x40f53d
inc dword [ebp - 0x14]
mov eax, dword [ebp - 0x14]
cmp dword [ebp - 8], eax
jbe 0x40f567
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
mov al, byte [eax + ecx + 4]
mov ecx, dword [ebp - 0x14]
mov edx, dword [0x42d5b8]
mov byte [ecx + edx], al
jmp 0x40f53a
sub dword [ebp - 0x14], 4
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
mov byte [eax + ecx], 0xd
mov eax, dword [ebp - 0x14]
mov ecx, dword [0x42d5b8]
mov byte [eax + ecx + 1], 0xa
add dword [ebp - 0x14], 2
push 0x200
push 0x42d3b0
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x4dc61c
push 0x42d3b0
call fcn.0041d138
add esp, 8
push 0x4dc620
push 0x42d3b0
call fcn.0041d138
add esp, 8
push 0x42d3b0
call fcn.0040820a
add esp, 4
push 0
push pe_nt_image_headers32
push 2
push 0
push 0
push 0xc0000000
push 0x42d3b0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x42d5b0], eax
cmp dword [0x42d5b0], 0xffffffff
jne 0x40f61d
push 0x40003
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
push 0
lea eax, [ebp - 0xc]
push eax
mov eax, dword [ebp - 0x14]
push eax
mov eax, dword [0x42d5b8]
push eax
mov eax, dword [0x42d5b0]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x40f669
push 0x40003
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
mov eax, dword [0x42d5b0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40f6a0
push 0x40005
call fcn.004064f2
add esp, 4
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, 0xffffffff
jmp 0x40f6c6
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40f6c6
mov eax, dword [0x42d5b8]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40f6c6
pop edi
pop esi
pop ebx
leave
ret