Function at 0x107bd1e
Capabilities:
Check os version
Get common file path
Query environment variable
Read file on windows
Shutdown system
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x4dc
mov eax, dword [0x1099a38]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x1c]
push ebx
mov dword [ebp - 0x4c8], eax
xor ebx, ebx
push esi
xor eax, eax
cmp dword [ebp + 0x18], ebx
push edi
mov dword [ebp - 0x4cc], 0x10
je 0x107bd5d
cmp dword [ebp + 0x14], ebx
setne al
add eax, 0x80020016
jmp 0x107bd68
cmp dword [ebp + 0x14], ebx
setne al
add eax, 0x80020010
mov dword [ebp - 0x4bc], eax
push 0x104
lea eax, [ebp - 0x108]
push eax
push 0x1027ac4
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x107bed8
push ebx
push ebx
push 3
push ebx
push 7
push 0xc0000000
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x4c4], eax
je 0x107bed8
push ebx
lea ecx, [ebp - 0x4c0]
push ecx
mov esi, 0x314
push esi
lea ecx, [ebp - 0x4b8]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x107bebe
cmp dword [ebp - 0x4c0], esi
jne 0x107bebe
cmp dword [ebp - 0x4b8], 0x6e776453
jne 0x107bebe
mov edx, 0x10000
cmp dword [ebp - 0x4b4], edx
jb 0x107bebe
xor eax, eax
cmp dword [ebp + 8], ebx
mov ecx, 0xc5
lea edi, [ebp - 0x4b8]
rep stosd dword es:[edi], eax
mov eax, dword [ebp - 0x4bc]
mov dword [ebp - 0x4b8], 0x6e776453
mov dword [ebp - 0x4b4], edx
mov dword [ebp - 0x4ac], eax
je 0x107be3d
or dword [ebp - 0x4b0], 1
cmp dword [ebp + 0xc], ebx
je 0x107be49
or dword [ebp - 0x4b0], 2
cmp dword [ebp + 0x10], ebx
je 0x107be55
or dword [ebp - 0x4b0], 0x10
push 0x1ff
push dword [ebp - 0x4c8]
lea eax, [ebp - 0x4a8]
push eax
call sub.msvcrt.dll_strncpy
push 0x103
lea eax, [ebp - 0x2a8]
push 0x10f6840
push eax
call sub.msvcrt.dll_strncpy
add esp, 0x18
push ebx
push ebx
push ebx
push dword [ebp - 0x4c4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push ebx
lea eax, [ebp - 0x4c0]
push eax
push esi
lea eax, [ebp - 0x4b8]
push eax
push dword [ebp - 0x4c4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edi, eax
cmp edi, ebx
je 0x107bec0
cmp dword [ebp - 0x4c0], esi
je 0x107bec0
xor edi, edi
push dword [ebp - 0x4c4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, ebx
je 0x107bed8
xor eax, eax
inc eax
jmp 0x107c0b2
push 0x1027ab0
push ebx
push 0x100000
call dword [sym.imp.KERNEL32.dll_OpenEventA]
mov edi, eax
cmp edi, ebx
je 0x107bf04
push 0xea60
push edi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x107bf1b
cmp dword [ebp + 0x10], ebx
je 0x107bf10
push 0xea60
jmp 0x107bf15
push 0x2710
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x4cc]
push eax
lea eax, [ebp - 0x4dc]
push eax
push ebx
push 0x13
call fcn.010713ac
test eax, eax
jne 0x107bf46
push 0x1027a80
call fcn.01071aad
xor eax, eax
jmp 0x107c0b2
mov edi, dword [sym.imp.KERNEL32.dll_GetVersionExA]
lea eax, [ebp - 0x1a4]
push eax
mov dword [ebp - 0x1a4], 0x94
call edi
cmp dword [ebp - 0x1a0], 4
jbe 0x107bf7b
lea eax, [ebp - 0x1a4]
push eax
mov dword [ebp - 0x1a4], 0x9c
call edi
mov eax, dword [0x10f54ac]
cmp eax, ebx
je 0x107bf94
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x107c017
mov esi, 0xbb8
cmp dword [ebp - 0x1a0], 5
jne 0x107bfd0
cmp dword [ebp - 0x19c], 1
jb 0x107bfd0
mov eax, dword [0x10bd070]
cmp eax, ebx
je 0x107bfcc
push dword [ebp - 0x4bc]
push dword [ebp + 8]
push dword [ebp + 0xc]
push ebx
push dword [ebp - 0x4c8]
push ebx
call eax
jmp 0x107bfdf
xor edi, edi
jmp 0x107bfe1
push dword [ebp + 8]
push dword [ebp + 0xc]
push ebx
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_InitiateSystemShutdownA]
mov edi, eax
cmp edi, ebx
jne 0x107c0a4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x45b
je 0x107c017
cmp eax, 0x4f7
je 0x107c002
cmp eax, 0x15
jne 0x107c02a
mov eax, dword [0x10f54ac]
cmp eax, ebx
push esi
je 0x107c01f
push eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
jne 0x107bf99
xor edi, edi
inc edi
jmp 0x107c0a4
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x107bf99
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x1027a4c
call fcn.01071ac0
test byte [ebp - 0x10c], 0x40
pop ecx
pop ecx
je 0x107c0a4
push 0xfffa
mov esi, 0x1106960
push esi
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x107c0a4
push 0x5c
push esi
call sub.msvcrt.dll_strchr
pop ecx
pop ecx
push ebx
push 0x2000000
push 3
push ebx
push 7
push 0xc0000000
push esi
mov byte [eax + 1], bl
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x107c0a4
push esi
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push esi
mov edi, eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp edi, ebx
je 0x107c0a4
push 1
call dword [sym.imp.ntdll.dll_NtShutdownSystem]
mov edi, eax
lea eax, [ebp - 0x4dc]
push eax
call fcn.010778f2
mov eax, edi
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.0106bc50
leave
ret 0x18