Function at 0x4095f0
Capabilities:
Check mutex and terminate process on windows
Check mutex on windows
Query environment variable
Set environment variable
Set thread local storage value
Terminate process

Disassembly:
push 0xffffffffffffffff
push 0x41e29b
mov eax, dword fs:[0]
push eax
sub esp, 0x25c
mov eax, dword [0x42d01c]
xor eax, esp
mov dword [esp + 0x258], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x42d01c]
xor eax, esp
push eax
lea eax, [esp + 0x270]
mov dword fs:[0], eax
mov eax, dword [0x42dc54]
mov esi, ecx
mov ebx, edx
mov dword [esp + 0x20], esi
mov dword [esp + 0x1c], ebx
test eax, eax
je 0x40966b
mov eax, dword [eax + 8]
test eax, eax
jle 0x40966b
mov ecx, dword [0x42d144]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push ecx
call esi
mov edx, dword [0x42d148]
push ebx
push edx
call esi
mov eax, dword [0x42dc54]
jmp 0x409a84
mov eax, dword [0x430328]
test eax, eax
je 0x4096a1
push 0
push 0x420a38
push 0x420a40
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov eax, dword [0x42dc54]
jmp 0x409a84
xor edi, edi
xor ecx, ecx
mov dword [esp + 0x18], edi
cmp ecx, 0x42dc30
je 0x4096c5
push 0x42dc30
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov edi, 0x42dc30
mov dword [esp + 0x18], edi
mov dword [esp + 0x278], 0
cmp dword [0x42dc54], 0
je 0x409706
mov edx, dword [0x42d144]
push esi
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edx
call esi
mov eax, dword [0x42d148]
push ebx
push eax
call esi
mov esi, dword [0x42dc54]
test edi, edi
je 0x409a82
push edi
jmp 0x409a7c
call fcn.0040d210
push 0x103
push 0x42d928
push eax
mov dword [0x42dc58], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov ecx, 9
mov esi, 0x420a4c
lea edi, [esp + 0x64]
rep movsd dword es:[edi], dword [esi]
push 0x1e2
lea ecx, [esp + 0x8e]
push 0
push ecx
movsw word es:[edi], word [esi]
call fcn.00417128
push 0x80
push 0x420a74
push 0x42db30
call dword [sym.imp.MSVCR90.dll_wcsncpy]
add esp, 0x18
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov esi, eax
lea eax, [esp + 0x64]
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x409770
mov edi, dword [sym.imp.MSVCR90.dll__snwprintf]
sub eax, edx
push esi
sar eax, 1
push 0x42051c
lea edx, [esp + eax*2 + 0x6c]
push 0x82
push edx
call edi
mov eax, 0x42db30
add esp, 0x10
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x4097a2
sub eax, edx
push esi
sar eax, 1
push 0x42051c
lea eax, [eax*2 + 0x42db30]
push 0x82
push eax
call edi
add esp, 0x10
lea ecx, [esp + 0x64]
push ecx
push 1
push 0
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [0x42dc4c], eax
test eax, eax
jne 0x4097fc
push 0x10
push 0x42d928
push 0x420a94
push eax
call dword [sym.imp.USER32.dll_MessageBoxW]
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
sete bl
test bl, bl
je 0x40981d
mov edx, dword [0x42dc4c]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
xor eax, eax
push 0x3e
push eax
lea ecx, [esp + 0x2e]
push ecx
mov word [esp + 0x30], ax
call fcn.00417128
add esp, 0xc
push 0x20
lea edx, [esp + 0x28]
push edx
push 0x42db30
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebp, dword [sym.imp.KERNEL32.dll_GlobalLock]
test eax, eax
jne 0x4098d1
push 0x24c
push 0
call edi
mov dword [0x42dc50], eax
test eax, eax
jne 0x4098a6
push 0x10
push 0x42d928
push 0x420abc
push eax
call dword [sym.imp.USER32.dll_MessageBoxW]
mov eax, dword [0x42dc4c]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov ecx, dword [0x42dc4c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xffffffffffffffff
mov dword [0x42dc4c], 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push eax
call ebp
push 0xa
lea edx, [esp + 0x28]
push edx
push eax
mov dword [0x42dc54], eax
call dword [sym.imp.MSVCR90.dll__ultow]
add esp, 0xc
lea eax, [esp + 0x24]
push eax
push 0x42db30
call dword [sym.imp.KERNEL32.dll_SetEnvironmentVariableW]
jmp 0x4098e4
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.MSVCR90.dll__wtol]
add esp, 4
mov dword [0x42dc54], eax
mov edx, dword [esp + 0x20]
mov eax, dword [0x42d144]
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edx
push eax
call esi
mov ecx, dword [esp + 0x1c]
mov edx, dword [0x42d148]
push ecx
push edx
call esi
mov dword [0x430328], 0
test bl, bl
je 0x409990
mov esi, dword [0x42dc54]
mov ebx, 0x1000
cmp dword [esi + 0x244], ebx
jae 0x409a11
mov esi, dword [esi + 0x240]
test esi, esi
je 0x409955
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x42dc54]
xor ecx, ecx
mov dword [eax + 0x244], ecx
mov dword [eax + 0x240], ecx
push 0x2000
push 0
call edi
push eax
call ebp
mov esi, dword [0x42dc54]
mov dword [esi + 0x240], eax
test eax, eax
je 0x409a11
push 0x2000
push 0
push eax
call fcn.00417128
add esp, 0xc
mov dword [esi + 0x244], ebx
jmp 0x409a11
mov eax, dword [0x42dc54]
push 0x24c
push 0
push eax
call fcn.00417128
add esp, 0xc
push 0x2000
push 0
call edi
push eax
call ebp
mov esi, dword [0x42dc54]
mov dword [esi + 0x240], eax
test eax, eax
je 0x4099db
push 0x2000
push 0
push eax
call fcn.00417128
add esp, 0xc
mov dword [esi + 0x244], 0x1000
add esi, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [0x42dc54]
push 1
mov dword [eax], 0x30300
mov dword [eax + 4], 0x24c
call fcn.00409b70
mov ecx, dword [0x42dc54]
push 1
call fcn.0040be60
mov esi, dword [0x42dc54]
push 1
add esi, 8
push esi
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov ecx, dword [0x42dc54]
mov edx, dword [ecx + 8]
mov esi, dword [0x42dc54]
cmp dword [esi + 0xe8], 0xffffffff
mov dword [0x42dc60], edx
jne 0x409a4f
cmp dword [esi + 0x2c], 0
je 0x409a4f
mov eax, dword [esi + 0x23c]
inc eax
mov dword [0x42dc5c], eax
jmp 0x409a5b
mov ecx, dword [esi + 0x23c]
mov dword [0x42dc5c], ecx
call fcn.0040d420
mov edx, dword [0x42dc4c]
push edx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [esp + 0x18]
mov esi, dword [0x42dc54]
test eax, eax
je 0x409a82
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
mov ecx, dword [esp + 0x270]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x258]
xor ecx, esp
call fcn.00416c1c
add esp, 0x268
ret