Function at 0x4055f0
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 0x40efbb
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x420
mov eax, dword [0x418110]
push ebx
mov dword [esp + 0x41c], eax
mov eax, dword [0x418150]
test eax, eax
push esi
push edi
je 0x405659
mov ecx, dword [eax + 8]
test ecx, ecx
jle 0x405659
mov eax, dword [ebp + 8]
mov ecx, dword [0x41804c]
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push eax
push ecx
call esi
mov edx, dword [ebp + 0xc]
mov eax, dword [0x418048]
push edx
push eax
call esi
mov eax, dword [0x418150]
jmp 0x405aab
mov ecx, dword [0x418a64]
test ecx, ecx
je 0x405690
push 0
push 0x411c8c
push 0x411c80
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 [0x418150]
jmp 0x405aab
xor esi, esi
xor ecx, ecx
cmp ecx, 0x418370
mov dword [esp + 0xc], esi
je 0x4056b9
push 0x418370
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x418150]
mov esi, 0x418370
mov dword [esp + 0xc], esi
test eax, eax
mov dword [esp + 0x434], 0
je 0x4056ff
mov edx, dword [ebp + 8]
mov eax, dword [0x41804c]
mov edi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edx
push eax
call edi
mov ecx, dword [ebp + 0xc]
mov edx, dword [0x418048]
push ecx
push edx
call edi
test esi, esi
mov edi, dword [0x418150]
je 0x4056f8
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, edi
jmp 0x405aab
call fcn.004013d0
push 0x103
push 0x418168
push eax
mov dword [0x41814c], 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 edi, dword [sym.imp.MSVCR71.dll_wcslen]
mov esi, eax
push esi
push 0x411c2c
lea eax, [esp + 0x18]
push 0x82
push eax
call edi
mov ebx, dword [sym.imp.MSVCR71.dll__snwprintf]
lea ecx, [esp + eax*2 + 0x20]
add esp, 4
push ecx
call ebx
add esp, 0x10
push esi
push 0x411c2c
lea edx, [esp + 0x220]
push 0x82
push edx
call edi
lea eax, [esp + eax*2 + 0x228]
add esp, 4
push eax
call ebx
add esp, 0x10
lea ecx, [esp + 0x10]
push ecx
push 1
xor esi, esi
push esi
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
cmp eax, esi
mov dword [0x418158], eax
jne 0x4057ee
push 0x10
push 0x418168
push str.CreateMutex_failure
push esi
call dword [sym.imp.USER32.dll_MessageBoxW]
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
call edi
cmp eax, 0xb7
jne 0x40580c
mov edx, dword [0x418158]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [esp + 0x218]
push eax
push 0x24c
push esi
push 4
push esi
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
cmp eax, esi
mov dword [0x418154], eax
jne 0x405869
push 0x10
push 0x418168
push str.CreateFileMapping_failure
push esi
call dword [sym.imp.USER32.dll_MessageBoxW]
mov ecx, dword [0x418158]
push ecx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [0x418158]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xffffffffffffffff
mov dword [0x418158], esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
call edi
push 0x24c
push esi
push esi
cmp eax, 0xb7
mov eax, dword [0x418154]
push 0xf001f
push eax
sete bl
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
cmp eax, esi
mov dword [0x418150], eax
jne 0x4058df
push 0x10
push 0x418168
push str.MapViewOfFile_failure
push esi
call dword [sym.imp.USER32.dll_MessageBoxW]
mov ecx, dword [0x418154]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
call edi
mov edx, dword [0x418158]
push edx
mov dword [0x418154], esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov eax, dword [0x418158]
push eax
call edi
push 0xffffffffffffffff
mov dword [0x418158], esi
call dword [sym.imp.KERNEL32.dll_ExitProcess]
mov ecx, dword [ebp + 8]
mov edx, dword [0x41804c]
mov edi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push ecx
push edx
call edi
mov eax, dword [ebp + 0xc]
mov ecx, dword [0x418048]
push eax
push ecx
call edi
test bl, bl
mov dword [0x418a64], esi
je 0x4059e0
mov eax, dword [0x418150]
cmp dword [eax + 0x244], 0x1000
jae 0x405998
mov esi, dword [eax + 0x240]
xor ebx, ebx
cmp esi, ebx
je 0x40594f
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edx, dword [0x418150]
mov dword [edx + 0x244], ebx
mov eax, dword [0x418150]
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 [0x418150]
mov dword [ecx + 0x240], eax
mov edx, dword [0x418150]
mov edi, dword [edx + 0x240]
cmp edi, ebx
je 0x405996
xor eax, eax
mov ecx, 0x800
rep stosd dword es:[edi], eax
mov eax, dword [0x418150]
mov dword [eax + 0x244], 0x1000
xor esi, esi
mov ecx, dword [0x418150]
push 1
add ecx, 8
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov ecx, dword [0x418150]
mov edx, dword [ecx + 8]
mov dword [0x418144], edx
cmp dword [ecx + 0xe8], 0xffffffff
jne 0x405a7d
cmp dword [ecx + 0x2c], esi
je 0x405a7d
mov eax, dword [ecx + 0x23c]
inc eax
mov dword [0x418148], eax
jmp 0x405a89
mov edi, dword [0x418150]
push 0x2000
xor eax, eax
mov ecx, 0x93
push esi
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 [0x418150]
mov dword [ecx + 0x240], eax
mov edx, dword [0x418150]
mov edi, dword [edx + 0x240]
cmp edi, esi
je 0x405a36
xor eax, eax
mov ecx, 0x800
rep stosd dword es:[edi], eax
mov eax, dword [0x418150]
mov dword [eax + 0x244], 0x1000
mov ecx, dword [0x418150]
add ecx, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov edx, dword [0x418150]
mov dword [edx], 0x26300
mov eax, dword [0x418150]
mov dword [eax + 4], 0x24c
mov ecx, dword [0x418150]
push 1
call fcn.00402560
mov ecx, dword [0x418150]
push 1
call fcn.00404bc0
jmp 0x405998
mov edx, dword [ecx + 0x23c]
mov dword [0x418148], edx
call fcn.00402f70
mov eax, dword [0x418158]
push eax
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov esi, dword [0x418150]
lea ecx, [esp + 0xc]
call fcn.00401420
mov eax, esi
mov ecx, dword [esp + 0x42c]
mov dword fs:[0], ecx
mov ecx, dword [esp + 0x424]
call fcn.0040e783
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret