Function at 0x1004aa3
Capabilities:
Check os version
Get common file path
Get file size
Get system information on windows
Set current directory
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x974
mov eax, dword [0x1009004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0xffffffffffffffec
push dword [0x10095a0]
xor ebx, ebx
mov dword [ebp - 0x93c], ebx
mov dword [ebp - 0x948], ebx
call dword [sym.imp.USER32.dll_GetWindowLongW]
mov esi, eax
and esi, 0x400000
cmp dword [0x1009be8], ebx
je 0x1005207
cmp dword [0x1009bcc], ebx
je 0x1005207
cmp word [0x10097bc], bx
je 0x1004b07
push 0x10097bc
jmp 0x1004b23
push ebx
push 0x2e
lea eax, [ebp - 0x414]
push eax
push ebx
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
test eax, eax
je 0x1004b29
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push ebx
push 0x80
push 4
push ebx
push 1
push 0xc0000000
push 0x10095b4
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x940], edi
cmp edi, 0xffffffff
jne 0x1004b63
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x22
call fcn.01005799
jmp 0x100520e
cmp dword [0x1009be4], ebx
je 0x1004b7e
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
jmp 0x1004b89
push 2
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [0x1009be4], ebx
jne 0x1004b9d
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
jne 0x1004bd1
mov eax, 0xfeff
push ebx
mov word [ebp - 0x414], ax
lea eax, [ebp - 0x944]
push eax
push 2
lea eax, [ebp - 0x414]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004bd1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push 0x23
mov edi, 0x208
push edi
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004c20
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push 0x32
push 0x104
lea eax, [ebp - 0x61c]
push eax
call fcn.01005682
push ebx
neg esi
push ebx
sbb esi, esi
push ebx
and esi, 0x20
inc esi
push ebx
push esi
mov dword [ebp - 0x950], esi
mov esi, 0x400
push esi
call dword [sym.imp.KERNEL32.dll_GetDateFormatW]
mov dword [ebp - 0x94c], eax
cmp eax, ebx
je 0x1004cd9
lea eax, [eax + eax + 2]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x948], eax
cmp eax, ebx
je 0x1004cd9
push dword [ebp - 0x94c]
push eax
push ebx
push ebx
push dword [ebp - 0x950]
push esi
call dword [sym.imp.KERNEL32.dll_GetDateFormatW]
test eax, eax
je 0x1004cbf
push dword [ebp - 0x948]
lea eax, [ebp - 0x61c]
push 0x104
push eax
call fcn.0100170e
cmp eax, ebx
jge 0x1004cbf
cmp eax, 0x8007007a
je 0x1004cbf
xor eax, eax
mov word [ebp - 0x61c], ax
push dword [ebp - 0x948]
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov dword [ebp - 0x948], ebx
push ebx
push ebx
push ebx
push ebx
push 2
push esi
call dword [sym.imp.KERNEL32.dll_GetTimeFormatW]
mov dword [ebp - 0x94c], eax
cmp eax, ebx
je 0x1004d20
lea eax, [eax + eax + 2]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0x948], eax
cmp eax, ebx
je 0x1004d20
push dword [ebp - 0x94c]
push eax
push ebx
push ebx
push 2
push esi
call dword [sym.imp.KERNEL32.dll_GetTimeFormatW]
push 0x24
push 0x104
lea eax, [ebp - 0x824]
push eax
call fcn.01005682
lea eax, [ebp - 0x61c]
cmp dword [ebp - 0x948], ebx
je 0x1004d77
push dword [ebp - 0x948]
push eax
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x414]
push edi
push eax
call fcn.01003257
add esp, 0x14
push dword [ebp - 0x948]
mov esi, eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
jmp 0x1004d98
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x824]
push eax
lea eax, [ebp - 0x414]
push edi
push eax
call fcn.01003257
add esp, 0x14
mov esi, eax
cmp esi, ebx
jge 0x1004da4
cmp esi, 0x8007007a
jne 0x1004de3
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004de9
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
jmp 0x1004de9
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
push 0x2d
push edi
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004e2f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push 0x114
lea eax, [ebp - 0x938]
push ebx
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x938]
push eax
mov dword [ebp - 0x938], 0x114
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
mov eax, dword [ebp - 0x928]
dec eax
dec eax
lea eax, [ebp - 0x414]
je 0x1004e6f
push 0x32
jmp 0x1004e71
push 0x2f
push edi
push eax
call fcn.01005682
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004eaf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
cmp dword [ebp - 0x928], 2
jne 0x1004f6a
push 9
pop ecx
xor eax, eax
lea edi, [ebp - 0x974]
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x974]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
push 0x410
lea eax, [ebp - 0x414]
push ebx
push eax
call sub.msvcrt.dll_memset
movzx eax, word [ebp - 0x974]
add esp, 0xc
cmp eax, ebx
je 0x1004f08
cmp eax, 6
je 0x1004f04
cmp eax, 9
jne 0x1004f1b
push 0x5c
jmp 0x1004f0a
push 0x5b
jmp 0x1004f0a
push 0x5a
push 0x208
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
cmp word [ebp - 0x414], bx
je 0x1004f5f
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004f5f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, 0x208
push 0x2e
push 0x104
lea eax, [ebp - 0x61c]
push eax
call fcn.01005682
lea eax, [ebp - 0x924]
push eax
movzx eax, word [ebp - 0x92c]
push eax
push dword [ebp - 0x930]
lea eax, [ebp - 0x61c]
push dword [ebp - 0x934]
push eax
lea eax, [ebp - 0x414]
push edi
push eax
call fcn.01003257
add esp, 0x1c
cmp eax, ebx
jge 0x1004fba
cmp eax, 0x8007007a
jne 0x1004ff1
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1004ff1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push 0x49
push 0x104
lea eax, [ebp - 0x61c]
push eax
call fcn.01005682
mov eax, dword [0x1009bd8]
mov ecx, dword [0x1009be0]
mov edx, eax
sub edx, ecx
sub edx, dword [0x1009bdc]
push edx
push ecx
push dword [0x1009bdc]
push eax
lea eax, [ebp - 0x61c]
push eax
lea eax, [ebp - 0x414]
push edi
push eax
call fcn.01003257
add esp, 0x1c
cmp eax, ebx
jge 0x1005044
cmp eax, 0x8007007a
jne 0x100507b
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x100507b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push 0x27
push edi
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10050c1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push 0x28
push edi
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1005107
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push dword [ebp - 0x940]
call fcn.01004463
test eax, eax
jne 0x1005122
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
mov eax, dword [0x1009bdc]
mov ecx, dword [0x1009be0]
add ecx, eax
cmp dword [0x1009bd8], ecx
jbe 0x10051e2
push 0x29
push edi
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x1005181
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push 0x45
push edi
lea eax, [ebp - 0x414]
push eax
call fcn.01005682
push ebx
lea eax, [ebp - 0x944]
push eax
lea eax, [ebp - 0x414]
push eax
call esi
add eax, eax
push eax
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x10051c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push dword [ebp - 0x940]
call fcn.01004191
test eax, eax
jne 0x10051e2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x93c], eax
push dword [ebp - 0x940]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x93c]
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
cmp dword [ebp - 0x93c], ebx
sete al
jmp 0x1005210
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.01007194
leave
ret