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

Disassembly:
mov eax, 0x422b0c
call fcn.00414798
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 0x40a785
cmp dword [eax + 8], ebx
jle 0x40a785
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 0x40a7ae
cmp dword [0x434a28], ebx
je 0x40a7b8
push ebx
push 0x42751c
push 0x427510
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 0x40ab9f
xor eax, eax
mov esi, 0x432ee0
cmp eax, esi
mov dword [ebp - 0x424], ebx
je 0x40a7d6
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov dword [ebp - 0x424], esi
mov dword [ebp - 4], ebx
cmp dword [0x432ed4], ebx
je 0x40a803
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 0x40ab79
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, 0x424524
push edi
mov dword [ebp - 0x430], eax
mov esi, 0x82
lea eax, [ebp - 0x420]
push esi
push eax
call fcn.0041391d
pop ecx
lea eax, [ebp + eax*2 - 0x420]
push eax
call fcn.00413b3d
add esp, 0x10
push dword [ebp - 0x430]
lea eax, [ebp - 0x218]
push edi
push esi
push eax
call fcn.0041391d
pop ecx
lea eax, [ebp + eax*2 - 0x218]
push eax
call fcn.00413b3d
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 0x40a8ec
push 0x10
push 0x432ef8
push str.CreateMutex_failure
push ebx
call dword [sym.imp.USER32.dll_MessageBoxW]
jmp 0x40a9c4
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0xb7
jne 0x40a909
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 0x40a958
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 0x40a9be
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 0x40a9cc
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 0x40aa92
mov eax, dword [0x432ed4]
mov edi, 0x1000
cmp dword [eax + 0x244], edi
jae 0x40ab27
mov esi, dword [eax + 0x240]
cmp esi, ebx
je 0x40aa44
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 0x40ab27
push esi
push ebx
push eax
call fcn.00414180
mov eax, dword [0x432ed4]
add esp, 0xc
mov dword [eax + 0x244], edi
jmp 0x40ab27
push edi
push ebx
push dword [0x432ed4]
call fcn.00414180
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 0x40aaeb
push esi
push ebx
push eax
call fcn.00414180
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], 0x26300
mov eax, dword [0x432ed4]
mov dword [eax + 4], edi
mov ecx, dword [0x432ed4]
push 1
call fcn.00408280
mov ecx, dword [0x432ed4]
push 1
call fcn.00409d70
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 0x40ab5d
cmp dword [ecx + 0x2c], ebx
je 0x40ab5d
mov eax, dword [ecx + 0x23c]
inc eax
jmp 0x40ab63
mov eax, dword [ecx + 0x23c]
mov dword [0x432ecc], eax
call fcn.004068f6
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 0x40ab9d
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.00413d8f
leave
ret