Function at 0x4164dc
Capabilities:
Create thread
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], esi
mov dword [ebp - 4], ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x10], 0
mov esi, 1
push 1
push 0x4406b60
call dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x41656e
mov eax, 0x51eb851f
imul esi
mov ecx, esi
sar ecx, 0x1f
sar edx, 5
sub edx, ecx
imul edi, edx, 0x64
neg edi
add edi, esi
jne 0x41656e
cmp esi, 0x15f90
jge 0x416537
xor eax, eax
jmp 0x416567
cmp esi, 0x1d4c0
jge 0x416546
mov eax, 0x32
jmp 0x416567
cmp esi, 0x2bf20
jge 0x416555
mov eax, 0x64
jmp 0x416567
cmp esi, 0x57d78
mov eax, 0x1482
jl 0x416567
mov eax, 0xfa
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x416584
add esi, 1
cmp esi, 0x57e40
jl 0x4164fa
mov eax, dword [ebp - 0x14]
test eax, eax
je 0x41659c
mov dword [ebp - 0x14], 0x98
lea eax, [ebp - 0x14]
push eax
call fcn.004317a0
pop ecx
mov eax, dword [0x4406b64]
test eax, eax
jne 0x4165c7
mov eax, dword [0x4c9460]
cmp eax, 1
je 0x416616
xor edi, edi
xor esi, esi
mov eax, dword [0x4c9460]
mov dword [0x4406b64], 1
cmp eax, 1
je 0x416601
push dword [0x4406b68]
mov dword [0x4406b60], 0
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, eax
mov dword [ebp - 0x10], esi
test esi, esi
je 0x41664e
mov dword [ebx], esi
mov eax, dword [0x4c9460]
cmp eax, 1
je 0x416631
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
xor eax, eax
mov esp, ebp
pop ebp
ret
push edi
push 2
call fcn.00489f2b
push esi
push 0x16
call fcn.00489f2b
add esp, 0x10
jmp 0x4165c7
push 1
push 2
call fcn.00489f2b
mov edi, eax
push 1
push 0x16
call fcn.00489f2b
add esp, 0x10
mov esi, eax
jmp 0x4165b3
push 1
push 2
call fcn.00489f2b
push 1
push 0x16
mov dword [esi + 0x64], eax
call fcn.00489f2b
add esp, 0x10
mov dword [esi + 0x68], eax
jmp 0x4165f2
lea eax, [ebp - 0x10]
push eax
push 0
push 0x70
call fcn.00431768
add esp, 0xc
test eax, eax
je 0x416680
mov dword [ebx], 0
mov esi, 0
je 0x4165e8
mov ebx, dword [ebp - 4]
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 0xc]
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 0x10]
mov eax, 0x4c93c0
mov ecx, dword [eax]
mov dword [edx], ecx
mov esi, dword [eax + 4]
mov dword [edx + 4], esi
mov edi, dword [eax + 8]
mov dword [edx + 8], edi
mov ecx, dword [eax + 0xc]
mov dword [edx + 0xc], ecx
mov ecx, dword [eax + 0x10]
mov dword [edx + 0x10], ecx
mov ecx, dword [eax + 0x14]
mov dword [edx + 0x14], ecx
mov ecx, dword [eax + 0x18]
mov dword [edx + 0x18], ecx
mov ecx, dword [eax + 0x1c]
mov dword [edx + 0x1c], ecx
mov ecx, dword [eax + 0x20]
mov dword [edx + 0x20], ecx
mov ecx, dword [eax + 0x24]
mov dword [edx + 0x24], ecx
mov ecx, dword [eax + 0x28]
mov dword [edx + 0x28], ecx
mov ecx, dword [eax + 0x2c]
mov dword [edx + 0x2c], ecx
mov ecx, dword [eax + 0x30]
mov dword [edx + 0x30], ecx
mov ecx, dword [eax + 0x34]
mov dword [edx + 0x34], ecx
mov ecx, dword [eax + 0x38]
mov dword [edx + 0x38], ecx
mov ecx, dword [eax + 0x3c]
mov dword [edx + 0x3c], ecx
mov ecx, dword [eax + 0x40]
mov dword [edx + 0x40], ecx
mov ecx, dword [eax + 0x44]
mov dword [edx + 0x44], ecx
mov ecx, dword [eax + 0x48]
mov dword [edx + 0x48], ecx
mov ecx, dword [eax + 0x4c]
mov dword [edx + 0x4c], ecx
mov ecx, dword [eax + 0x50]
mov dword [edx + 0x50], ecx
mov ecx, dword [eax + 0x54]
mov dword [edx + 0x54], ecx
mov ecx, dword [eax + 0x58]
mov dword [edx + 0x58], ecx
mov ecx, dword [eax + 0x5c]
mov dword [edx + 0x5c], ecx
mov ecx, dword [eax + 0x60]
mov dword [edx + 0x60], ecx
mov ecx, dword [eax + 0x64]
mov dword [edx + 0x64], ecx
mov ecx, dword [eax + 0x68]
mov dword [edx + 0x68], ecx
mov eax, dword [eax + 0x6c]
mov dword [edx + 0x6c], eax
push dword [ebp - 0x10]
push dword [0x4406b68]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov ecx, dword [ebp - 0x10]
push 2
add ecx, 0x6c
xor edx, edx
push edx
push edx
push ecx
push eax
push esi
push edi
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
test eax, eax
jne 0x416775
mov esi, dword [ebp - 0x10]
jmp 0x4165e6
push dword [ebp - 0x10]
push 0
push 0x416120
call fcn.00489d75
add esp, 0xc
mov esi, dword [ebp - 0x10]
jmp 0x4165e6