Function at 0x56d8fa
Capabilities:
Set thread local storage value

Disassembly:
push edi
push esi
push ebx
sub esp, 0x10
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x56d598
mov esi, dword [esp + 0x28]
test esi, esi
je 0x56d5d0
add esp, 0x10
mov eax, 1
pop ebx
pop esi
pop edi
ret 0xc
cmp eax, 1
je 0x56d5f8
cmp eax, 3
jne 0x56d586
mov eax, dword [0x67d540]
test eax, eax
je 0x56d860
mov ebx, dword [eax + 0x18]
test ebx, ebx
je 0x56d628
mov edx, dword [eax + 0x18]
cmp dword [edx], 0xffffffff
je 0x56d586
mov edx, dword [eax + 0x18]
test edx, edx
je 0x56d640
mov eax, dword [eax + 0x18]
jmp 0x56d64c
mov eax, dword [0x67d530]
test eax, eax
je 0x56d586
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_RemoveVectoredExceptionHandler]
mov dword [0x67d530], 0
sub esp, 4
jmp 0x56d586
mov dword [esp + 4], 0x56ac90
mov dword [esp], 1
call dword [sym.imp.KERNEL32.dll_AddVectoredExceptionHandler]
sub esp, 8
mov dword [0x67d530], eax
mov eax, 1
add esp, 0x10
pop ebx
pop esi
pop edi
ret 0xc
mov dword [eax + 0x18], 0x660d0c
mov edx, 0x660d0c
jmp 0x56d5b9
mov dword [eax + 0x18], 0x660d0c
mov eax, 0x660d0c
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
test eax, eax
je 0x56d586
test byte [eax + 0x20], 0x30
je 0x56d720
mov eax, dword [eax + 0xb4]
test eax, eax
je 0x56d67d
call fcn.0056d2d0
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x56d6af
mov dword [esp], eax
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x56d6a1
mov dword [esp], eax
call esi
sub esp, 4
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x14], 0
lea eax, [ebx + 0x1c]
mov dword [esp], eax
call fcn.0056aa60
lea eax, [ebx + 0x38]
mov dword [esp], eax
call fcn.0056ac20
cmp eax, 1
je 0x56d8e1
mov eax, dword [ebx + 0xb0]
mov dword [ebx + 0x38], 0xffffffff
test eax, eax
jne 0x56d6e6
mov eax, ebx
call fcn.0056c460
mov eax, dword [0x67d540]
test eax, eax
je 0x56d832
mov ebx, dword [eax + 0x18]
test ebx, ebx
je 0x56d848
mov eax, dword [eax + 0x18]
mov dword [esp + 4], 0
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
jmp 0x56d586
mov edx, dword [ebx + 0x68]
mov eax, dword [eax + 0x18]
test edx, edx
jne 0x56d7f0
test eax, eax
je 0x56d73e
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [ebx + 0xb4]
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x68], 1
test eax, eax
je 0x56d75b
call fcn.0056d2d0
lea esi, [ebx + 0x1c]
lea edi, [ebx + 0x38]
test byte [ebx + 0x24], 4
je 0x56d8c8
mov eax, dword [ebx + 0x14]
mov dword [ebx], 0xdeadbeef
test eax, eax
je 0x56d784
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov dword [ebx + 0x14], 0
mov dword [esp], esi
call fcn.0056aa60
mov dword [esp], edi
call fcn.0056ac20
cmp eax, 1
je 0x56d8e1
mov esi, dword [ebx + 0xb0]
mov dword [ebx + 0x38], 0xffffffff
test esi, esi
jne 0x56d7bc
mov eax, ebx
call fcn.0056c460
mov eax, dword [0x67d540]
test eax, eax
jne 0x56d6f3
call fcn.00571500
mov ecx, dword [eax + 0x18]
mov eax, dword [0x67d540]
test ecx, ecx
je 0x56d848
test eax, eax
jne 0x56d6fe
call fcn.00571500
jmp 0x56d6fe
test eax, eax
je 0x56d800
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
lea eax, [ebx + 0x1c]
mov dword [ebx + 0x18], 0
mov dword [esp], eax
call fcn.0056aa60
lea eax, [ebx + 0x38]
mov dword [esp], eax
call fcn.0056ac20
cmp eax, 1
je 0x56d8e1
mov dword [ebx + 0x38], 0xffffffff
jmp 0x56d586
call fcn.00571500
mov edx, eax
mov eax, dword [0x67d540]
mov edi, dword [edx + 0x18]
test edi, edi
jne 0x56d7da
lea esi, [esi]
mov dword [eax + 0x18], 0x660d0c
mov eax, 0x660d0c
jmp 0x56d701
call fcn.00571500
mov ecx, dword [eax + 0x18]
mov eax, dword [0x67d540]
test ecx, ecx
je 0x56d628
test eax, eax
jne 0x56d5b6
call fcn.00571500
mov eax, dword [eax + 0x18]
cmp dword [eax], 0xffffffff
je 0x56d586
mov eax, dword [0x67d540]
test eax, eax
jne 0x56d5be
call fcn.00571500
mov eax, dword [eax + 0x18]
test eax, eax
mov eax, dword [0x67d540]
je 0x56d640
test eax, eax
jne 0x56d5c5
call fcn.00571500
jmp 0x56d5c5
mov dword [esp], esi
call fcn.0056aa60
mov dword [esp], edi
call fcn.0056ac20
cmp eax, 1
jne 0x56d826
call fcn.0056c2f0
lea esi, [esi]
lea esi, [esi]
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x28
mov eax, dword [ecx]
mov dword [ebp - 0x1c], eax
call fcn.005665c0
mov eax, dword [0x67d540]
test eax, eax
je 0x56db06
cmp dword [eax + 0x30], 0
jne 0x56db25
mov eax, dword [0x67d540]
mov dword [eax + 0x30], 0x660d04
mov eax, 0x660d04
mov dword [esp], eax
call fcn.0056a580
mov eax, dword [ebp - 0x1c]
lea ebx, [eax + 0x1c]
mov dword [esp], ebx
call fcn.0056a580
mov eax, dword [0x67d540]
test eax, eax
je 0x56db4c
cmp dword [eax + 0x14], 0
jne 0x56db2d
mov eax, dword [0x67d540]
mov dword [eax + 0x14], 0x67d51c
mov eax, 0x67d51c
cmp dword [eax], 1
je 0x56db42
call fcn.0056c3e0
mov eax, dword [0x67d540]
test eax, eax
je 0x56db7c
cmp dword [eax + 0x18], 0
jne 0x56db35
mov eax, dword [0x67d540]
mov dword [eax + 0x18], 0x660d0c
mov eax, 0x660d0c
mov esi, dword [ebp - 0x1c]
mov dword [esp + 4], esi
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edi
push edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [esi + 0x3c], eax
mov dword [esp], ebx
call fcn.0056a8d0
lea eax, [esi + 0x70]
mov dword [esp + 4], 0
mov dword [esp], eax
call sub.msvcrt.dll__setjmp3
mov edx, dword [0x67d540]
test eax, eax
jne 0x56db9d
test edx, edx
je 0x56dc18
cmp dword [edx + 0x30], 0
jne 0x56dbc5
mov dword [edx + 0x30], 0x660d04
mov eax, 0x660d04
mov dword [esp], eax
call fcn.0056a8d0
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 8]
test eax, eax
je 0x56dc3e
mov edx, dword [edx + 4]
mov dword [esp], edx
call eax
mov ebx, eax
mov eax, dword [0x67d540]
test eax, eax
je 0x56dbf1
cmp dword [eax + 0x30], 0
jne 0x56dc10
mov dword [eax + 0x30], 0x660d04
mov eax, 0x660d04
mov dword [esp], eax
call fcn.0056a580
mov eax, dword [ebp - 0x1c]
mov dword [eax + 4], ebx
mov eax, dword [eax + 0xb4]
test eax, eax
je 0x56da6e
call fcn.0056d2d0
mov ebx, dword [ebp - 0x1c]
lea esi, [ebx + 0x1c]
mov dword [esp], esi
call fcn.0056a580
mov eax, ebx
mov ebx, dword [ebx + 4]
mov eax, dword [eax + 0x18]
test eax, eax
je 0x56da92
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
mov eax, dword [ebp - 0x1c]
cmp dword [eax + 0x14], 0
mov dword [eax + 0x18], 0
je 0x56dc83
mov dword [esp], esi
call fcn.0056a8d0
mov dword [esp], esi
call fcn.0056aa60
mov eax, dword [ebp - 0x1c]
mov dword [eax + 0x1c], 0xffffffff
mov dword [eax + 0x68], 1
mov esi, 0x660d04
mov eax, dword [0x67d540]
test eax, eax
je 0x56dc5f
cmp dword [eax + 0x30], 0
je 0x56dc51
mov eax, dword [eax + 0x30]
mov dword [esp], eax
call fcn.0056a8d0
test eax, eax
jne 0x56dc48
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_Sleep]
push eax
jmp 0x56dacc
call fcn.00571500
mov edx, eax
mov eax, dword [0x67d540]
cmp dword [edx + 0x30], 0
je 0x56d925
test eax, eax
jne 0x56db25
call fcn.00571500
mov eax, dword [eax + 0x30]
jmp 0x56d936
mov eax, dword [eax + 0x14]
jmp 0x56d974
mov eax, dword [0x67d540]
mov eax, dword [eax + 0x18]
jmp 0x56d9aa
mov eax, dword [0x67d540]
jmp 0x56d98f
call fcn.00571500
mov edx, eax
mov eax, dword [0x67d540]
cmp dword [edx + 0x14], 0
je 0x56d963
test eax, eax
jne 0x56db2d
call fcn.00571500
mov eax, dword [eax + 0x14]
cmp dword [eax], 1
jne 0x56d97d
jmp 0x56d982
call fcn.00571500
mov edx, eax
mov eax, dword [0x67d540]
cmp dword [edx + 0x18], 0
je 0x56d999
test eax, eax
jne 0x56db3a
call fcn.00571500
jmp 0x56db3a
test edx, edx
je 0x56dbd2
cmp dword [edx + 0x30], 0
jne 0x56dbcd
mov eax, dword [0x67d540]
mov dword [eax + 0x30], 0x660d04
mov eax, 0x660d04
mov dword [esp], eax
call fcn.0056a580
jmp 0x56da6e
mov eax, dword [edx + 0x30]
jmp 0x56da0e
mov eax, dword [edx + 0x30]
jmp 0x56dbb8
call fcn.00571500
mov edx, dword [0x67d540]
cmp dword [eax + 0x30], 0
je 0x56dba7
test edx, edx
jne 0x56dbcd
call fcn.00571500
mov eax, dword [eax + 0x30]
jmp 0x56dbb8
call fcn.00571500
mov edx, eax
mov eax, dword [0x67d540]
cmp dword [edx + 0x30], 0
je 0x56da45
test eax, eax
jne 0x56dc10
call fcn.00571500
mov eax, dword [eax + 0x30]
jmp 0x56da51
call fcn.00571500
mov edx, dword [0x67d540]
cmp dword [eax + 0x30], 0
je 0x56da02
test edx, edx
jne 0x56dbc5
call fcn.00571500
mov eax, dword [eax + 0x30]
jmp 0x56da0e
mov ebx, pe_nt_image_headers32
jmp 0x56da2e
mov dword [esp], ebx
call dword [sym.imp.msvcrt.dll__endthreadex]
mov dword [eax + 0x30], 0x660d04
mov eax, esi
jmp 0x56dae6
call fcn.00571500
mov edx, eax
mov eax, dword [0x67d540]
cmp dword [edx + 0x30], 0
je 0x56dc51
test eax, eax
jne 0x56dae3
call fcn.00571500
jmp 0x56dae3
mov edi, dword [ebp - 0x1c]
mov dword [edi], 0xdeadbeef
mov dword [esp], esi
call fcn.0056a8d0
mov dword [esp], esi
call fcn.0056aa60
mov eax, edi
call fcn.0056cda0
mov eax, dword [0x67d540]
test eax, eax
je 0x56dcd8
cmp dword [eax + 0x18], 0
jne 0x56dcf3
mov dword [eax + 0x18], 0x660d0c
mov eax, 0x660d0c
mov dword [esp + 4], 0
mov eax, dword [eax]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
push edx
push edx
jmp 0x56dac7
call fcn.00571500
mov edx, eax
mov eax, dword [0x67d540]
cmp dword [edx + 0x18], 0
je 0x56dcb2
test eax, eax
jne 0x56dcf3
call fcn.00571500
mov eax, dword [eax + 0x18]
jmp 0x56dcbe