Function at 0x30012218
Capabilities:
Accept command line arguments
Query environment variable
Set environment variable

Disassembly:
push ebp
sub esp, 0x294
lea ebp, [esp - 4]
mov eax, dword [0x3003a6b0]
xor eax, ebp
mov dword [ebp + 0x294], eax
push 4
mov eax, 0x3002d290
call fcn.300153a4
push 8
xor ebx, ebx
push ebx
mov esi, 0x3003419c
push esi
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov dword [ebp - 0x10], eax
cmp eax, ebx
jne 0x3001244e
push 7
pop edi
xor eax, eax
mov dword [ebp + 0x84], edi
mov dword [ebp + 0x80], ebx
mov word [ebp + 0x70], ax
lea eax, [ebp - 0x10]
push eax
push 0x3003c598
push 4
mov dword [ebp - 4], ebx
mov dword [ebp - 0x10], ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleExW]
xor eax, eax
push 0x206
mov word [ebp + 0x8c], ax
lea eax, [ebp + 0x8e]
push ebx
push eax
call fcn.30014dd0
add esp, 0xc
push 0x104
lea eax, [ebp + 0x8c]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
xor eax, eax
mov word [ebp + 0x54], ax
lea eax, [ebp + 0x8c]
push eax
lea ecx, [ebp + 0x54]
mov dword [ebp + 0x68], edi
mov dword [ebp + 0x64], ebx
call fcn.300010f0
xor edi, edi
inc edi
push edi
push 0xffffffffffffffff
push 0x3003408c
lea ecx, [ebp + 0x54]
mov byte [ebp - 4], 1
call fcn.300072e0
cmp eax, 0xffffffff
je 0x30012333
push eax
push ebx
lea eax, [ebp + 0x1c]
push eax
lea ecx, [ebp + 0x54]
call fcn.30001120
push 0x30034084
push eax
lea eax, [ebp]
push eax
mov byte [ebp - 4], 2
call fcn.30007370
add esp, 0xc
push eax
lea ecx, [ebp + 0x70]
mov byte [ebp - 4], 3
call fcn.300013e0
push ebx
push edi
lea ecx, [ebp]
call fcn.30002110
push ebx
push edi
lea ecx, [ebp + 0x1c]
call fcn.30002110
push ebx
push edi
lea ecx, [ebp + 0x54]
mov byte [ebp - 4], bl
call fcn.30002110
cmp dword [ebp + 0x80], ebx
je 0x300123f3
mov edi, 0xfffe
push edi
call fcn.3001382b
push edi
push ebx
push eax
mov dword [ebp - 0x10], eax
call fcn.30014dd0
add esp, 0x10
push 0x7fff
push dword [ebp - 0x10]
mov edi, str.Path
push edi
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
push dword [ebp - 0x10]
lea ecx, [ebp + 0x54]
call fcn.30002000
push dword [ebp - 0x10]
mov byte [ebp - 4], 4
call fcn.300145dd
cmp dword [ebp + 0x84], 8
mov eax, dword [ebp + 0x70]
pop ecx
jae 0x300123a0
lea eax, [ebp + 0x70]
push dword [ebp + 0x80]
lea ecx, [ebp + 0x54]
push ebx
push eax
call fcn.30006c00
cmp eax, 0xffffffff
jne 0x300123e5
push 0x30034084
lea ecx, [ebp + 0x54]
call fcn.30002770
push 0xffffffffffffffff
push ebx
lea eax, [ebp + 0x70]
push eax
lea ecx, [ebp + 0x54]
call fcn.30002670
cmp dword [ebp + 0x68], 8
mov eax, dword [ebp + 0x54]
jae 0x300123dd
lea eax, [ebp + 0x54]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
push ebx
push 1
lea ecx, [ebp + 0x54]
mov byte [ebp - 4], bl
call fcn.30002110
mov edi, dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
push 8
push ebx
push esi
call edi
mov dword [ebp - 0x10], eax
cmp eax, ebx
jne 0x3001243f
cmp dword [ebp + 0x84], 8
mov eax, dword [ebp + 0x70]
jae 0x30012415
lea eax, [ebp + 0x70]
mov edx, dword [ebp + 0x80]
push 0x5c
pop ecx
mov word [eax + edx*2 - 2], cx
push esi
lea ecx, [ebp + 0x70]
call fcn.30002770
lea eax, [ebp + 0x70]
push eax
call fcn.3002afa0
pop ecx
push 8
push ebx
push esi
call edi
mov dword [ebp - 0x10], eax
or dword [ebp - 4], 0xffffffff
push ebx
push 1
lea ecx, [ebp + 0x70]
call fcn.30002110
lea eax, [ebp + 0x38]
push eax
call fcn.30011cb0
pop ecx
cmp dword [ebp + 0x4c], 0x10
mov eax, dword [ebp + 0x38]
mov dword [ebp - 4], 5
jae 0x3001246b
lea eax, [ebp + 0x38]
push eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
jne 0x300124aa
push ebx
push 1
lea ecx, [ebp + 0x38]
call fcn.30001a80
or eax, 0xffffffff
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x294]
xor ecx, ebp
call fcn.30014dbb
add ebp, 0x298
leave
ret
call eax
mov esi, eax
cmp esi, ebx
jne 0x300124c4
or esi, 0xffffffff
push ebx
push 1
lea ecx, [ebp + 0x38]
call fcn.30001a80
mov eax, esi
jmp 0x30012487
mov eax, dword [esi]
push 1
push ebx
mov ecx, esi
call dword [eax]
push dword [ebp + 0x2a8]
mov edi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
mov ecx, esi
call dword [edi + 0x10]
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 4]
xor esi, esi
jmp 0x300124b5