Function at 0x40a9c0
Capabilities:
Check mutex and terminate process on windows
Check mutex on windows
Set thread local storage value
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x421c8b
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x420
mov eax, dword [0x42c17c]
push ebx
mov dword [esp + 0x41c], eax
mov eax, dword [0x42d058]
xor ebx, ebx
cmp eax, ebx
push esi
push edi
je 0x40aa29
cmp dword [eax + 8], ebx
jle 0x40aa29
mov eax, dword [ebp + 8]
mov ecx, dword [0x42c0f0]
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push eax
push ecx
call esi
mov edx, dword [ebp + 0xc]
mov eax, dword [0x42c0ec]
push edx
push eax
call esi
mov eax, dword [0x42d058]
jmp 0x40ae70
cmp dword [0x42e9ac], ebx
je 0x40aa5c
push ebx
push 0x425e7c
push 0x425e70
push ebx
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 [0x42d058]
jmp 0x40ae70
xor esi, esi
xor ecx, ecx
cmp ecx, 0x42d270
mov dword [esp + 0xc], esi
je 0x40aa85
push 0x42d270
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x42d058]
mov esi, 0x42d270
mov dword [esp + 0xc], esi
cmp eax, ebx
mov dword [esp + 0x434], ebx
je 0x40aac7
mov edx, dword [ebp + 8]
mov eax, dword [0x42c0f0]
mov edi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edx
push eax
call edi
mov ecx, dword [ebp + 0xc]
mov edx, dword [0x42c0ec]
push ecx
push edx
call edi
cmp esi, ebx
mov edi, dword [0x42d058]
je 0x40aac0
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
jmp 0x40ae70
call fcn.004033b0
push 0x103
push 0x42d068
push eax
mov dword [0x42d054], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov ecx, 8
mov esi, str.mutexTSLOGTSLOG
lea edi, [esp + 0x10]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
xor eax, eax
mov ecx, 0x79
lea edi, [esp + 0x32]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov ecx, 9
mov esi, str.filemapTSLOGTSLOG
lea edi, [esp + 0x218]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
xor eax, eax
mov ecx, 0x78
lea edi, [esp + 0x23e]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov esi, eax
push esi
push 0x42342c
lea eax, [esp + 0x18]
push 0x82
push eax
call fcn.0041630e
lea ecx, [esp + eax*2 + 0x20]
add esp, 4
push ecx
call fcn.0041651d
add esp, 0x10
push esi
push 0x42342c
lea edx, [esp + 0x220]
push 0x82
push edx
call fcn.0041630e
lea eax, [esp + eax*2 + 0x228]
add esp, 4
push eax
call fcn.0041651d
add esp, 0x10
lea ecx, [esp + 0x10]
push ecx
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
cmp eax, ebx
mov dword [0x42d060], eax
jne 0x40abb4
push 0x10
push 0x42d068
push str.CreateMutex_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0xb7
jne 0x40abd2
mov edx, dword [0x42d060]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [esp + 0x218]
push eax
push 0x24c
push ebx
push 4
push ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, ebx
mov dword [0x42d05c], eax
jne 0x40ac2f
push 0x10
push 0x42d068
push str.CreateFileMapping_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
mov ecx, dword [0x42d060]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [0x42d060]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xffffffffffffffff
mov dword [0x42d060], ebx
call dword [sym.imp.KERNEL32.dll_ExitProcess]
call esi
cmp eax, 0xb7
mov eax, dword [0x42d05c]
push 0x24c
sete bl
xor edi, edi
push edi
push edi
push 0xf001f
push eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, edi
mov dword [0x42d058], eax
jne 0x40aca7
push 0x10
push 0x42d068
push str.MapViewOfFile_failure
push edi
call dword [sym.imp.USER32.dll_MessageBoxW]
mov ecx, dword [0x42d05c]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call esi
mov edx, dword [0x42d060]
push edx
mov dword [0x42d05c], edi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [0x42d060]
push eax
call esi
push 0xffffffffffffffff
mov dword [0x42d060], edi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov ecx, dword [ebp + 8]
mov edx, dword [0x42c0f0]
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push ecx
push edx
call esi
mov eax, dword [ebp + 0xc]
mov ecx, dword [0x42c0ec]
push eax
push ecx
call esi
test bl, bl
mov dword [0x42e9ac], edi
je 0x40ad6b
mov eax, dword [0x42d058]
cmp dword [eax + 0x244], 0x1000
jae 0x40ae03
mov esi, dword [eax + 0x240]
xor ebx, ebx
cmp esi, ebx
je 0x40ad1b
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edx, dword [0x42d058]
mov dword [edx + 0x244], ebx
mov eax, dword [0x42d058]
mov dword [eax + 0x240], ebx
push 0x2000
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [0x42d058]
mov dword [ecx + 0x240], eax
mov edx, dword [0x42d058]
mov edi, dword [edx + 0x240]
cmp edi, ebx
je 0x40ae03
xor eax, eax
mov ecx, 0x800
rep stosd dword es:[edi], eax
mov eax, dword [0x42d058]
mov dword [eax + 0x244], 0x1000
jmp 0x40ae03
mov edi, dword [0x42d058]
xor eax, eax
push 0x2000
mov ecx, 0x93
push eax
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [0x42d058]
mov dword [ecx + 0x240], eax
mov edx, dword [0x42d058]
mov edi, dword [edx + 0x240]
test edi, edi
je 0x40adc1
xor eax, eax
mov ecx, 0x800
rep stosd dword es:[edi], eax
mov eax, dword [0x42d058]
mov dword [eax + 0x244], 0x1000
mov ecx, dword [0x42d058]
add ecx, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov edx, dword [0x42d058]
mov dword [edx], 0x26300
mov eax, dword [0x42d058]
mov dword [eax + 4], 0x24c
mov ecx, dword [0x42d058]
push 1
call fcn.004081c0
mov ecx, dword [0x42d058]
push 1
call fcn.00409e40
mov ecx, dword [0x42d058]
push 1
add ecx, 8
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov ecx, dword [0x42d058]
mov edx, dword [ecx + 8]
mov dword [0x42d04c], edx
cmp dword [ecx + 0xe8], 0xffffffff
jne 0x40ae42
mov eax, dword [ecx + 0x2c]
test eax, eax
je 0x40ae42
mov eax, dword [ecx + 0x23c]
inc eax
mov dword [0x42d050], eax
jmp 0x40ae4e
mov edx, dword [ecx + 0x23c]
mov dword [0x42d050], edx
call fcn.00407060
mov eax, dword [0x42d060]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov esi, dword [0x42d058]
lea ecx, [esp + 0xc]
call fcn.00403400
mov eax, esi
mov ecx, dword [esp + 0x42c]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x424]
call fcn.0041575b
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret