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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push esi
push edi
mov ax, word [0x5337ec]
mov word [ebp - 0x10], ax
mov cl, byte [0x5337ee]
mov byte [ebp - 0xe], cl
mov ecx, 0xa
mov esi, str.device_SystemRoot__system32haspdos.sys
lea edi, [ebp - 0x48]
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 [0x5c2e6c], eax
cmp dword [0x5c2e6c], 0
jne 0x4107e2
push 5
call fcn.00406ccc
add esp, 4
or eax, 0xffffffff
jmp 0x410e69
push 0x200
push 0x5c2a40
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x53381c
push 0x5c2a40
call fcn.004202e0
add esp, 8
push 0x5c2a40
push 0x5c2c60
call fcn.004202d0
add esp, 8
push 0x533820
push 0x5c2a40
call fcn.004202e0
add esp, 8
push str.config.hsp
push 0x5c2c60
call fcn.004202e0
add esp, 8
cmp dword [ebp + 8], 0
jne 0x410854
push 0
push 0x5c2c60
push 0x5c2a40
call fcn.00408b26
add esp, 0xc
push 0
push 0x80
push 4
push 0
push 1
push 0x80000000
push 0x5c2a40
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x5c2a20], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x41088b
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [0x5c2a20], 0xffffffff
jne 0x4108b6
push 0x40003
call fcn.00406ccc
add esp, 4
mov edx, dword [0x5c2e6c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x270f
mov ecx, dword [0x5c2e6c]
push ecx
mov edx, dword [0x5c2a20]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x41090c
push 0x4000a
call fcn.00406ccc
add esp, 4
mov eax, dword [0x5c2e6c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [0x5c2a20]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x410e69
mov edx, dword [0x5c2a20]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x41093e
push 0x40005
call fcn.00406ccc
add esp, 4
mov eax, dword [0x5c2e6c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
mov dword [ebp - 4], 1
mov dword [ebp - 0x14], 0
jmp 0x410957
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
cmp edx, dword [ebp - 0x1c]
jae 0x4109c5
cmp dword [ebp - 4], 1
jne 0x4109c5
mov eax, dword [0x5c2e6c]
add eax, dword [ebp - 0x14]
xor ecx, ecx
mov cl, byte [eax]
movsx edx, byte [0x532dd4]
cmp ecx, edx
jne 0x4109c3
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x410995
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xb
jae 0x4109c3
mov ecx, dword [ebp - 0x14]
add ecx, dword [ebp - 0x18]
mov edx, dword [0x5c2e6c]
xor eax, eax
mov al, byte [edx + ecx]
mov ecx, dword [ebp - 0x18]
movsx edx, byte [ecx + 0x532dd4]
cmp eax, edx
je 0x4109c1
mov dword [ebp - 4], 1
jmp 0x41098c
jmp 0x41094e
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x1c]
jne 0x410bab
cmp dword [ebp - 4], 1
jne 0x410bab
cmp dword [ebp + 8], 0
jne 0x410b98
mov ecx, dword [0x5c2e6c]
add ecx, dword [ebp - 0x1c]
xor edx, edx
mov dl, byte [ecx - 1]
cmp edx, 0x1a
jne 0x410a03
mov eax, dword [ebp - 0x1c]
sub eax, 1
mov dword [ebp - 0x1c], eax
jmp 0x410a2c
mov ecx, dword [0x5c2e6c]
add ecx, dword [ebp - 0x1c]
mov byte [ecx], 0xd
mov edx, dword [ebp - 0x1c]
add edx, 1
mov dword [ebp - 0x1c], edx
mov eax, dword [0x5c2e6c]
add eax, dword [ebp - 0x1c]
mov byte [eax], 0xa
mov ecx, dword [ebp - 0x1c]
add ecx, 1
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x18], 0
mov edx, dword [ebp - 0x1c]
mov dword [ebp - 0x14], edx
jmp 0x410a4d
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [ebp - 0x18]
add ecx, 1
mov dword [ebp - 0x18], ecx
mov edx, dword [ebp - 0x18]
xor eax, eax
mov al, byte [ebp + edx - 0x48]
test eax, eax
je 0x410a6e
mov ecx, dword [0x5c2e6c]
add ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
mov al, byte [ebp + edx - 0x48]
mov byte [ecx], al
jmp 0x410a3b
mov ecx, dword [0x5c2e6c]
add ecx, dword [ebp - 0x14]
mov byte [ecx], 0xd
mov edx, dword [0x5c2e6c]
add edx, dword [ebp - 0x14]
mov byte [edx + 1], 0xa
push 0x200
push 0x5c2a40
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x533838
push 0x5c2a40
call fcn.004202e0
add esp, 8
push 0x53383c
push 0x5c2a40
call fcn.004202e0
add esp, 8
push 0
push 0x80
push 4
push 0
push 0
push 0xc0000000
push 0x5c2a40
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x5c2a20], eax
cmp dword [0x5c2a20], 0xffffffff
jne 0x410b07
push 0x40003
call fcn.00406ccc
add esp, 4
mov eax, dword [0x5c2e6c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
push 0
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x14]
add edx, 1
push edx
mov eax, dword [0x5c2e6c]
push eax
mov ecx, dword [0x5c2a20]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x410b52
push 0x40004
call fcn.00406ccc
add esp, 4
mov edx, dword [0x5c2e6c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
mov eax, dword [0x5c2a20]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x410b84
push 0x40005
call fcn.00406ccc
add esp, 4
mov ecx, dword [0x5c2e6c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
mov edx, dword [0x5c2e6c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x410e69
mov eax, dword [0x5c2e6c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x410e69
mov ecx, dword [ebp - 0x14]
sub ecx, 1
mov dword [ebp - 0x14], ecx
jmp 0x410bbf
mov edx, dword [ebp - 0x14]
sub edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [0x5c2e6c]
add eax, dword [ebp - 0x14]
xor ecx, ecx
mov cl, byte [eax]
cmp ecx, 0xa
je 0x410bd2
jmp 0x410bb6
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
jmp 0x410be6
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [0x5c2e6c]
add ecx, dword [ebp - 0x14]
xor edx, edx
mov dl, byte [ecx]
cmp edx, 0x14
jne 0x410bfa
jmp 0x410bdd
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x410c13
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 3
jae 0x410c61
mov ecx, dword [ebp - 0x14]
add ecx, dword [ebp - 0x18]
mov edx, dword [0x5c2e6c]
xor eax, eax
mov al, byte [edx + ecx]
mov ecx, dword [ebp - 0x18]
xor edx, edx
mov dl, byte [ebp + ecx - 0x10]
cmp eax, edx
je 0x410c5f
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0x18]
mov ecx, dword [0x5c2e6c]
xor edx, edx
mov dl, byte [ecx + eax]
mov eax, dword [ebp - 0x18]
xor ecx, ecx
mov cl, byte [ebp + eax - 0x10]
sub ecx, 0x20
cmp edx, ecx
je 0x410c5f
mov dword [ebp - 4], 1
jmp 0x410c0a
cmp dword [ebp - 4], 1
jne 0x410c9e
cmp dword [ebp + 8], 1
jne 0x410c9e
mov edx, dword [0x5c2e6c]
push edx
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.00410e6f
add esp, 0xc
cmp eax, 0xffffffff
jne 0x410c9e
mov edx, dword [0x5c2e6c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
cmp dword [ebp - 4], 1
jne 0x410cbd
cmp dword [ebp + 8], 0
jne 0x410cbd
mov eax, dword [0x5c2e6c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x410e69
cmp dword [ebp - 4], 0
jne 0x410cdd
cmp dword [ebp + 8], 1
jne 0x410cdd
mov ecx, dword [0x5c2e6c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x410e69
cmp dword [ebp - 4], 0
jne 0x410e5a
cmp dword [ebp + 8], 0
jne 0x410e5a
jmp 0x410cfc
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x1c]
jae 0x410d1d
mov ecx, dword [0x5c2e6c]
add ecx, dword [ebp - 0x14]
mov edx, dword [0x5c2e6c]
add edx, dword [ebp - 0x14]
mov al, byte [edx + 4]
mov byte [ecx], al
jmp 0x410cf3
mov ecx, dword [ebp - 0x14]
sub ecx, 4
mov dword [ebp - 0x14], ecx
mov edx, dword [0x5c2e6c]
add edx, dword [ebp - 0x14]
mov byte [edx], 0xd
mov eax, dword [0x5c2e6c]
add eax, dword [ebp - 0x14]
mov byte [eax + 1], 0xa
mov ecx, dword [ebp - 0x14]
add ecx, 2
mov dword [ebp - 0x14], ecx
push 0x200
push 0x5c2a40
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x533848
push 0x5c2a40
call fcn.004202e0
add esp, 8
push 0x53384c
push 0x5c2a40
call fcn.004202e0
add esp, 8
push 0x5c2a40
call fcn.00408b00
add esp, 4
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push 0x5c2a40
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x5c2a20], eax
cmp dword [0x5c2a20], 0xffffffff
jne 0x410dd5
push 0x40003
call fcn.00406ccc
add esp, 4
mov edx, dword [0x5c2e6c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
push 0
lea eax, [ebp - 8]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [0x5c2e6c]
push edx
mov eax, dword [0x5c2a20]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x410e1a
push 0x40003
call fcn.00406ccc
add esp, 4
mov ecx, dword [0x5c2e6c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
mov edx, dword [0x5c2a20]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x410e49
push 0x40005
call fcn.00406ccc
add esp, 4
mov eax, dword [0x5c2e6c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x410e69
mov ecx, dword [0x5c2e6c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x410e69
mov edx, dword [0x5c2e6c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret