Function at 0x10031765
Capabilities:
Accept command line arguments
Check mutex on windows
Create process on windows
Query environment variable
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x694
push edi
mov byte [ebp - 8], 1
mov eax, dword [0x1003b05c]
xor eax, dword [0x1003b048]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 0x1003b250
lea ecx, [ebp - 0x10c]
push ecx
call fcn.10034f9f
add esp, 0x10
lea edx, [ebp - 0x10c]
push edx
push 0
push 0x1f0001
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
test eax, eax
je 0x100317b6
mov byte [ebp - 8], 0
mov eax, dword [ebp - 8]
and eax, 0xff
test eax, eax
je 0x1003195e
mov ecx, dword [0x1003b044]
xor ecx, dword [0x1003b04c]
xor ecx, dword [0x1003b06c]
and ecx, 0x20
test ecx, ecx
je 0x1003195e
mov edx, dword [0x1003b068]
xor edx, dword [0x1003b03c]
xor edx, dword [0x1003b05c]
push edx
push str.RN_08X
lea eax, [ebp - 0x10c]
push eax
call fcn.10034f9f
add esp, 0xc
lea ecx, [ebp - 0x10c]
push ecx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov dword [ebp - 0x110], eax
cmp dword [ebp - 0x110], 0
je 0x1003195e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x1003195e
push 0x7530
mov edx, dword [ebp - 0x110]
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov dword [ebp - 0x114], eax
cmp dword [ebp - 0x114], 0
je 0x10031870
cmp dword [ebp - 0x114], 0x80
jne 0x10031954
mov eax, dword [0x1003b068]
xor eax, dword [0x1003b03c]
xor eax, dword [0x1003b05c]
push eax
push 0x1003b264
lea ecx, [ebp - 0x10c]
push ecx
call fcn.10034f9f
add esp, 0xc
mov dword [ebp - 0x11c], 0
jmp 0x100318b1
mov edx, dword [ebp - 0x11c]
add edx, 1
mov dword [ebp - 0x11c], edx
cmp dword [ebp - 0x11c], 0x12c
jge 0x100318ea
lea eax, [ebp - 0x10c]
push eax
push str.MainClass
call dword [sym.imp.USER32.dll_FindWindowA]
mov dword [ebp - 0x118], eax
cmp dword [ebp - 0x118], 0
je 0x100318e0
jmp 0x100318ea
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x100318a2
cmp dword [ebp - 0x118], 0
je 0x10031947
mov ecx, dword [0x1003b068]
xor ecx, dword [0x1003b03c]
xor ecx, dword [0x1003b05c]
mov dword [ebp - 0x128], ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push eax
call fcn.10035000
add esp, 4
add eax, 1
mov dword [ebp - 0x124], eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov dword [ebp - 0x120], eax
lea edx, [ebp - 0x128]
push edx
push 0
push 0x4a
mov eax, dword [ebp - 0x118]
push eax
call dword [sym.imp.USER32.dll_SendMessageA]
mov ecx, dword [ebp - 0x110]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, 1
jmp 0x10031cdf
push 1
call fcn.10031ce4
add esp, 4
mov edx, dword [ebp - 8]
and edx, 0xff
test edx, edx
je 0x10031b47
mov eax, dword [0x1003b044]
xor eax, dword [0x1003b04c]
xor eax, dword [0x1003b06c]
and eax, 0x40
test eax, eax
jne 0x10031b47
push 0x200
lea ecx, [ebp - 0x328]
push ecx
push str._PAD64
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
jne 0x10031b47
push 0xc8
push 0x23
lea edx, [ebp - 0x328]
push edx
call fcn.10034f10
add esp, 0xc
mov byte [ebp - 0x260], 0
mov dword [ebp - 0x42c], 1
jmp 0x100319ec
mov eax, dword [ebp - 0x42c]
add eax, 1
mov dword [ebp - 0x42c], eax
cmp dword [ebp - 0x42c], 0x40
jg 0x10031a26
mov ecx, dword [ebp - 0x42c]
push ecx
push str._PAD_d
lea edx, [ebp - 0x428]
push edx
call fcn.10034f9f
add esp, 0xc
lea eax, [ebp - 0x328]
push eax
lea ecx, [ebp - 0x428]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableA]
jmp 0x100319dd
mov edx, dword [0x1003b044]
xor edx, dword [0x1003b04c]
xor edx, dword [0x1003b06c]
and edx, 0x10
test edx, edx
jne 0x10031b47
lea eax, [ebp - 0x584]
push eax
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
mov cl, byte [0x1003e538]
mov byte [ebp - 0x688], cl
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x687]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov dl, byte [0x1003e53c]
mov byte [ebp - 0x540], dl
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x53f]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
cmp dword [0x1003e1f8], 1
jne 0x10031ac2
cmp dword [ebp - 0x578], 0
jne 0x10031ac2
lea eax, [ebp - 0x688]
push eax
call fcn.10033097
add esp, 4
and eax, 0xff
test eax, eax
je 0x10031ac2
lea ecx, [ebp - 0x688]
mov dword [ebp - 0x578], ecx
push 0x104
lea edx, [ebp - 0x540]
push edx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jne 0x10031ae1
xor eax, eax
jmp 0x10031cdf
lea eax, [ebp - 0x43c]
push eax
lea ecx, [ebp - 0x584]
push ecx
push 0
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
push eax
lea edx, [ebp - 0x540]
push edx
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x10031b3d
mov dword [0x1003e42c], 6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._Location_XEB__error_code__d_
push 0x1003e430
call fcn.10034f9f
add esp, 0xc
xor eax, eax
jmp 0x10031cdf
mov eax, 1
jmp 0x10031cdf
mov eax, dword [0x1003b044]
xor eax, dword [0x1003b04c]
xor eax, dword [0x1003b06c]
and eax, 0x10
test eax, eax
je 0x10031c9d
mov ecx, dword [0x1003b05c]
xor ecx, dword [0x1003b048]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 0x1003b2a8
lea edx, [ebp - 0x10c]
push edx
call fcn.10034f9f
add esp, 0x10
lea eax, [ebp - 0x10c]
push eax
push 0
push 0x1f0001
call dword [sym.imp.KERNEL32.dll_OpenMutexA]
test eax, eax
jne 0x10031c9d
push 0xf
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
mov byte [ebp - 0x68c], 0
push 0x1003b2b4
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x690], eax
cmp dword [ebp - 0x690], 0
je 0x10031c09
push 0x1003b2c0
mov ecx, dword [ebp - 0x690]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [ebp - 0x694], eax
cmp dword [ebp - 0x694], 0
je 0x10031c09
call dword [ebp - 0x694]
test eax, eax
je 0x10031c09
mov byte [ebp - 0x68c], 1
mov edx, dword [ebp - 0x68c]
and edx, 0xff
test edx, edx
je 0x10031c47
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 0x1003b2d4
lea eax, [ebp - 0x10c]
push eax
call fcn.10034f9f
add esp, 0xc
lea ecx, [ebp - 0x10c]
push ecx
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
jmp 0x10031c9d
xor edx, edx
cmp dword [0x1003e1f8], 0
sete dl
push edx
call fcn.10033126
add esp, 4
and eax, 0xff
test eax, eax
jne 0x10031c8c
mov dword [0x1003e42c], 6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._Error_code__d_
push 0x1003e430
call fcn.10034f9f
add esp, 0xc
xor eax, eax
jmp 0x10031cdf
push 0
call fcn.10031ce4
add esp, 4
mov eax, 1
jmp 0x10031cdf
call fcn.10030b9b
mov dword [ebp - 4], eax
push 0
call fcn.10031ce4
add esp, 4
cmp dword [ebp - 4], 1
jne 0x10031cc6
push 0x1003e1f8
call dword [0x1003e220]
add esp, 4
mov dword [ebp - 4], eax
call dword [0x1003e21c]
push 0
push 0
mov eax, dword [0x1003e424]
push eax
call dword [0x1003e428]
mov eax, dword [ebp - 4]
pop edi
mov esp, ebp
pop ebp
ret