Function at 0x431540
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x10c
mov eax, dword [0x47ca30]
xor eax, esp
mov dword [esp + 0x108], eax
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, ecx
mov dword [esp + 0x2c], eax
mov eax, dword [ebp + 0x10]
lea esi, [edi + 0x1dc]
push dword [esi]
mov dword [esp + 0x10], eax
mov eax, dword [ebp + 0x14]
mov dword [esp + 0x2c], eax
mov dword [esp + 0x20], 0
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
jne 0x4317d0
push esi
push dword [esi]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4315a7
call fcn.0042da60
lea eax, [esp + 0x10]
mov ecx, edi
push eax
call fcn.0042de40
test byte [ebx], 1
mov dword [esp + 0xf8], 0xf
mov dword [esp + 0xf4], 0
mov byte [esp + 0xe4], 0
je 0x431758
push dword [esp + 0x28]
lea eax, [esp + 0x24]
mov dword [esp + 0x24], edi
push dword [esp + 0x10]
mov ecx, edi
mov byte [esp + 0x2c], 0
push eax
call fcn.00431d50
mov edx, eax
test edx, edx
je 0x431623
mov ecx, dword [esp + 0x10]
sub ecx, dword [edx]
mov eax, dword [esp + 0x14]
sbb eax, dword [edx + 4]
mov dword [edx + 0x14], eax
mov dword [edx + 0x10], ecx
mov ecx, dword [edx + 8]
mov eax, dword [edx + 0xc]
neg ecx
mov dword [edx + 0x18], ecx
adc eax, 0
neg eax
mov dword [edx + 0x1c], eax
mov eax, dword [edi + 0x164]
test al, 8
je 0x4316b8
push edx
lea eax, [esp + 0x14]
mov ecx, edi
push eax
push 0x45
lea eax, [esp + 0x108]
push eax
call fcn.004311b0
lea ecx, [esp + 0xe4]
mov dword [esp + 0xc], eax
cmp ecx, eax
je 0x43169f
cmp dword [esp + 0xf8], 0x10
jb 0x431674
push dword [esp + 0xe4]
call fcn.0045ad4d
mov eax, dword [esp + 0x10]
add esp, 4
push eax
lea ecx, [esp + 0xe8]
mov dword [esp + 0xfc], 0xf
mov dword [esp + 0xf8], 0
mov byte [esp + 0xe8], 0
call fcn.004148d0
cmp dword [esp + 0x110], 0x10
jb 0x4316b8
push dword [esp + 0xfc]
call fcn.0045ad4d
add esp, 4
cmp byte [esp + 0x24], 0
je 0x4316c9
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [esp + 0xf4], 0
je 0x431758
cmp dword [0x482a0c], 2
jg 0x431748
push 1
push 2
lea ecx, [esp + 0x40]
mov dword [esp + 0x24], 2
mov dword [esp + 0x38], 2
call fcn.0041ae70
mov dword [esp + 0xd4], 0x40e410
mov dword [esp + 0xd8], 0x7d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 0x7d7
push 0x40e410
lea ecx, [esp + 0x38]
mov dword [esp + 0xe4], eax
call fcn.0041a0e0
lea eax, [esp + 0xe4]
push eax
lea eax, [esp + 0x3c]
push eax
call fcn.00416480
add esp, 8
test byte [esp + 0x1c], 2
je 0x431758
lea ecx, [esp + 0x30]
call fcn.00419e30
test byte [ebx], 4
je 0x431786
mov eax, dword [edi + 0x40]
test eax, eax
je 0x431786
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push dword [esp + 0x48]
push ebx
push 0x45
push dword [esp + 0x3c]
push dword [esp + 0x3c]
call eax
add esp, 0x30
cmp dword [esp + 0xf8], 0x10
jb 0x43179f
push dword [esp + 0xe4]
call fcn.0045ad4d
add esp, 4
push 0
push dword [esi]
mov dword [esp + 0x100], 0xf
mov dword [esp + 0xfc], 0
mov byte [esp + 0xec], 0
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x4317d0
call fcn.0042da60
mov ecx, dword [esp + 0x114]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0045ed71
mov esp, ebp
pop ebp
ret 0x10