Function at 0x100cfc0
Capabilities:
Print debug messages
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x33c
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [ebp + 8]
cmp byte [esi + 0x30], 0
mov ebx, eax
mov dword [ebp - 0x10], ebx
je 0x100d26e
mov eax, dword [esi + 0x34]
mov ecx, eax
shr ecx, 0x11
mov edx, eax
shr edx, 0x10
and cl, 1
and dl, 1
test cl, cl
mov byte [ebp - 2], cl
mov byte [ebp - 1], dl
jne 0x100d004
test dl, dl
je 0x100d02b
mov ecx, 0xffff
and eax, ecx
sub eax, 0
je 0x100d025
dec eax
je 0x100d01f
dec eax
jne 0x100d02b
test byte [ebp + 0xc], 7
setne al
jmp 0x100d027
test byte [ebp + 0xc], 3
jmp 0x100d01a
xor al, al
test al, al
jne 0x100d037
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x100d26e
mov eax, dword [ebp + 0xc]
and eax, ecx
cmp eax, 1
jne 0x100d04a
mov dword [ebp - 8], 0x1005ebc
jmp 0x100d06b
cmp eax, 2
jne 0x100d058
mov dword [ebp - 8], 0x1005ea4
jmp 0x100d06b
cmp eax, 4
mov dword [ebp - 8], 0x1005e8c
je 0x100d06b
mov dword [ebp - 8], 0x1005e54
push edi
lea eax, [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
movzx eax, word [ebp - 0x22]
push eax
movzx eax, word [ebp - 0x24]
push eax
movzx eax, word [ebp - 0x26]
push eax
movzx eax, word [ebp - 0x28]
push eax
movzx eax, word [ebp - 0x30]
push eax
movzx eax, word [ebp - 0x2a]
push eax
movzx eax, word [ebp - 0x2e]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
lea eax, [ebp - 0x130]
push 0x1005e00
push eax
call dword [sym.imp.msvcrt.dll_swprintf]
add esp, 0x2c
push 0x1000
push 0x40
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, eax
test edi, edi
mov dword [ebp - 0xc], edi
jne 0x100d0de
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x100d26d
lea eax, [ebp + 0x14]
push eax
push dword [ebp + 0x10]
push edi
call dword [sym.imp.USER32.dll_wvsprintfW]
cmp byte [ebp - 2], 0
mov ebx, 0x1005df4
je 0x100d114
mov esi, dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
lea eax, [ebp - 0x130]
push eax
call esi
push dword [ebp - 8]
call esi
push edi
call esi
push ebx
call esi
mov esi, dword [ebp + 8]
cmp byte [ebp - 1], 0
je 0x100d25d
add esi, 0x18
push esi
push 0x1005db8
lea eax, [ebp - 0x20]
push eax
call fcn.0100aab8
lea ecx, [ebp - 0x20]
call fcn.0100a9d4
test al, al
lea ecx, [ebp - 0x20]
je 0x100d27e
push 0x105
lea eax, [ebp - 0x33c]
push eax
call fcn.0100a9d1
push eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
je 0x100d272
cmp eax, 0x104
ja 0x100d272
push 0
push 0x80
push 4
push 0
push 1
push 0x40000000
lea eax, [ebp - 0x33c]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp + 8], edi
jne 0x100d1a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x100d1ce
push 2
xor esi, esi
push esi
push esi
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x100d1de
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp edi, esi
je 0x100d1ce
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x20]
call fcn.0100aa1e
push dword [ebp - 0xc]
jmp 0x100d267
push esi
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenW]
lea eax, [ebp - 0x14]
push eax
lea eax, [ebp - 0x130]
push eax
call esi
shl eax, 1
push eax
lea eax, [ebp - 0x130]
push eax
push edi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
call edi
push 0
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 8]
call esi
shl eax, 1
push eax
push dword [ebp - 8]
push dword [ebp + 8]
call edi
push 0
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0xc]
call esi
shl eax, 1
push eax
push dword [ebp - 0xc]
push dword [ebp + 8]
call edi
push 0
lea eax, [ebp - 0x14]
push eax
push ebx
call esi
shl eax, 1
push eax
push ebx
push dword [ebp + 8]
call edi
cmp dword [ebp + 8], 0
je 0x100d252
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x20]
call fcn.0100aa1e
mov edi, dword [ebp - 0xc]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetLastError]
push edi
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop edi
pop esi
pop ebx
leave
ret
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetLastError]
lea ecx, [ebp - 0x20]
call fcn.0100aa1e
jmp 0x100d266