Function at 0x451d50
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x20
mov edi, ecx
mov eax, dword [0x520014]
xor eax, ebp
mov dword [ebp - 0x10], eax
cmp ecx, 8
ja 0x451f4a
lea eax, [edi - 1]
test edi, eax
sete al
test edi, edi
setne cl
test cl, al
je 0x4523dd
mov eax, dword [0x525d08]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x452234
mov eax, 0x20
mov ecx, 0x20
test edx, edx
je 0x451da7
bsr ecx, edx
xor ecx, 0x1f
sub eax, ecx
mov cl, byte [eax + 0x5115f4]
mov esi, edx
shr esi, cl
and esi, 7
mov ecx, dword [eax*4 + 0x511618]
mov dword [ebp - 0x20], edx
and ecx, edx
lea esi, [esi + eax*8]
cmp ecx, 1
sbb esi, 0xffffffff
mov byte [ebp - 0x18], 0
mov edi, dword [ebp - 0x1c]
cmp byte [edi], 2
je 0x4523e0
movzx ebx, word [esi + esi + 0x5113e0]
cmp byte [edi + 2], 0
je 0x4521fe
mov edi, dword [0x526fd0]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push edi
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
test esi, esi
jne 0x452175
cmp edi, 1
jbe 0x4523fc
add dword [edi + 0x308], 1
adc dword [edi + 0x30c], 0
add dword [edi + 0x318], 1
adc dword [edi + 0x31c], 0
cmp word [0x522c90], bx
jae 0x451ef3
add dword [edi + 0x338], 1
adc dword [edi + 0x33c], 0
add dword [edi + 0x328], 1
adc dword [edi + 0x32c], 0
shl ebx, 5
mov eax, dword [ebp - 0x1c]
add ebx, eax
add ebx, 0x10
lea edi, [eax + 8]
xor esi, esi
inc esi
mov dword [ebp - 0x24], 0
mov eax, dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
push edi
call eax
test al, al
jne 0x451eb1
jmp 0x452181
pause
dec eax
jne 0x451e83
mov ecx, dword [ebp - 0x24]
add ecx, esi
add esi, esi
cmp esi, 0x40
mov eax, 0x40
cmovge esi, eax
mov dword [ebp - 0x24], ecx
cmp ecx, 0x3e8
mov eax, dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
jl 0x451e77
mov ecx, edi
call fcn.0045a6c0
mov eax, dword [ebx]
mov esi, dword [eax]
test esi, esi
je 0x451f33
mov byte [ebp - 0x18], 0
mov ecx, dword [esi]
test ecx, ecx
je 0x451ed0
mov edx, ecx
not edx
cmp dword [esi + 4], edx
jne 0x452537
bswap ecx
mov dword [eax], ecx
inc word [eax + 0xc]
push edi
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0048a678
mov eax, esi
add esp, 0x20
pop esi
pop edi
pop ebx
pop ebp
ret
cmp dword [edi + ebx*8], 0
je 0x452081
add dword [edi + 0x320], 1
adc dword [edi + 0x324], 0
mov esi, dword [edi + ebx*8]
mov eax, dword [esi]
test eax, eax
je 0x451f21
mov ecx, eax
not ecx
cmp dword [esi + 4], ecx
jne 0x452537
bswap eax
dec byte [edi + ebx*8 + 4]
mov dword [edi + ebx*8], eax
test esi, esi
jne 0x451edf
jmp 0x451e5a
lea eax, [ebp - 0x18]
mov ecx, ebx
push eax
push dword [ebp - 0x20]
push 0
push dword [ebp - 0x1c]
call fcn.00466690
mov esi, eax
jmp 0x451ed8
mov eax, dword [0x525d08]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x452309
lea ebx, [edi - 1]
test edi, ebx
sete al
test edi, edi
setne cl
test cl, al
je 0x452439
cmp edx, edi
jb 0x451f89
mov eax, edx
dec eax
je 0x45216b
bsr ecx, eax
xor ecx, 0x1f
neg cl
xor edi, edi
inc edi
shl edi, cl
cmp edi, edx
jb 0x45243c
bsr eax, edi
xor eax, 0xffffffe0
mov cl, byte [eax + 0x511615]
mov edx, edi
shr edx, cl
and edx, 7
mov ecx, dword [eax*4 + 0x51169c]
and ecx, edi
lea esi, [edx + eax*8]
add esi, 0x108
cmp ecx, 1
sbb esi, 0xffffffff
mov byte [ebp - 0x18], 0
mov ecx, dword [ebp - 0x1c]
cmp byte [ecx], 2
je 0x452442
mov dword [ebp - 0x24], ebx
movzx eax, word [esi + esi + 0x5113e0]
mov dword [ebp - 0x20], eax
cmp byte [ecx + 2], 0
je 0x452461
mov ebx, dword [0x526fd0]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push ebx
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ebx, eax
test esi, esi
jne 0x4521e0
cmp ebx, 1
jbe 0x4524aa
add dword [ebx + 0x308], 1
adc dword [ebx + 0x30c], 0
add dword [ebx + 0x318], 1
adc dword [ebx + 0x31c], 0
mov ecx, dword [ebp - 0x20]
cmp word [0x522c90], cx
mov edx, dword [ebp - 0x1c]
jb 0x4520b5
cmp dword [ebx + ecx*8], 0
je 0x4521a4
add dword [ebx + 0x320], 1
adc dword [ebx + 0x324], 0
mov esi, dword [ebx + ecx*8]
mov eax, dword [esi]
test eax, eax
je 0x452068
mov ecx, eax
not ecx
cmp dword [esi + 4], ecx
mov ecx, dword [ebp - 0x20]
jne 0x452537
bswap eax
dec byte [ebx + ecx*8 + 4]
mov dword [ebx + ecx*8], eax
test esi, esi
je 0x4520d1
test dword [ebp - 0x24], esi
je 0x451edf
int3
add dword [edi + 0x330], 1
adc dword [edi + 0x334], 0
add dword [edi + 0x328], 1
adc dword [edi + 0x32c], 0
mov ecx, edi
push ebx
call fcn.0047e540
mov esi, dword [edi + ebx*8]
test esi, esi
jne 0x451f0e
jmp 0x451e5a
add dword [ebx + 0x338], 1
adc dword [ebx + 0x33c], 0
add dword [ebx + 0x328], 1
adc dword [ebx + 0x32c], 0
shl ecx, 5
lea eax, [edx + ecx]
add eax, 0x10
mov dword [ebp - 0x20], eax
lea ecx, [edx + 8]
xor eax, eax
inc eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x2c], 0
mov esi, dword [sym.imp.KERNEL32.dll_TryAcquireSRWLockExclusive]
mov ebx, ecx
push ecx
call esi
test al, al
jne 0x452132
jmp 0x4521ec
pause
dec eax
jne 0x452101
mov eax, dword [ebp - 0x2c]
add eax, dword [ebp - 0x28]
mov dword [ebp - 0x2c], eax
mov ecx, dword [ebp - 0x28]
add ecx, ecx
cmp ecx, 0x40
mov eax, 0x40
cmovge ecx, eax
mov dword [ebp - 0x28], ecx
cmp dword [ebp - 0x2c], 0x3e8
mov ecx, ebx
jl 0x4520f3
call fcn.0045a6c0
mov ecx, dword [ebp - 0x20]
mov eax, dword [ecx]
mov esi, dword [eax]
test esi, esi
mov edx, dword [ebp - 0x1c]
je 0x452193
mov byte [ebp - 0x18], 0
mov ecx, dword [esi]
test ecx, ecx
je 0x452157
mov edx, ecx
not edx
cmp dword [esi + 4], edx
jne 0x452537
bswap ecx
mov dword [eax], ecx
inc word [eax + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_ReleaseSRWLockExclusive]
jmp 0x452075
mov ecx, 0x20
jmp 0x451f82
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x451e0c
mov eax, esi
test esi, esi
jg 0x451e83
mov ecx, dword [ebp - 0x24]
jmp 0x451e8d
lea eax, [ebp - 0x18]
push eax
push edi
push 0
push edx
call fcn.00466690
mov esi, eax
jmp 0x45215f
add dword [ebx + 0x330], 1
adc dword [ebx + 0x334], 0
add dword [ebx + 0x328], 1
adc dword [ebx + 0x32c], 0
mov ecx, ebx
push dword [ebp - 0x20]
call fcn.0047e540
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
mov esi, dword [ebx + ecx*8]
test esi, esi
jne 0x452052
jmp 0x4520d1
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x452003
mov ecx, dword [ebp - 0x28]
mov eax, ecx
test ecx, ecx
jg 0x452101
jmp 0x45210f
shl ebx, 5
mov esi, dword [ebp - 0x1c]
lea edi, [esi + 8]
mov ecx, edi
call fcn.00477df0
mov eax, dword [esi + ebx + 0x10]
mov esi, dword [eax]
test esi, esi
jne 0x451eb9
mov edx, dword [ebp - 0x1c]
lea ecx, [edx + ebx]
add ecx, 0x10
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0x20]
push 0
push edx
jmp 0x451f41
mov esi, edx
mov cl, 1
xor eax, eax
lock cmpxchg byte [0x525d0c], cl
jne 0x452238
mov eax, dword [0x525d08]
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x4522fb
mov dword [ebp - 0x18], 0x10101
xor ebx, ebx
mov byte [ebp - 0x14], bl
mov dword [0x525d10], 0x1000000
mov edi, 0x525d10
mov byte [0x525d17], 1
mov dword [0x525d18], ebx
push 0x1100
push ebx
push 0x525d20
call fcn.0048d770
add esp, 0xc
mov byte [0x526e40], bl
mov dword [0x526eac], ebx
xorps xmm0, xmm0
movups xmmword [0x526e44], xmm0
movups xmmword [0x526e54], xmm0
movups xmmword [0x526e64], xmm0
movups xmmword [0x526e74], xmm0
movups xmmword [0x526e84], xmm0
movups xmmword [0x526e94], xmm0
mov dword [0x526ea6], ebx
mov dword [0x526ea2], ebx
sub esp, 8
mov al, byte [ebp - 0x14]
mov byte [esp + 4], al
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov ecx, 0x525d10
call fcn.00411690
mov dword [ebp - 0x1c], 0x525d10
mov dword [0x525d08], edi
mov byte [0x525d0c], 0
mov edx, esi
jmp 0x451d93
mov esi, edx
mov cl, 1
xor eax, eax
lock cmpxchg byte [0x525d0c], cl
jne 0x45230d
mov eax, dword [0x525d08]
mov dword [ebp - 0x1c], eax
test eax, eax
jne 0x4523cf
mov dword [ebp - 0x18], 0x10101
xor ebx, ebx
mov byte [ebp - 0x14], bl
mov dword [0x525d10], 0x1000000
mov byte [0x525d17], 1
mov dword [0x525d18], ebx
push 0x1100
push ebx
push 0x525d20
call fcn.0048d770
add esp, 0xc
mov byte [0x526e40], bl
mov dword [0x526eac], ebx
xorps xmm0, xmm0
movups xmmword [0x526e44], xmm0
movups xmmword [0x526e54], xmm0
movups xmmword [0x526e64], xmm0
movups xmmword [0x526e74], xmm0
movups xmmword [0x526e84], xmm0
movups xmmword [0x526e94], xmm0
mov dword [0x526ea6], ebx
mov dword [0x526ea2], ebx
sub esp, 8
mov al, byte [ebp - 0x14]
mov byte [esp + 4], al
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
mov ecx, 0x525d10
call fcn.00411690
mov dword [ebp - 0x1c], 0x525d10
mov eax, 0x525d10
mov dword [0x525d08], eax
mov byte [0x525d0c], 0
mov edx, esi
jmp 0x451f5a
int3
mov al, byte [0x522cc8]
cmp al, 2
jne 0x451ddb
mov ecx, 0x522cb8
call fcn.004b3dd0
jmp 0x451ddb
je 0x451e5a
mov esi, dword [ebp - 0x1c]
mov byte [esi + 2], 0
push esi
call fcn.0045a4b0
add esp, 4
mov edi, eax
mov byte [esi + 2], 1
add dword [eax + 0x308], 1
adc dword [eax + 0x30c], 0
add dword [eax + 0x318], 1
adc dword [eax + 0x31c], 0
jmp 0x451e31
int3
push edx
call fcn.004ecba0
mov al, byte [0x522cc8]
cmp al, 2
jne 0x451fcc
mov ecx, 0x522cb8
call fcn.004b3dd0
mov ecx, dword [ebp - 0x1c]
jmp 0x451fcc
mov ebx, dword [ebp - 0x20]
shl ebx, 5
mov esi, dword [ebp - 0x1c]
lea ecx, [esi + 8]
mov dword [ebp - 0x20], ecx
call fcn.00477df0
mov eax, dword [esi + ebx + 0x10]
mov esi, dword [eax]
test esi, esi
je 0x45253c
mov byte [ebp - 0x18], 0
mov ecx, dword [esi]
test ecx, ecx
je 0x45249a
mov edx, ecx
not edx
cmp dword [esi + 4], edx
jne 0x452537
bswap ecx
mov dword [eax], ecx
inc word [eax + 0xc]
push dword [ebp - 0x20]
jmp 0x452160
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
je 0x4520d1
mov byte [edx + 2], 0
push edx
mov esi, edx
call fcn.0045a4b0
add esp, 4
mov ebx, eax
mov byte [esi + 2], 1
add dword [eax + 0x308], 1
adc dword [eax + 0x30c], 0
add dword [eax + 0x318], 1
adc dword [eax + 0x31c], 0
mov eax, dword [ebp - 0x20]
cmp word [0x522c90], ax
jb 0x452559
mov eax, dword [ebp - 0x20]
cmp dword [ebx + eax*8], 0
je 0x452580
add dword [ebx + 0x320], 1
adc dword [ebx + 0x324], 0
mov eax, dword [ebp - 0x20]
mov esi, dword [ebx + eax*8]
mov eax, dword [esi]
test eax, eax
je 0x452523
mov ecx, eax
not ecx
cmp dword [esi + 4], ecx
jne 0x452537
bswap eax
mov ecx, dword [ebp - 0x20]
dec byte [ebx + ecx*8 + 4]
mov dword [ebx + ecx*8], eax
mov edx, dword [ebp - 0x1c]
jmp 0x452071
call fcn.004b42d0
mov edx, dword [ebp - 0x1c]
lea ecx, [edx + ebx]
add ecx, 0x10
lea eax, [ebp - 0x18]
push eax
push edi
push 0
push edx
call fcn.00466690
mov esi, eax
jmp 0x4524a2
add dword [ebx + 0x338], 1
adc dword [ebx + 0x33c], 0
add dword [ebx + 0x328], 1
adc dword [ebx + 0x32c], 0
mov edx, dword [ebp - 0x1c]
mov ecx, dword [ebp - 0x20]
jmp 0x4520d1
add dword [ebx + 0x330], 1
adc dword [ebx + 0x334], 0
add dword [ebx + 0x328], 1
adc dword [ebx + 0x32c], 0
mov ecx, ebx
mov esi, dword [ebp - 0x20]
push esi
call fcn.0047e540
mov ecx, esi
mov esi, dword [ebx + esi*8]
test esi, esi
mov edx, dword [ebp - 0x1c]
jne 0x452514
jmp 0x4520d1