Function at 0x40d4a8
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 [0x51e328]
mov word [ebp - 0x10], ax
mov cl, byte [0x51e32a]
mov byte [ebp - 0xe], cl
mov ecx, 0xa
mov esi, 0x51e32c
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 [0x5a2a8c], eax
cmp dword [0x5a2a8c], 0
jne 0x40d500
push 5
call fcn.0040435c
add esp, 4
or eax, 0xffffffff
jmp 0x40db87
push 0x200
push 0x5a2660
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x51e358
push 0x5a2660
call fcn.0041bfb0
add esp, 8
push 0x5a2660
push 0x5a2880
call fcn.0041bfa0
add esp, 8
push 0x51e35c
push 0x5a2660
call fcn.0041bfb0
add esp, 8
push 0x51e368
push 0x5a2880
call fcn.0041bfb0
add esp, 8
cmp dword [ebp + 8], 0
jne 0x40d572
push 0
push 0x5a2880
push 0x5a2660
call fcn.00406177
add esp, 0xc
push 0
push 0x80
push 4
push 0
push 1
push 0x80000000
push 0x5a2660
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x5a2640], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x40d5a9
push 0
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [0x5a2640], 0xffffffff
jne 0x40d5d4
push 0x40003
call fcn.0040435c
add esp, 4
mov edx, dword [0x5a2a8c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
push 0
lea eax, [ebp - 0x1c]
push eax
push 0x270f
mov ecx, dword [0x5a2a8c]
push ecx
mov edx, dword [0x5a2640]
push edx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x40d62a
push 0x4000a
call fcn.0040435c
add esp, 4
mov eax, dword [0x5a2a8c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [0x5a2640]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or eax, 0xffffffff
jmp 0x40db87
mov edx, dword [0x5a2640]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40d65c
push 0x40005
call fcn.0040435c
add esp, 4
mov eax, dword [0x5a2a8c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
mov dword [ebp - 4], 1
mov dword [ebp - 0x14], 0
jmp 0x40d675
mov ecx, dword [ebp - 0x14]
add ecx, 1
mov dword [ebp - 0x14], ecx
mov edx, dword [ebp - 0x14]
cmp edx, dword [ebp - 0x1c]
jae 0x40d6e3
cmp dword [ebp - 4], 1
jne 0x40d6e3
mov eax, dword [0x5a2a8c]
add eax, dword [ebp - 0x14]
xor ecx, ecx
mov cl, byte [eax]
movsx edx, byte [0x51dbc4]
cmp ecx, edx
jne 0x40d6e1
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x40d6b3
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xb
jae 0x40d6e1
mov ecx, dword [ebp - 0x14]
add ecx, dword [ebp - 0x18]
mov edx, dword [0x5a2a8c]
xor eax, eax
mov al, byte [edx + ecx]
mov ecx, dword [ebp - 0x18]
movsx edx, byte [ecx + 0x51dbc4]
cmp eax, edx
je 0x40d6df
mov dword [ebp - 4], 1
jmp 0x40d6aa
jmp 0x40d66c
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x1c]
jne 0x40d8c9
cmp dword [ebp - 4], 1
jne 0x40d8c9
cmp dword [ebp + 8], 0
jne 0x40d8b6
mov ecx, dword [0x5a2a8c]
add ecx, dword [ebp - 0x1c]
xor edx, edx
mov dl, byte [ecx - 1]
cmp edx, 0x1a
jne 0x40d721
mov eax, dword [ebp - 0x1c]
sub eax, 1
mov dword [ebp - 0x1c], eax
jmp 0x40d74a
mov ecx, dword [0x5a2a8c]
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 [0x5a2a8c]
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 0x40d76b
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 0x40d78c
mov ecx, dword [0x5a2a8c]
add ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x18]
mov al, byte [ebp + edx - 0x48]
mov byte [ecx], al
jmp 0x40d759
mov ecx, dword [0x5a2a8c]
add ecx, dword [ebp - 0x14]
mov byte [ecx], 0xd
mov edx, dword [0x5a2a8c]
add edx, dword [ebp - 0x14]
mov byte [edx + 1], 0xa
push 0x200
push 0x5a2660
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x51e374
push 0x5a2660
call fcn.0041bfb0
add esp, 8
push 0x51e378
push 0x5a2660
call fcn.0041bfb0
add esp, 8
push 0
push 0x80
push 4
push 0
push 0
push 0xc0000000
push 0x5a2660
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x5a2640], eax
cmp dword [0x5a2640], 0xffffffff
jne 0x40d825
push 0x40003
call fcn.0040435c
add esp, 4
mov eax, dword [0x5a2a8c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
push 0
lea ecx, [ebp - 0x1c]
push ecx
mov edx, dword [ebp - 0x14]
add edx, 1
push edx
mov eax, dword [0x5a2a8c]
push eax
mov ecx, dword [0x5a2640]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x40d870
push 0x40004
call fcn.0040435c
add esp, 4
mov edx, dword [0x5a2a8c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
mov eax, dword [0x5a2640]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40d8a2
push 0x40005
call fcn.0040435c
add esp, 4
mov ecx, dword [0x5a2a8c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
mov edx, dword [0x5a2a8c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40db87
mov eax, dword [0x5a2a8c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40db87
mov ecx, dword [ebp - 0x14]
sub ecx, 1
mov dword [ebp - 0x14], ecx
jmp 0x40d8dd
mov edx, dword [ebp - 0x14]
sub edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [0x5a2a8c]
add eax, dword [ebp - 0x14]
xor ecx, ecx
mov cl, byte [eax]
cmp ecx, 0xa
je 0x40d8f0
jmp 0x40d8d4
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
jmp 0x40d904
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [ebp - 0x14], eax
mov ecx, dword [0x5a2a8c]
add ecx, dword [ebp - 0x14]
xor edx, edx
mov dl, byte [ecx]
cmp edx, 0x14
jne 0x40d918
jmp 0x40d8fb
mov dword [ebp - 4], 0
mov dword [ebp - 0x18], 0
jmp 0x40d931
mov eax, dword [ebp - 0x18]
add eax, 1
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 3
jae 0x40d97f
mov ecx, dword [ebp - 0x14]
add ecx, dword [ebp - 0x18]
mov edx, dword [0x5a2a8c]
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 0x40d97d
mov eax, dword [ebp - 0x14]
add eax, dword [ebp - 0x18]
mov ecx, dword [0x5a2a8c]
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 0x40d97d
mov dword [ebp - 4], 1
jmp 0x40d928
cmp dword [ebp - 4], 1
jne 0x40d9bc
cmp dword [ebp + 8], 1
jne 0x40d9bc
mov edx, dword [0x5a2a8c]
push edx
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
call fcn.0040db8d
add esp, 0xc
cmp eax, 0xffffffff
jne 0x40d9bc
mov edx, dword [0x5a2a8c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
cmp dword [ebp - 4], 1
jne 0x40d9db
cmp dword [ebp + 8], 0
jne 0x40d9db
mov eax, dword [0x5a2a8c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40db87
cmp dword [ebp - 4], 0
jne 0x40d9fb
cmp dword [ebp + 8], 1
jne 0x40d9fb
mov ecx, dword [0x5a2a8c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40db87
cmp dword [ebp - 4], 0
jne 0x40db78
cmp dword [ebp + 8], 0
jne 0x40db78
jmp 0x40da1a
mov edx, dword [ebp - 0x14]
add edx, 1
mov dword [ebp - 0x14], edx
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x1c]
jae 0x40da3b
mov ecx, dword [0x5a2a8c]
add ecx, dword [ebp - 0x14]
mov edx, dword [0x5a2a8c]
add edx, dword [ebp - 0x14]
mov al, byte [edx + 4]
mov byte [ecx], al
jmp 0x40da11
mov ecx, dword [ebp - 0x14]
sub ecx, 4
mov dword [ebp - 0x14], ecx
mov edx, dword [0x5a2a8c]
add edx, dword [ebp - 0x14]
mov byte [edx], 0xd
mov eax, dword [0x5a2a8c]
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 0x5a2660
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
push 0x51e384
push 0x5a2660
call fcn.0041bfb0
add esp, 8
push 0x51e388
push 0x5a2660
call fcn.0041bfb0
add esp, 8
push 0x5a2660
call fcn.00406151
add esp, 4
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
push 0x5a2660
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [0x5a2640], eax
cmp dword [0x5a2640], 0xffffffff
jne 0x40daf3
push 0x40003
call fcn.0040435c
add esp, 4
mov edx, dword [0x5a2a8c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
push 0
lea eax, [ebp - 8]
push eax
mov ecx, dword [ebp - 0x14]
push ecx
mov edx, dword [0x5a2a8c]
push edx
mov eax, dword [0x5a2640]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x40db38
push 0x40003
call fcn.0040435c
add esp, 4
mov ecx, dword [0x5a2a8c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
mov edx, dword [0x5a2640]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
jne 0x40db67
push 0x40005
call fcn.0040435c
add esp, 4
mov eax, dword [0x5a2a8c]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
or eax, 0xffffffff
jmp 0x40db87
mov ecx, dword [0x5a2a8c]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
jmp 0x40db87
mov edx, dword [0x5a2a8c]
push edx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret