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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x1c
call fcn.00596bf0
push ebx
push esi
push edi
mov ecx, dword [ebp + 0xc]
xor edi, edi
mov dword [esp + 0x1c], edi
cmp ecx, edi
je 0x4386fe
jl 0x4386fe
cmp ecx, 1
je 0x4386fe
lea eax, [ecx + 7]
cdq
and edx, 7
lea esi, [edx + eax]
sar esi, 3
lea eax, [ecx - 1]
and eax, 0x80000007
mov dword [esp + 0x18], esi
jns 0x438263
dec eax
or eax, 0xfffffff8
inc eax
lea ecx, [eax + 1]
mov ebx, 0xff
shl ebx, cl
mov dword [esp + 0x24], eax
mov eax, dword [fcn.004196c0]
mov dword [esp + 0x20], ebx
cmp eax, edi
je 0x43829a
cmp eax, fcn.004196c0
je 0x43829a
push 0x27
push str.....crypto_bn_bn_rand.c
push esi
call eax
mov edi, eax
add esp, 0xc
mov dword [esp + 0x10], edi
jmp 0x4382bf
cmp esi, edi
je 0x4386e0
cmp dword [0x61b870], edi
je 0x4382b0
mov dword [0x61b870], edi
push esi
call fcn.0057c0af
add esp, 4
mov edi, eax
mov dword [esp + 0x10], eax
test edi, edi
je 0x4386e0
call fcn.00410600
test eax, eax
je 0x438310
cmp eax, 0x61b810
je 0x438310
call fcn.00410600
test eax, eax
je 0x4382f0
mov eax, dword [eax + 4]
test eax, eax
je 0x4382f0
push esi
push edi
call eax
jmp 0x4384e0
push 0x3ac
push str.....crypto_rand_rand_lib.c
push 0x65
push 0x64
push 0x24
call fcn.0040e790
add esp, 0x14
or eax, 0xffffffff
jmp 0x4384e3
mov eax, dword [0x61fbc4]
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedCompareExchange]
cmp eax, 2
jne 0x438327
mov eax, 1
jmp 0x438349
push 0
push 1
push 0x61fbc4
call ebx
test eax, eax
je 0x4383a3
cmp eax, 1
je 0x438327
mov ecx, dword [0x61fbc4]
xor eax, eax
cmp ecx, 2
sete al
neg eax
sbb eax, eax
test dword [0x61fbcc], eax
je 0x43852e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, dword [0x61f65c]
push eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
push edi
mov esi, eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
test esi, esi
jne 0x4384cb
cmp dword [0x61fb08], esi
je 0x4383be
push 0x270
push str.....cryptoinit.c
push 0x46
push 0x74
push 0xf
call fcn.0040e790
add esp, 0x14
jmp 0x43852e
call fcn.00422b40
mov dword [0x61fbcc], eax
mov dword [0x61fbc4], 2
mov eax, 1
jmp 0x438349
mov ecx, dword [0x61fb14]
cmp ecx, 2
jne 0x4383d0
lea eax, [ecx - 1]
jmp 0x4383f6
push 0
push 1
push 0x61fb14
call ebx
test eax, eax
je 0x438482
cmp eax, 1
je 0x4383d0
mov edx, dword [0x61fb14]
xor eax, eax
cmp edx, 2
sete al
neg eax
sbb eax, eax
test dword [0x61fb1c], eax
je 0x43852e
push 0x410890
mov esi, 0x61fb20
call fcn.0041e240
add esp, 4
neg eax
sbb eax, eax
test dword [0x61fb24], eax
je 0x43852e
push 0x4108c0
mov esi, 0x61fb28
call fcn.0041e240
add esp, 4
neg eax
sbb eax, eax
test dword [0x61fb2c], eax
je 0x43852e
push 1
call fcn.00410750
add esp, 4
test eax, eax
je 0x43852e
mov ecx, dword [0x61f664]
mov ebx, 1
mov dword [eax + 8], ebx
mov eax, dword [0x61fbc8]
push eax
mov edi, ecx
call fcn.00422070
mov esi, eax
add esp, 4
test esi, esi
jne 0x43849b
jmp 0x4384b9
call fcn.00410830
mov dword [0x61fb14], 2
mov eax, 1
jmp 0x4383f6
test edi, edi
jne 0x4384b1
call fcn.00422a70
test eax, eax
jne 0x4384b1
call fcn.004221c0
xor esi, esi
jmp 0x4384b9
mov dword [esi + 0x58], ebx
call fcn.004222a0
mov ecx, dword [0x61f65c]
push esi
push ecx
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test esi, esi
je 0x43852e
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x10]
push edx
push eax
mov ecx, esi
call fcn.00422990
mov ebx, dword [esp + 0x28]
add esp, 8
test eax, eax
jle 0x43852e
mov eax, dword [esp + 0x24]
test eax, eax
jne 0x4384fc
mov eax, dword [esp + 0x10]
or byte [eax + 1], 0x80
mov byte [eax], 1
jmp 0x438509
lea ecx, [eax - 1]
mov eax, dword [esp + 0x10]
mov dl, 3
shl dl, cl
or byte [eax], dl
mov edx, dword [esp + 0x18]
mov ecx, dword [ebp + 8]
not bl
and byte [eax], bl
or byte [edx + eax - 1], 1
push eax
call fcn.00412e70
add esp, 4
test eax, eax
je 0x43852e
mov dword [esp + 0x1c], 1
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x10]
test eax, eax
je 0x438544
push eax
push esi
call fcn.00527a20
add esp, 8
mov eax, dword [fcn.00419900]
test eax, eax
je 0x438563
cmp eax, fcn.00419900
je 0x438563
push 0x58
push str.....crypto_bn_bn_rand.c
push esi
call eax
add esp, 0xc
jmp 0x43856c
push esi
call fcn.0057bec0
add esp, 4
cmp dword [esp + 0x1c], 0
je 0x438713
cmp dword [ebp + 0x10], 0
je 0x438592
mov esi, dword [ebp + 8]
mov ecx, 1
call fcn.00413230
test eax, eax
je 0x438713
mov eax, dword [ebp + 0x14]
mov edi, 0x5de468
lea ecx, [eax + 2]
sub edi, eax
mov dword [esp + 0x1c], 1
mov dword [esp + 0x18], ecx
mov dword [esp + 0x20], edi
nop
movzx edx, word [edi + ecx]
xor eax, eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x14], eax
cmp edx, eax
je 0x438713
mov edx, dword [ebp + 8]
mov esi, dword [edx + 4]
dec esi
js 0x43860a
mov ecx, edx
mov edx, dword [ecx]
lea edi, [edx + esi*4]
mov edx, eax
xor eax, eax
push eax
mov eax, dword [esp + 0x28]
xor ecx, ecx
or ecx, dword [edi]
xor ebx, ebx
push eax
or edx, ebx
push edx
push ecx
call fcn.00587870
sub edi, 4
dec esi
mov dword [esp + 0x14], edx
jns 0x4385d6
cmp eax, 0xffffffff
je 0x438713
mov edi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
mov word [ecx], ax
mov eax, dword [esp + 0x1c]
inc eax
add ecx, 2
mov dword [esp + 0x1c], eax
mov dword [esp + 0x18], ecx
cmp eax, 0x800
jl 0x4385b0
xor edi, edi
jmp 0x438630
mov ebx, dword [ebp + 0x14]
mov esi, 0x5de46a
add ebx, 2
jmp 0x438640
cmp esi, 0x5df468
jge 0x4386b1
cmp dword [ebp + 0xc], 0x1f
jg 0x43866a
cmp edi, 0x7fffffff
ja 0x43866a
mov ecx, dword [ebp + 8]
movzx edx, word [esi]
call fcn.00412de0
imul edx, edx
add eax, edi
cmp edx, eax
ja 0x4386b1
movzx eax, word [ebx]
movzx ecx, word [esi]
xor edx, edx
add eax, edi
div ecx
cmp dword [ebp + 0x10], 0
je 0x438687
mov eax, 1
cmp eax, edx
sbb edx, edx
jmp 0x43868b
neg edx
sbb edx, edx
inc edx
test edx, edx
jne 0x438698
add ebx, 2
add esi, 2
jmp 0x438640
xor edx, edx
cmp dword [ebp + 0x10], edx
setne dl
lea edi, [edi + edx*2 + 2]
cmp edi, 0xffffba38
jbe 0x438630
jmp 0x438223
mov esi, dword [ebp + 8]
push edi
push esi
call fcn.00441f90
add esp, 8
test eax, eax
je 0x438713
push esi
call fcn.004129c0
add esp, 4
cmp eax, dword [ebp + 0xc]
jne 0x438223
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x29
push str.....crypto_bn_bn_rand.c
push 0x41
push 0x7f
push 3
call fcn.0040e790
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 0x5d
push str.....crypto_bn_bn_rand.c
push 0x76
push 0x7f
push 3
call fcn.0040e790
add esp, 0x14
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret