Function at 0x504790
Capabilities:
Get thread local storage value
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x5c1c08
mov eax, dword fs:[0]
push eax
sub esp, 0x4c
push ebx
push ebp
push esi
push edi
mov eax, dword [0x6dd9a4]
xor eax, esp
push eax
lea eax, [esp + 0x60]
mov dword fs:[0], eax
xor eax, eax
or ebx, 0xffffffff
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x70]
xor edi, edi
xor ebp, ebp
cmp eax, ebx
mov dword [esp + 0x34], edi
mov dword [esp + 0x1c], ebx
mov dword [esp + 0x20], ebx
mov dword [esp + 0x18], ebx
je 0x5047eb
mov dword [esp + 0x1c], edi
mov dword [esp + 0x34], eax
lea ebp, [edi + 1]
mov eax, dword [0x7271dc]
cmp eax, edi
je 0x504837
mov esi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
push eax
call esi
cmp eax, edi
je 0x504837
mov ecx, dword [0x7271dc]
cmp ecx, edi
jne 0x50480f
xor eax, eax
jmp 0x504818
push ecx
call esi
mov ecx, dword [0x7271dc]
cmp byte [eax + 0x18], 0
je 0x504837
cmp ecx, edi
mov dword [esp + 0x20], ebp
jne 0x50482a
xor eax, eax
jmp 0x50482d
push ecx
call esi
mov eax, dword [eax + 0xc]
mov dword [esp + ebp*4 + 0x34], eax
add ebp, 1
mov dword [esp + 0x14], edi
mov eax, dword [esp + 0x7c]
and eax, dword [esp + 0x80]
mov dword [esp + 0x68], edi
cmp eax, ebx
je 0x5048e4
lea ecx, [esp + 0x24]
push ecx
lea ecx, [esp + 0x78]
call fcn.005043e0
mov eax, dword [esp + 0x28]
cmp eax, 0x14
jbe 0x5048bb
push edi
push edi
push edi
call dword [sym.imp.KERNEL32.dll_CreateWaitableTimerA]
mov esi, eax
test esi, esi
mov dword [esp + 0x14], esi
je 0x5048e0
lea edx, [esp + 0x74]
push edx
call fcn.00504590
add esp, 4
push 0
push 0
push 0
mov dword [esp + 0x30], eax
push 0
lea eax, [esp + 0x34]
push eax
push esi
mov dword [esp + 0x40], edx
call dword [sym.imp.KERNEL32.dll_SetWaitableTimer]
test eax, eax
setne al
test al, al
je 0x5048e0
mov dword [esp + 0x18], ebp
mov dword [esp + ebp*4 + 0x34], esi
add ebp, 1
jmp 0x5048e0
cmp byte [esp + 0x84], 0
jne 0x5048e4
push edi
push eax
lea ecx, [esp + 0x48]
call fcn.0044d402
mov ecx, 8
mov esi, eax
lea edi, [esp + 0x74]
rep movsd dword es:[edi], dword [esi]
or ebx, 0xffffffff
mov edi, dword [esp + 0x14]
cmp dword [esp + 0x18], ebx
mov byte [esp + 0x24], 0
setne bl
xor esi, esi
test bl, bl
jne 0x50490d
lea ecx, [esp + 0x2c]
push ecx
lea ecx, [esp + 0x78]
call fcn.005043e0
mov edx, dword [eax]
mov esi, dword [eax + 4]
mov dword [esp + 0x24], edx
test ebp, ebp
je 0x504973
test bl, bl
je 0x50491a
or eax, 0xffffffff
jmp 0x50491c
mov eax, esi
push eax
push 0
lea eax, [esp + 0x3c]
push eax
push ebp
call dword [sym.imp.KERNEL32.dll_WaitForMultipleObjects]
cmp eax, ebp
jae 0x50497a
cmp eax, dword [esp + 0x1c]
je 0x50499e
cmp eax, dword [esp + 0x20]
je 0x5049cc
cmp eax, dword [esp + 0x18]
jne 0x50497a
test edi, edi
mov dword [esp + 0x68], 0xffffffff
je 0x50495d
cmp edi, 0xffffffff
je 0x50495d
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x58
ret
push esi
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [esp + 0x84], 0
je 0x504991
add dword [esp + 0x7c], 2
adc dword [esp + 0x80], 0xffffffff
cmp byte [esp + 0x24], 0
jne 0x5048f2
jmp 0x504945
test edi, edi
mov dword [esp + 0x68], 0xffffffff
je 0x5049b6
cmp edi, 0xffffffff
je 0x5049b6
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov ecx, dword [esp + 0x60]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x58
ret
mov eax, dword [0x7271dc]
test eax, eax
je 0x5049dc
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, dword [eax + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_ResetEvent]
push 0x6af23c
lea edx, [esp + 0x74]
xor al, al
push edx
mov byte [esp + 0x78], al
call fcn.00518c50
int3