Function at 0x10051040
Capabilities:
Get thread local storage value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
push dword [0x100c7608]
mov edi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
call edi
mov esi, eax
mov dword [ebp - 0x14], esi
test esi, esi
jne 0x1005106a
lea eax, [esi + 4]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push dword [esi + 0x84]
mov eax, dword [esi + 0x1a3f8]
push 0xaa
push eax
mov dword [esi + 0x18378], 0
mov dword [esi + 0x18374], 0
mov dword [esi + 0x1b404], 0
mov dword [esi + 0x1b408], 0
mov dword [esi + 0x1a3fc], eax
mov byte [esi + 0x1837c], 0
mov dword [esi + 0x18344], 0xffffffff
call fcn.1007cff0
mov ecx, dword [esi + 0x71b4]
add esp, 0xc
test ecx, ecx
je 0x100510de
push dword [esi + 0x71b8]
lea eax, [esi + 0x6124]
push 0
push eax
call ecx
xor ebx, ebx
mov dword [esi + 0x6118], 0
mov dword [esi + 0x611c], 0
mov dword [esi + 0x48], 0
mov dword [esi + 0x4c], 0
cmp dword [esi + 0x712c], ebx
jl 0x1005144d
jg 0x1005111c
cmp dword [esi + 0x7128], ebx
jbe 0x1005144d
cmp dword [esi + 0x7134], ebx
jl 0x1005144d
jg 0x10051136
cmp dword [esi + 0x7130], ebx
jbe 0x1005144d
movzx eax, word [esi + 0x7160]
cmp eax, 9
ja case.0x10051146.7
jmp dword [eax*4 + 0x1005167c]
mov edx, esi
lea ecx, [ebp - 4]
call fcn.1004f8d0
test eax, eax
je 0x1005144d
nop
cmp dword [esi + 0x1b410], ebx
jne 0x1005144d
cmp dword [esi + 4], ebx
jne 0x1005144d
mov ecx, dword [esi + 0x1a3fc]
mov al, byte [ebp - 4]
mov byte [ecx], al
inc dword [esi + 0x1b408]
inc dword [esi + 0x1a3fc]
mov eax, dword [esi + 0x1b408]
cmp eax, dword [esi + 0x84]
jne 0x100511a1
mov ecx, esi
call fcn.1004fed0
mov edx, esi
lea ecx, [ebp - 4]
call fcn.1004f8d0
test eax, eax
jne 0x10051160
jmp 0x1005144d
call fcn.100528a0
jmp 0x1005144d
call fcn.10052e40
jmp 0x1005144d
call fcn.10054810
test eax, eax
je 0x1005144d
cmp eax, 5
je 0x1005144d
lea ebx, [eax - 3]
neg ebx
sbb ebx, ebx
and ebx, 0xfffffffd
add ebx, 5
jmp 0x1005144d
push dword [0x100c7608]
mov dword [ebp - 4], ebx
call edi
mov edi, eax
test edi, edi
jne 0x10051209
lea ebx, [eax + 1]
jmp 0x10051316
mov dword [edi + 0x1b420], ebx
mov dword [edi + 0x1b42c], ebx
mov dword [edi + 0x1b428], ebx
mov dword [edi + 0x6118], ebx
mov dword [edi + 0x611c], ebx
jmp 0x10051230
mov edx, edi
mov dword [edi + 0x1b434], ebx
lea ecx, [ebp - 0x10]
call fcn.10055bd0
test eax, eax
jne 0x10051314
cmp dword [edi + 0x34], ebx
je 0x10051264
cmp dword [edi + 0x3c], ebx
je 0x10051264
cmp dword [edi + 0x18370], ebx
ja 0x10051264
mov eax, 1
mov dword [ebp - 4], eax
jmp 0x10051267
mov eax, dword [ebp - 4]
cmp dword [edi + 0x1b410], ebx
jne 0x1005127d
cmp dword [edi + 4], ebx
jne 0x1005127d
cmp dword [ebp - 0x10], ebx
jne 0x1005127d
test eax, eax
je 0x10051230
mov edx, dword [edi + 0x1b420]
lea ecx, [edi + 0x8344]
xor eax, eax
mov dword [ebp - 0x10], edx
mov dword [ebp - 0xc], eax
mov dword [ebp - 8], ecx
test edx, edx
je 0x1005144d
lea esp, [esp]
test eax, eax
jne 0x1005144d
mov eax, dword [edi + 0x84]
sub eax, dword [edi + 0x1b408]
mov dword [ebp - 4], eax
cmp eax, edx
jb 0x100512c0
mov eax, edx
mov dword [ebp - 4], edx
push eax
push ecx
push dword [edi + 0x1a3fc]
call fcn.1007d410
mov ecx, dword [ebp - 4]
add esp, 0xc
add dword [edi + 0x1b408], ecx
add dword [edi + 0x1a3fc], ecx
mov eax, dword [edi + 0x1b408]
cmp eax, dword [edi + 0x84]
jne 0x100512fc
mov ecx, edi
call fcn.1004fed0
mov ecx, dword [ebp - 4]
mov dword [ebp - 0xc], eax
jmp 0x100512ff
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
add dword [ebp - 8], ecx
sub edx, ecx
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x10], edx
jne 0x100512a0
jmp 0x1005144d
mov ebx, eax
cmp dword [esi + 0x34], 0
je 0x10051328
cmp ebx, 1
jne 0x10051328
xor ebx, ebx
jmp 0x1005144d
sub ebx, 3
neg ebx
sbb ebx, ebx
and ebx, 0xfffffffd
add ebx, 5
jmp 0x1005144d
push dword [0x100c7608]
mov dword [ebp - 4], ebx
call edi
mov edi, eax
test edi, edi
jne 0x10051353
lea eax, [edi + 1]
jmp 0x10051432
mov dword [edi + 0x1b420], ebx
mov dword [edi + 0x1b42c], ebx
mov dword [edi + 0x1b428], ebx
mov edx, edi
lea ecx, [ebp - 0x10]
call fcn.1004ead0
test eax, eax
jne 0x10051432
cmp dword [edi + 0x34], ebx
je 0x10051393
cmp dword [edi + 0x3c], ebx
je 0x10051393
cmp dword [edi + 0x18370], ebx
ja 0x10051393
mov eax, 1
mov dword [ebp - 4], eax
jmp 0x10051396
mov eax, dword [ebp - 4]
cmp dword [edi + 0x1b410], ebx
jne 0x100513ac
cmp dword [edi + 4], ebx
jne 0x100513ac
cmp dword [ebp - 0x10], ebx
jne 0x100513ac
test eax, eax
je 0x10051365
mov edx, dword [edi + 0x1b420]
xor eax, eax
mov dword [ebp - 0xc], edx
mov dword [ebp - 0x10], eax
test edx, edx
je 0x1005142e
lea esi, [edi + 0x8344]
test eax, eax
jne 0x1005142b
mov eax, dword [edi + 0x84]
sub eax, dword [edi + 0x1b408]
mov dword [ebp - 8], eax
cmp eax, edx
jb 0x100513e0
mov eax, edx
mov dword [ebp - 8], edx
push eax
push esi
push dword [edi + 0x1a3fc]
call fcn.1007d410
mov ecx, dword [ebp - 8]
add esp, 0xc
add dword [edi + 0x1b408], ecx
add dword [edi + 0x1a3fc], ecx
mov eax, dword [edi + 0x1b408]
cmp eax, dword [edi + 0x84]
jne 0x1005141c
mov ecx, edi
call fcn.1004fed0
mov ecx, dword [ebp - 8]
mov dword [ebp - 0x10], eax
jmp 0x1005141f
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 0xc]
add esi, ecx
sub edx, ecx
mov dword [ebp - 0xc], edx
jne 0x100513c4
mov esi, dword [ebp - 0x14]
test eax, eax
je 0x1005144d
cmp dword [esi + 0x34], ebx
je 0x100511de
cmp eax, 1
jne 0x100511de
xor ebx, ebx
jmp 0x1005144d
mov ebx, 0x2a
mov eax, dword [esi + 0x1f55c]
cmp eax, 2
je 0x1005145d
cmp eax, 1
jne 0x100514cc
lea eax, [esi + 0x1f8b8]
mov edx, 0xa
push eax
lea ecx, [esi + 0x1f964]
call fcn.1004d1c0
add esp, 4
test ebx, ebx
jne 0x100514cc
mov dword [esi + 0x82b0], ebx
xor edi, edi
mov dword [esi + 0x7128], 0xa
mov dword [esi + 0x712c], ebx
mov edx, esi
lea ecx, [ebp - 4]
call fcn.1004f8d0
test eax, eax
je 0x100514c0
cmp dword [esi + 0x1b410], 0
jne 0x100514c0
cmp dword [esi + 4], 0
jne 0x100514c0
mov al, byte [ebp - 4]
mov byte [esi + edi + 0x1f96e], al
inc edi
cmp edi, 0xa
jl 0x10051493
mov dword [esi + 0x82b0], 1
jmp 0x100514de
cmp ebx, 0x2a
je 0x10051672
cmp ebx, 0x27
je 0x10051672
cmp dword [esi + 0x20], 0
je 0x100514f0
mov eax, 3
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [esi + 4], 0
je 0x10051527
cmp dword [esi + 0x34], 0
jne 0x10051502
cmp dword [esi + 0x2c], 0
je 0x1005151b
cmp dword [esi + 0x1b410], 2
jne 0x1005151b
mov dword [esi + 4], 0
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 0x30
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x1b410]
test eax, eax
je 0x10051575
cmp dword [esi + 0x34], 0
jne 0x1005154c
cmp dword [esi + 0x2c], 0
jne 0x1005154c
cmp eax, 1
jg 0x10051597
mov ebx, 1
jmp 0x100515ca
cmp eax, 3
je 0x100515bc
cmp eax, 2
jne 0x1005156c
cmp dword [esi + 0x2c], 0
je 0x10051597
mov eax, dword [esi + 0x48]
cmp eax, dword [esi + 0x50]
jne 0x10051597
mov eax, dword [esi + 0x4c]
cmp eax, dword [esi + 0x54]
jne 0x10051597
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, esi
call fcn.1004fed0
test eax, eax
je 0x100515ca
mov eax, dword [esi + 0x1b410]
mov ecx, dword [esi + 0x34]
cmp eax, 1
jle 0x100515aa
test ecx, ecx
jne 0x100515a3
cmp dword [esi + 0x2c], ecx
jne 0x100515a3
mov eax, 0x32
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp eax, 2
jne 0x100515bc
jmp 0x100515ca
test ecx, ecx
jne 0x100515b8
cmp dword [esi + 0x2c], ecx
jne 0x100515b8
lea ebx, [ecx + 2]
jmp 0x100515ca
test eax, eax
je 0x100515c8
mov eax, 2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor ebx, ebx
cmp dword [esi + 0x6108], 0
jne 0x100515e6
cmp dword [esi + 0x2c], 0
jne 0x100515e6
cmp dword [esi + 0x34], 0
jne 0x100515e6
xor ecx, ecx
call fcn.100505d0
cmp ebx, 1
ja 0x10051672
cmp dword [esi + 0x2c], 0
je 0x10051615
mov eax, dword [esi + 0x58]
or eax, dword [esi + 0x5c]
jne 0x10051672
mov ecx, dword [esi + 0x716e]
add ecx, dword [esi + 0x70]
adc eax, dword [esi + 0x74]
cmp eax, dword [esi + 0x54]
jg 0x10051672
jl 0x10051615
cmp ecx, dword [esi + 0x50]
ja 0x10051672
cmp dword [esi + 0x34], 0
jne 0x10051672
mov eax, dword [esi + 0x1f55c]
cmp eax, 2
je 0x10051641
cmp eax, 1
je 0x10051641
mov eax, dword [esi + 0x18344]
not eax
cmp eax, dword [esi + 0x7166]
mov dword [esi + 0x18344], eax
jmp 0x1005166b
mov eax, dword [esi + 0x1f964]
cmp eax, dword [esi + 0x1f96e]
jne 0x1005166d
mov eax, dword [esi + 0x1f968]
cmp eax, dword [esi + 0x1f972]
jne 0x1005166d
movzx eax, word [esi + 0x1f96c]
cmp ax, word [esi + 0x1f976]
je 0x10051672
mov ebx, 0x27
pop edi
pop esi
mov eax, ebx
pop ebx
mov esp, ebp
pop ebp
ret