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

Disassembly:
mov eax, 0x42301c
call fcn.00414c98
sub esp, 0x428
mov eax, dword [0x431d24]
xor eax, ebp
push ebx
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 0xc]
push esi
mov dword [ebp - 0x42c], eax
mov eax, dword [0x432ed4]
push edi
mov edi, dword [ebp + 8]
xor ebx, ebx
cmp eax, ebx
mov dword [ebp - 0x434], edi
je 0x40a864
cmp dword [eax + 8], ebx
jle 0x40a864
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edi
push dword [0x431928]
call esi
push dword [ebp - 0x42c]
push dword [0x431924]
call esi
jmp 0x40a88d
cmp dword [0x434a28], ebx
je 0x40a897
push ebx
push 0x42752c
push 0x427520
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 [0x432ed4]
jmp 0x40ac7e
xor eax, eax
mov esi, 0x432ee0
cmp eax, esi
mov dword [ebp - 0x424], ebx
je 0x40a8b5
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 0x424], esi
mov dword [ebp - 4], ebx
cmp dword [0x432ed4], ebx
je 0x40a8e2
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edi
push dword [0x431928]
call esi
push dword [ebp - 0x42c]
push dword [0x431924]
call esi
jmp 0x40ac58
call fcn.0040143a
push 0x103
push 0x432ef8
push eax
mov dword [0x432ed0], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 8
pop ecx
mov esi, str.mutexTSLOGTSLOG
lea edi, [ebp - 0x420]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
push 0x79
pop ecx
xor eax, eax
lea edi, [ebp - 0x3fe]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 9
pop ecx
mov esi, str.filemapTSLOGTSLOG
lea edi, [ebp - 0x218]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
push 0x78
pop ecx
xor eax, eax
lea edi, [ebp - 0x1f2]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
mov edi, 0x424534
push edi
mov dword [ebp - 0x430], eax
mov esi, 0x82
lea eax, [ebp - 0x420]
push esi
push eax
call fcn.00413e1d
pop ecx
lea eax, [ebp + eax*2 - 0x420]
push eax
call fcn.0041403d
add esp, 0x10
push dword [ebp - 0x430]
lea eax, [ebp - 0x218]
push edi
push esi
push eax
call fcn.00413e1d
pop ecx
lea eax, [ebp + eax*2 - 0x218]
push eax
call fcn.0041403d
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
cmp eax, ebx
mov dword [0x432edc], eax
jne 0x40a9cb
push 0x10
push 0x432ef8
push str.CreateMutex_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x40aaa3
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0xb7
jne 0x40a9e8
push 0xffffffffffffffff
push dword [0x432edc]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [ebp - 0x218]
push eax
mov edi, 0x24c
push edi
push ebx
push 4
push ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, ebx
mov dword [0x432ed8], eax
jne 0x40aa37
push 0x10
push 0x432ef8
push str.CreateFileMapping_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [0x432edc]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [0x432edc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x40aa9d
call esi
push edi
push ebx
push ebx
push 0xf001f
push dword [0x432ed8]
cmp eax, 0xb7
sete byte [ebp - 0x425]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, ebx
mov dword [0x432ed4], eax
jne 0x40aaab
push 0x10
push 0x432ef8
push str.MapViewOfFile_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [0x432ed8]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [0x432edc]
mov dword [0x432ed8], ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [0x432edc]
call esi
mov dword [0x432edc], ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
push dword [ebp - 0x434]
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [0x431928]
call esi
push dword [ebp - 0x42c]
push dword [0x431924]
call esi
cmp byte [ebp - 0x425], bl
mov dword [0x434a28], ebx
je 0x40ab71
mov eax, dword [0x432ed4]
mov edi, 0x1000
cmp dword [eax + 0x244], edi
jae 0x40ac06
mov esi, dword [eax + 0x240]
cmp esi, ebx
je 0x40ab23
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x432ed4]
mov dword [eax + 0x244], ebx
mov eax, dword [0x432ed4]
mov dword [eax + 0x240], ebx
mov esi, 0x2000
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [0x432ed4]
mov dword [ecx + 0x240], eax
mov eax, dword [0x432ed4]
mov eax, dword [eax + 0x240]
cmp eax, ebx
je 0x40ac06
push esi
push ebx
push eax
call fcn.00414680
mov eax, dword [0x432ed4]
add esp, 0xc
mov dword [eax + 0x244], edi
jmp 0x40ac06
push edi
push ebx
push dword [0x432ed4]
call fcn.00414680
add esp, 0xc
mov esi, 0x2000
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov ecx, dword [0x432ed4]
mov dword [ecx + 0x240], eax
mov eax, dword [0x432ed4]
mov eax, dword [eax + 0x240]
cmp eax, ebx
je 0x40abca
push esi
push ebx
push eax
call fcn.00414680
mov eax, dword [0x432ed4]
add esp, 0xc
mov dword [eax + 0x244], 0x1000
mov eax, dword [0x432ed4]
add eax, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [0x432ed4]
mov dword [eax], 0x26400
mov eax, dword [0x432ed4]
mov dword [eax + 4], edi
mov ecx, dword [0x432ed4]
push 1
call fcn.0040835f
mov ecx, dword [0x432ed4]
push 1
call fcn.00409e4f
mov eax, dword [0x432ed4]
push 1
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov ecx, dword [0x432ed4]
mov eax, dword [ecx + 8]
mov dword [0x432ec8], eax
cmp dword [ecx + 0xe8], 0xffffffff
jne 0x40ac3c
cmp dword [ecx + 0x2c], ebx
je 0x40ac3c
mov eax, dword [ecx + 0x23c]
inc eax
jmp 0x40ac42
mov eax, dword [ecx + 0x23c]
mov dword [0x432ecc], eax
call fcn.004069d5
push dword [0x432edc]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov esi, dword [0x432ed4]
or dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x424], ebx
je 0x40ac7c
push dword [ebp - 0x424]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov dword [ebp - 0x424], ebx
mov eax, esi
mov ecx, dword [ebp - 0xc]
pop edi
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
pop esi
xor ecx, ebp
pop ebx
call fcn.0041428f
leave
ret