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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x170
mov eax, dword [0x102519c8]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [0x1025b434], 0
push ebx
mov ebx, ecx
mov dword [ebp - 0x154], ebx
jne 0x101863b6
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.101f99c6
mov esp, ebp
pop ebp
ret
push esi
push edi
call fcn.101aa940
push eax
call fcn.101aae40
add esp, 4
call fcn.101aa770
mov eax, dword [0x1025b450]
mov esi, dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov edi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov byte [0x1025adb8], 0
cmp eax, 0xffffffff
je 0x1018642b
cmp dword [0x1025b454], 0xffffffff
je 0x1018642b
push eax
mov dword [ebp - 0x13c], 0
call edi
test eax, eax
jne 0x1018642b
mov eax, dword [0x1025b458]
test eax, eax
je 0x1018642b
lea ecx, [ebp - 0x13c]
push ecx
call eax
push eax
push dword [0x1025b450]
call esi
push dword [ebp - 0x13c]
push dword [0x1025b454]
call esi
mov esi, dword [ebx + 0x218]
cmp esi, dword [ebx + 0x21c]
je 0x10186e86
mov eax, 0x10205260
lea edi, [ebx + 0xf8]
shr eax, 0x10
mov dword [ebp - 0x164], eax
mov ecx, ebx
call fcn.101a2480
cmp dword [esi + 0x14], 8
mov ecx, esi
jb 0x10186462
mov ecx, dword [esi]
fld qword [ebx + 0xd0]
fnstcw word [ebp - 0x142]
movzx eax, word [ebp - 0x142]
or eax, 0xc00
mov dword [ebp - 0x14c], eax
push 0x64
fldcw word [ebp - 0x14c]
fistp qword [ebp - 0x160]
mov eax, dword [ebp - 0x160]
push eax
push ecx
fldcw word [ebp - 0x142]
push str.ScanFileName
mov ecx, ebx
call fcn.100d0960
test eax, eax
jne 0x101864b6
mov dword [ebx + 0xc8], 1
mov dword [ebx + 0xf0], 0
mov eax, edi
cmp dword [edi + 0x14], 8
mov dword [edi + 0x10], 0
jb 0x101864d1
mov eax, dword [edi]
xor ecx, ecx
mov word [eax], cx
lea eax, [ebx + 0x110]
cmp dword [eax + 0x14], 8
mov dword [eax + 0x10], ecx
jb 0x101864e7
mov eax, dword [eax]
xor ecx, ecx
mov word [eax], cx
lea eax, [ebx + 0x128]
mov dword [ebx + 0xf4], ecx
cmp dword [eax + 0x14], 8
mov dword [eax + 0x10], ecx
jb 0x10186503
mov eax, dword [eax]
xor ecx, ecx
mov word [eax], cx
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x10186518
mov eax, dword [ecx]
call dword [eax + 0x1c]
mov edi, eax
jmp 0x1018651d
mov edi, 0x10202940
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x134], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x130], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x12c], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x128], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
lea ecx, [ebp - 0x120]
push edi
mov dword [ebp - 0x124], eax
call fcn.101221f0
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x24], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x20], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x1c], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x18], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x14], eax
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
mov dword [ebp - 0x138], 0
cmp dword [esi + 0x14], 8
mov edx, esi
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
jb 0x10186620
mov edx, dword [esi]
test edx, edx
jne 0x10186628
xor ecx, ecx
jmp 0x1018663f
mov ecx, edx
lea edi, [ecx + 2]
lea ecx, [ecx]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10186630
sub ecx, edi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x124]
call fcn.10003740
mov eax, dword [ebx + 0x228]
lea ecx, [eax - 1]
neg ecx
sbb ecx, ecx
and ecx, 0xfffffffe
add ecx, 2
mov dword [ebp - 0x15c], ecx
cmp eax, 5
jne 0x10186674
mov dword [ebx + 0xe4], 1
cmp dword [esi + 0x14], 8
mov eax, esi
jb 0x1018667e
mov eax, dword [esi]
push eax
lea ecx, [ebp - 0x148]
call fcn.10002490
mov edi, dword [ebp - 0x148]
mov ebx, 0x10202944
push 1
sub ebx, edi
mov dword [ebp - 0x13c], 0x10202944
push 0x10202944
mov eax, dword [edi - 0xc]
sar ebx, 1
mov dword [ebp - 0x140], eax
call fcn.101e6fd0
mov edx, dword [ebp - 0x140]
mov ecx, 1
sub ecx, dword [edi - 4]
add edx, eax
mov dword [ebp - 0x14c], eax
add esp, 8
mov eax, dword [edi - 8]
sub eax, edx
or ecx, eax
jge 0x101866ec
push edx
lea ecx, [ebp - 0x148]
call fcn.10003310
mov edi, dword [ebp - 0x148]
mov ecx, dword [ebp - 0x140]
cmp ebx, ecx
ja 0x101866ff
lea eax, [edi + ebx*2]
mov dword [ebp - 0x13c], eax
mov ebx, dword [ebp - 0x14c]
lea eax, [ebx + ebx]
push eax
push dword [ebp - 0x13c]
push eax
lea eax, [edi + ecx*2]
push eax
call fcn.10004510
mov eax, dword [ebp - 0x140]
xor ecx, ecx
add eax, ebx
mov dword [ebp - 0x150], esi
mov dword [edi - 0xc], eax
add esp, 0x10
mov word [edi + eax*2], cx
cmp dword [esi + 0x14], 8
jb 0x10186741
mov ecx, dword [esi]
mov dword [ebp - 0x150], ecx
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0xc]
add eax, 0x10
cmp dword [ebp - 0x164], 0
mov dword [ebp - 0x144], eax
jne 0x1018689a
push 0
mov ecx, 0x1025bea0
call fcn.101beff4
mov ebx, eax
mov dword [ebp - 0x140], 1
test ebx, ebx
je 0x101868ac
mov ecx, 0x10205260
movzx eax, cx
shr eax, 4
inc eax
mov dword [ebp - 0x13c], eax
push 0
push eax
push 6
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceExW]
test eax, eax
je 0x101867bc
mov edx, 0x10205260
movzx ecx, dx
push ecx
push eax
push ebx
call fcn.10003980
add esp, 0xc
test eax, eax
jne 0x101867e4
push dword [ebp - 0x140]
mov ecx, 0x1025bea0
call fcn.101beff4
inc dword [ebp - 0x140]
mov ebx, eax
test ebx, ebx
je 0x101868ac
mov eax, dword [ebp - 0x13c]
jmp 0x10186795
test ebx, ebx
je 0x101868ac
push 6
push dword [ebp - 0x13c]
push ebx
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov ecx, eax
test ecx, ecx
je 0x101868ac
mov edx, 0x10205260
movzx eax, dx
push eax
push ecx
push ebx
call fcn.10003980
add esp, 0xc
mov dword [ebp - 0x13c], eax
test eax, eax
je 0x101868ac
movzx eax, word [eax]
mov edx, 1
mov ebx, eax
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x144]
mov ecx, dword [eax - 8]
sub edx, dword [eax - 4]
sub ecx, ebx
or edx, ecx
jge 0x1018686b
push ebx
lea ecx, [ebp - 0x144]
call fcn.10003310
mov ecx, dword [ebp - 0x13c]
movzx eax, word [ecx]
mov dword [ebp - 0x140], eax
mov eax, dword [ebp - 0x144]
jmp 0x10186871
mov ecx, dword [ebp - 0x13c]
mov edx, dword [ebp - 0x140]
add ecx, 2
movzx edx, dx
push edx
push ecx
push ebx
push eax
call fcn.101eb860
mov eax, dword [ebp - 0x144]
add esp, 0x10
xor ecx, ecx
mov dword [eax - 0xc], ebx
mov word [eax + ebx*2], cx
jmp 0x101868b2
push 4
push 0x10205260
lea ecx, [ebp - 0x144]
call fcn.10003740
mov eax, dword [ebp - 0x144]
mov ecx, dword [eax - 0x10]
add eax, 0xfffffff0
mov dword [ebp - 0x16c], eax
test ecx, ecx
je 0x101868cd
mov eax, dword [ecx]
call dword [eax + 0x10]
mov ecx, eax
test ecx, ecx
jne 0x101868db
call fcn.10002d70
mov ecx, eax
mov edx, dword [eax]
call dword [edx + 0x10]
mov ecx, eax
mov eax, dword [ecx]
call dword [eax + 0xc]
lea ecx, [eax + 0x10]
mov eax, dword [ebp - 0x150]
mov dword [ebp - 0x140], ecx
mov dword [ebp - 0x158], ecx
test eax, eax
jne 0x101868fd
xor edx, edx
jmp 0x10186911
mov edx, eax
lea ebx, [edx + 2]
mov ax, word [edx]
add edx, 2
test ax, ax
jne 0x10186902
sub edx, ebx
sar edx, 1
mov eax, dword [ebp - 0x144]
mov dword [ebp - 0x14c], edx
mov ebx, dword [eax - 0xc]
add edx, ebx
mov dword [ebp - 0x168], ebx
mov ebx, 1
sub ebx, dword [ecx - 4]
mov dword [ebp - 0x13c], edx
mov edx, dword [ecx - 8]
sub edx, dword [ebp - 0x13c]
or ebx, edx
jge 0x10186966
push dword [ebp - 0x13c]
lea ecx, [ebp - 0x158]
call fcn.10003310
mov ecx, dword [ebp - 0x158]
mov eax, dword [ebp - 0x144]
mov dword [ebp - 0x140], ecx
mov ebx, dword [ebp - 0x168]
add ebx, ebx
push ebx
push eax
push ebx
push ecx
call fcn.10004510
mov eax, dword [ebp - 0x14c]
mov ecx, dword [ebp - 0x150]
add eax, eax
push eax
push ecx
push eax
mov eax, dword [ebp - 0x140]
add eax, ebx
push eax
call fcn.10004510
mov eax, dword [ebp - 0x140]
xor edx, edx
mov ecx, dword [ebp - 0x13c]
add esp, 0x20
mov dword [eax - 0xc], ecx
mov word [eax + ecx*2], dx
or eax, 0xffffffff
mov edx, dword [ebp - 0x16c]
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x101869c9
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
cmp dword [esi + 0x10], 0
jbe 0x10186a1b
mov edx, dword [esi + 0x14]
mov eax, esi
cmp edx, 8
jb 0x101869db
mov eax, dword [esi]
cmp word [eax], 0x7b
jne 0x10186a1b
mov ecx, esi
cmp edx, 8
jb 0x101869ea
mov ecx, dword [esi]
mov ebx, dword [ebp - 0x154]
lea edx, [ebp - 0x138]
push 1
push 1
push 2
push dword [ebp - 0x15c]
mov eax, dword [ebx]
push 3
push dword [ebx + 0xe0]
push edx
push ecx
mov ecx, ebx
call dword [eax + 0x90]
jmp 0x10186cf2
call fcn.10003180
mov eax, dword [eax + 0x154]
mov dword [ebp - 0x15c], eax
test eax, eax
je 0x10186a37
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0x1d
call fcn.10003680
add esp, 4
push edi
test eax, eax
je 0x10186a4a
call eax
jmp 0x10186a50
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
mov ebx, eax
mov eax, dword [ebp - 0x15c]
test eax, eax
je 0x10186a63
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov ecx, dword [esi + 0x14]
test ebx, ebx
je 0x10186c81
mov edx, esi
cmp ecx, 8
jb 0x10186a77
mov edx, dword [esi]
mov ebx, dword [ebp - 0x154]
lea ecx, [ebp - 0x138]
push dword [ebx + 0x224]
mov eax, dword [ebx]
push 0
push 3
push dword [ebx + 0xe0]
push ecx
push edx
mov ecx, ebx
call dword [eax + 0x94]
cmp dword [esi + 0x14], 8
mov dword [ebp - 0x13c], esi
jb 0x10186ab3
mov eax, dword [esi]
mov dword [ebp - 0x13c], eax
call fcn.10003180
mov edi, dword [eax + 0x154]
test edi, edi
je 0x10186ac9
push edi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0xe
call fcn.10003680
add esp, 4
push dword [ebp - 0x13c]
test eax, eax
je 0x10186ae1
call eax
jmp 0x10186ae7
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
mov dword [ebp - 0x150], eax
test edi, edi
je 0x10186af8
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
cmp dword [esi + 0x14], 8
mov edx, esi
jb 0x10186b02
mov edx, dword [esi]
test edx, edx
jne 0x10186b0a
xor ecx, ecx
jmp 0x10186b1f
mov ecx, edx
lea edi, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x10186b10
sub ecx, edi
sar ecx, 1
push ecx
push edx
lea ecx, [ebp - 0x148]
call fcn.10003740
push 1
lea eax, [ebp - 0x170]
push eax
lea ecx, [ebp - 0x148]
call fcn.1000a000
mov ecx, 0x10202944
mov eax, dword [eax]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x10186b6d
test dx, dx
je 0x10186b69
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x10186b6d
add eax, 4
add ecx, 4
test dx, dx
jne 0x10186b47
xor edi, edi
jmp 0x10186b72
sbb edi, edi
or edi, 1
mov edx, dword [ebp - 0x170]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186b90
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test edi, edi
mov edi, dword [ebp - 0x148]
je 0x10186c4a
mov eax, 0x10202944
mov dword [ebp - 0x14c], 0x10202944
sub eax, edi
sar eax, 1
mov dword [ebp - 0x15c], eax
mov eax, dword [edi - 0xc]
push 1
push 0x10202944
mov dword [ebp - 0x13c], eax
call fcn.101e6fd0
mov edx, dword [ebp - 0x13c]
mov ecx, 1
sub ecx, dword [edi - 4]
add edx, eax
mov dword [ebp - 0x158], eax
add esp, 8
mov eax, dword [edi - 8]
sub eax, edx
or ecx, eax
jge 0x10186c00
push edx
lea ecx, [ebp - 0x148]
call fcn.10003310
mov edi, dword [ebp - 0x148]
mov eax, dword [ebp - 0x15c]
mov ecx, dword [ebp - 0x13c]
cmp eax, ecx
ja 0x10186c19
lea eax, [edi + eax*2]
mov dword [ebp - 0x14c], eax
mov eax, dword [ebp - 0x158]
add eax, eax
push eax
push dword [ebp - 0x14c]
push eax
lea eax, [edi + ecx*2]
push eax
call fcn.10004510
mov eax, dword [ebp - 0x158]
add esp, 0x10
add eax, dword [ebp - 0x13c]
xor ecx, ecx
mov dword [edi - 0xc], eax
mov word [edi + eax*2], cx
mov eax, dword [ebx + 0x224]
test eax, eax
je 0x10186cf2
mov ecx, dword [ebp - 0x150]
cmp ecx, 0xffffffff
je 0x10186cf2
test ecx, 0x400
jne 0x10186cf2
mov edx, dword [ebx]
dec eax
push 1
push eax
push edi
mov ecx, ebx
call dword [edx + 0x54]
jmp 0x10186cf2
mov eax, esi
cmp ecx, 8
jb 0x10186c8a
mov eax, dword [esi]
push eax
call fcn.1000aa00
add esp, 4
test eax, eax
je 0x10186cc7
cmp dword [esi + 0x14], 8
mov ecx, esi
jb 0x10186ca1
mov ecx, dword [esi]
mov ebx, dword [ebp - 0x154]
lea edx, [ebp - 0x138]
push 0
push 0
push 3
push dword [ebx + 0xe0]
mov eax, dword [ebx]
push edx
push ecx
mov ecx, ebx
call dword [eax + 0x84]
jmp 0x10186cf2
mov eax, dword [ebp - 0x140]
push eax
call fcn.1000aa00
add esp, 4
test eax, eax
jne 0x10186c97
push dword [ebp - 0x140]
call fcn.1000aa00
add esp, 4
test eax, eax
jne 0x10186c97
mov ebx, dword [ebp - 0x154]
mov edx, dword [ebp - 0x140]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186d10
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add edi, 0xfffffff0
or eax, 0xffffffff
lock xadd dword [edi + 0xc], eax
dec eax
test eax, eax
jg 0x10186d28
mov ecx, dword [edi]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 8]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186d43
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x14]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186d5e
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x18]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186d79
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x1c]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186d94
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x20]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186daf
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x24]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186dca
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
lea ecx, [ebp - 0x120]
call fcn.10122860
mov edx, dword [ebp - 0x124]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186df3
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x128]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186e11
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x12c]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186e2f
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x130]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186e4d
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x134]
or eax, 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x10186e6b
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
add esi, 0x18
lea edi, [ebx + 0xf8]
cmp esi, dword [ebx + 0x21c]
jne 0x10186451
mov edi, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x7c]
mov eax, dword [ebx]
mov ecx, ebx
call dword [eax + 0x98]
mov eax, dword [0x1025b450]
cmp eax, 0xffffffff
je 0x10186edb
cmp dword [0x1025b454], 0xffffffff
je 0x10186edb
push eax
call edi
test eax, eax
je 0x10186edb
cmp dword [0x1025b45c], 0
je 0x10186edb
push dword [0x1025b454]
call edi
push eax
call dword [0x1025b45c]
neg eax
sbb eax, eax
inc eax
push eax
push dword [0x1025b450]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.101f99c6
mov esp, ebp
pop ebp
ret