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

Disassembly:
push ebp
sub esp, 0x410
lea ebp, [esp - 4]
mov eax, dword [0x1002b1f0]
xor eax, ebp
mov dword [ebp + 0x410], eax
push 0x14
mov eax, 0x10019f23
call fcn.10018de1
mov eax, dword [ebp + 0x420]
mov edi, dword [ebp + 0x41c]
mov dword [ebp - 0x18], eax
mov eax, dword [0x1002b664]
xor ebx, ebx
mov dword [ebp - 0x20], edi
cmp eax, ebx
je 0x100098c1
mov eax, dword [eax + 8]
test eax, eax
jle 0x100098c1
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edi
push dword [0x1002b004]
call esi
push dword [ebp - 0x18]
push dword [0x1002b008]
call esi
mov eax, dword [0x1002b664]
jmp 0x10009cab
mov eax, dword [0x1002ce2c]
test eax, eax
je 0x100098ed
push ebx
push 0x1001e5fc
push 0x1001e5f0
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]
jmp 0x100098b7
xor eax, eax
mov esi, 0x1002b208
mov dword [ebp - 0x14], ebx
cmp eax, esi
je 0x10009905
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 0x14], esi
mov dword [ebp - 4], ebx
cmp dword [0x1002b664], ebx
je 0x1000992f
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edi
push dword [0x1002b004]
call esi
push dword [ebp - 0x18]
push dword [0x1002b008]
call esi
jmp 0x10009c95
call fcn.100017cf
push 0x103
push 0x1002b450
push eax
mov dword [0x1002b668], eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 8
pop ecx
mov esi, str.mutexTSLOGTSLOG
lea edi, [ebp + 0x208]
rep movsd dword es:[edi], dword [esi]
push 0x1e6
lea eax, [ebp + 0x22a]
push ebx
push eax
movsw word es:[edi], word [esi]
call sub.MSVCR90.dll_memset
push 9
pop ecx
mov esi, str.filemapTSLOGTSLOG
lea edi, [ebp]
rep movsd dword es:[edi], dword [esi]
push 0x1e2
lea eax, [ebp + 0x26]
push ebx
push eax
movsw word es:[edi], word [esi]
call sub.MSVCR90.dll_memset
add esp, 0x18
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov esi, dword [sym.imp.MSVCR90.dll_wcslen]
push eax
push 0x1001b67c
mov dword [ebp - 0x1c], eax
lea eax, [ebp + 0x208]
push 0x82
push eax
call esi
mov edi, dword [sym.imp.MSVCR90.dll__snwprintf]
pop ecx
lea eax, [ebp + eax*2 + 0x208]
push eax
call edi
add esp, 0x10
push dword [ebp - 0x1c]
lea eax, [ebp]
push 0x1001b67c
push 0x82
push eax
call esi
pop ecx
lea eax, [ebp + eax*2]
push eax
call edi
add esp, 0x10
lea eax, [ebp + 0x208]
push eax
push 1
push ebx
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [0x1002b65c], eax
cmp eax, ebx
jne 0x10009a18
push 0x10
push 0x1002b450
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 0x10009a35
push 0xffffffffffffffff
push dword [0x1002b65c]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
lea eax, [ebp]
push eax
mov edi, 0x24c
push edi
push ebx
push 4
push ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingW]
mov dword [0x1002b660], eax
cmp eax, ebx
jne 0x10009a87
push 0x10
push 0x1002b450
push str.CreateFileMapping_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [0x1002b65c]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [0x1002b65c]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [0x1002b65c], ebx
jmp 0x10009a10
call esi
push edi
push ebx
push ebx
push 0xf001f
push dword [0x1002b660]
cmp eax, 0xb7
sete byte [ebp - 0xd]
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov dword [0x1002b664], eax
cmp eax, ebx
jne 0x10009aec
push 0x10
push 0x1002b450
push str.MapViewOfFile_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
push dword [0x1002b660]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [0x1002b65c]
mov dword [0x1002b660], ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push dword [0x1002b65c]
call esi
jmp 0x10009a7f
push dword [ebp - 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
push dword [0x1002b004]
call esi
push dword [ebp - 0x18]
push dword [0x1002b008]
call esi
mov dword [0x1002ce2c], ebx
cmp byte [ebp - 0xd], bl
je 0x10009ba9
mov eax, dword [0x1002b664]
mov edi, 0x1000
cmp dword [eax + 0x244], edi
jae 0x10009c3e
mov esi, dword [eax + 0x240]
cmp esi, ebx
je 0x10009b5b
push esi
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push esi
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov eax, dword [0x1002b664]
mov dword [eax + 0x244], ebx
mov eax, dword [0x1002b664]
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 [0x1002b664]
mov dword [ecx + 0x240], eax
mov eax, dword [0x1002b664]
add eax, 0x240
cmp dword [eax], ebx
je 0x10009c3e
push esi
push ebx
push dword [eax]
call sub.MSVCR90.dll_memset
mov eax, dword [0x1002b664]
add esp, 0xc
mov dword [eax + 0x244], edi
jmp 0x10009c3e
push edi
push ebx
push dword [0x1002b664]
call sub.MSVCR90.dll_memset
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 [0x1002b664]
mov dword [ecx + 0x240], eax
mov eax, dword [0x1002b664]
add eax, 0x240
cmp dword [eax], ebx
je 0x10009c02
push esi
push ebx
push dword [eax]
call sub.MSVCR90.dll_memset
mov eax, dword [0x1002b664]
add esp, 0xc
mov dword [eax + 0x244], 0x1000
mov eax, dword [0x1002b664]
add eax, 0xc
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
mov eax, dword [0x1002b664]
mov dword [eax], 0x28100
mov eax, dword [0x1002b664]
mov dword [eax + 4], edi
mov ecx, dword [0x1002b664]
push 1
call fcn.1000578f
mov ecx, dword [0x1002b664]
push 1
call fcn.10008f0d
mov eax, dword [0x1002b664]
push 1
add eax, 8
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedExchangeAdd]
mov eax, dword [0x1002b664]
mov eax, dword [eax + 8]
mov ecx, dword [0x1002b664]
mov dword [0x1002b670], eax
cmp dword [ecx + 0xe8], 0xffffffff
jne 0x10009c79
cmp dword [ecx + 0x2c], ebx
je 0x10009c79
mov eax, dword [ecx + 0x23c]
inc eax
jmp 0x10009c7f
mov eax, dword [ecx + 0x23c]
mov dword [0x1002b66c], eax
call fcn.10001baa
push dword [0x1002b65c]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov esi, dword [0x1002b664]
cmp dword [ebp - 0x14], ebx
je 0x10009ca9
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, esi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp + 0x410]
xor ecx, ebp
call fcn.10018dd2
add ebp, 0x414
leave
ret