Function at 0x439940
Capabilities:
Allocate thread local storage
Get thread local storage value
Resolve function by parsing pe exports
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x914
push ebx
push esi
mov esi, ecx
xor ebx, ebx
mov dword [esp + 0x14], ebx
push edi
mov dword [esp + 0x10], esi
mov dword [esi], 0x41685c
cmp byte [esi + 0x24], bl
je 0x43996d
xor cl, cl
call fcn.004355f0
xor edi, edi
mov dword [esp + 0x14], edi
mov ecx, esi
call fcn.0043af40
cmp dword [esi + 0x1c], 0
jne 0x439a32
mov eax, dword [esi + 0xcc]
lea edi, [esi + 0xc]
mov dword [esp + 0xc], eax
test bl, 8
je 0x4399a9
lea ecx, [esp + 0xe0]
and ebx, 0xfffffff7
call fcn.0041b6f0
mov eax, dword [esp + 0xc]
lea esi, [eax + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [esp + 0xc]
cmp dword [eax + 0x34], 0
jne 0x4399c3
mov byte [eax + 0x40], 0
jmp 0x439a16
lea edx, [eax + 0x24]
cmp edx, edi
je 0x439a16
mov eax, dword [edi]
mov ecx, dword [edx]
mov dword [edx], eax
mov dword [edi], ecx
mov eax, dword [edx]
test eax, eax
je 0x4399da
mov dword [eax], edx
mov eax, dword [edi]
test eax, eax
je 0x4399e2
mov dword [eax], edi
mov ecx, dword [edx + 4]
mov eax, dword [edi + 4]
mov dword [edx + 4], eax
mov dword [edi + 4], ecx
mov ecx, dword [edx + 8]
mov eax, dword [edi + 8]
mov dword [edx + 8], eax
mov dword [edi + 8], ecx
mov ecx, dword [edx + 0xc]
mov eax, dword [edi + 0xc]
mov dword [edx + 0xc], eax
mov dword [edi + 0xc], ecx
mov eax, dword [edi + 0x10]
mov ecx, dword [edx + 0x10]
mov dword [edx + 0x10], eax
mov eax, dword [esp + 0xc]
mov dword [edi + 0x10], ecx
mov edi, dword [eax + 8]
push esi
mov dword [eax + 8], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [esp + 0x10]
add dword [esi + 0x20], edi
mov edi, dword [esp + 0x14]
mov ecx, esi
call fcn.0043af40
test al, al
je 0x439a4b
inc edi
mov dword [esp + 0x14], edi
cmp edi, 0x64
jl 0x439973
test bl, 4
je 0x439a5f
lea ecx, [esp + 0x190]
and ebx, 0xfffffffb
call fcn.0041b6f0
mov eax, dword [esi + 0x5c]
sub eax, dword [esi + 0x58]
test eax, 0xfffffffc
je 0x439cbd
lea eax, [esi + 0x54]
push eax
lea ecx, [esp + 0x20]
call fcn.0043c2b0
mov esi, dword [esp + 0x24]
mov edi, dword [esp + 0x1c]
test edi, edi
je 0x439cb9
test bl, 0x10
je 0x439aa1
lea ecx, [esp + 0x240]
and ebx, 0xffffffef
call fcn.0041b6f0
cmp byte [edi + 5], 0
je 0x439b16
cmp dword [esp + 0x20], 0
je 0x439b16
test bl, 0x20
je 0x439ac2
lea ecx, [esp + 0x2f0]
and ebx, 0xffffffdf
call fcn.0041b6f0
test bl, bl
jns 0x439ad8
lea ecx, [esp + 0x3a0]
and ebx, 0xffffff7f
call fcn.0041b6f0
mov ecx, dword [esp + 0x28]
xor eax, eax
cmp byte [edi + 5], al
cmovne eax, dword [esp + 0x20]
mov edx, dword [eax + 4]
mov eax, dword [eax + 8]
sub eax, edx
sar eax, 2
cmp eax, ecx
mov dword [esp + 0x2c], eax
cmovb ecx, eax
cmp esi, ecx
jae 0x439b16
lea eax, [edx + esi*4]
cmp dword [eax], 0
jne 0x439bf0
inc esi
add eax, 4
mov dword [esp + 0x24], esi
cmp esi, ecx
jb 0x439b01
test edi, edi
je 0x439cb9
test ebx, 0x100
je 0x439b38
lea ecx, [esp + 0x450]
and ebx, 0xfffffeff
call fcn.0041b6f0
cmp byte [edi + 5], 0
je 0x439c9b
mov esi, dword [esp + 0x20]
test esi, esi
je 0x439c9b
test ebx, 0x200
je 0x439b68
lea ecx, [esp + 0x500]
and ebx, 0xfffffdff
call fcn.0041b6f0
test ebx, 0x800
je 0x439b82
lea ecx, [esp + 0x5b0]
and ebx, 0xfffff7ff
call fcn.0041b6f0
xor eax, eax
cmp byte [edi + 5], al
cmovne eax, esi
add dword [eax + 0x10], 0xffffffff
jne 0x439c9b
test ebx, 0x1000
je 0x439bae
lea ecx, [esp + 0x660]
and ebx, 0xffffefff
call fcn.0041b6f0
test ebx, 0x4000
je 0x439bc8
lea ecx, [esp + 0x710]
and ebx, 0xffffbfff
call fcn.0041b6f0
xor ecx, ecx
cmp byte [edi + 5], cl
cmovne ecx, esi
mov dword [esp + 0x14], ecx
mov eax, dword [ecx + 8]
mov esi, dword [ecx + 4]
mov dword [esp + 0x18], eax
cmp esi, eax
je 0x439c5e
cmp dword [esi], 0
je 0x439c21
add esi, 4
cmp esi, eax
jne 0x439be2
jmp 0x439c5e
cmp esi, ecx
jae 0x439b16
mov ecx, dword [edx + esi*4]
inc esi
mov dword [esp + 0x24], esi
test ecx, ecx
je 0x439b16
mov edx, dword [ecx]
mov eax, dword [edx]
cmp eax, 0x44a040
jne 0x43a16d
push 1
call dword [edx + 4]
jmp 0x439a85
cmp esi, eax
je 0x439c5e
lea ecx, [esi + 4]
mov edi, eax
sub edi, ecx
xor edx, edx
add edi, 3
shr edi, 2
cmp ecx, eax
cmova edi, edx
mov dword [esp + 0xc], edi
test edi, edi
je 0x439c5a
mov eax, edi
mov edi, dword [ecx]
test edi, edi
je 0x439c4e
mov dword [esi], edi
add esi, 4
inc edx
add ecx, 4
cmp edx, eax
jne 0x439c43
mov eax, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
mov edx, dword [ecx + 4]
mov dword [esp + 0x18], esi
cmp esi, edx
jne 0x439c73
cmp eax, dword [ecx + 8]
jne 0x439c73
mov dword [ecx + 8], edx
jmp 0x439c9b
cmp esi, eax
je 0x439c9b
mov ecx, dword [ecx + 8]
sub ecx, eax
sar ecx, 2
lea edi, [ecx*4]
push edi
push eax
push esi
call fcn.004acca0
mov ecx, dword [esp + 0x20]
lea eax, [edi + esi]
add esp, 0xc
mov dword [ecx + 8], eax
mov ecx, dword [esp + 0x1c]
or eax, 0xffffffff
lock xadd dword [ecx], eax
sub eax, 1
setne al
test al, al
jne 0x439cb9
push ecx
call fcn.004aa12f
add esp, 4
mov esi, dword [esp + 0x10]
mov edi, dword [esi + 0xd8]
mov dword [esi + 0xd8], 0
test edi, edi
je 0x439ce1
mov ecx, edi
call fcn.0044e980
push edi
call fcn.004aa12f
add esp, 4
mov edi, dword [esi + 0xcc]
lea esi, [edi + 0xc]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push esi
mov dword [edi + 0x38], 0
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov edi, dword [esp + 0x10]
or esi, 0xffffffff
mov ecx, dword [edi + 0xcc]
mov dword [edi + 0xcc], 0
test ecx, ecx
je 0x439d3c
add ecx, 4
mov eax, esi
lock xadd dword [ecx], eax
sub eax, 1
setne al
test al, al
jne 0x439d3c
test ecx, ecx
je 0x439d3c
add ecx, 0xfffffffc
je 0x439d3c
mov eax, dword [ecx]
push 1
call dword [eax]
mov ecx, dword [edi + 0xd0]
mov dword [edi + 0xd0], 0
test ecx, ecx
je 0x439d83
add ecx, 4
mov eax, esi
lock xadd dword [ecx], eax
sub eax, 1
setne al
test al, al
jne 0x439d83
test ecx, ecx
je 0x439d6c
add ecx, 0xfffffffc
jmp 0x439d6e
xor ecx, ecx
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, 0x417184
jne 0x43a174
push 1
call dword [eax + 8]
mov ecx, dword [edi + 0xd4]
mov dword [edi + 0xd4], 0
test ecx, ecx
je 0x439dca
add ecx, 4
mov eax, esi
lock xadd dword [ecx], eax
sub eax, 1
setne al
test al, al
jne 0x439dca
test ecx, ecx
je 0x439db3
add ecx, 0xfffffffc
jmp 0x439db5
xor ecx, ecx
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, 0x417184
jne 0x43a17b
push 1
call dword [eax + 8]
mov eax, dword [0x4d8484]
mov edx, 0x4d8484
mov esi, dword [sym.imp.KERNEL32.dll_Sleep]
test eax, 0xfffffffe
jne 0x439e5c
mov ecx, 1
xor eax, eax
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x439e10
mov eax, dword [0x4d8484]
cmp eax, 1
jne 0x439e5c
nop word [eax + eax]
push 0
call esi
mov eax, dword [0x4d8484]
cmp eax, 1
je 0x439e00
jmp 0x439e5c
mov dword [0x4d8488], 0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4d8488], eax
cmp eax, 0xffffffff
jne 0x439e38
cmp byte [0x4d9358], 0
jne 0x43a182
int3
test ebx, 0x8000
je 0x439e52
lea ecx, [esp + 0x7c0]
and ebx, 0xffff7fff
call fcn.0041b6f0
mov dword [0x4d8484], 0x4d8488
mov eax, dword [0x4d8484]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
cmp eax, edi
jne 0x439f52
mov eax, dword [0x4d8484]
test eax, 0xfffffffe
jne 0x439efc
xor eax, eax
mov ecx, 1
mov edx, 0x4d8484
lock cmpxchg dword [edx], ecx
test eax, eax
je 0x439eb0
mov eax, dword [0x4d8484]
cmp eax, 1
jne 0x439efc
nop dword [eax + eax]
push 0
call esi
mov eax, dword [0x4d8484]
cmp eax, 1
je 0x439ea0
jmp 0x439efc
mov dword [0x4d8488], 0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x4d8488], eax
cmp eax, 0xffffffff
jne 0x439ed8
cmp byte [0x4d9358], 0
jne 0x43a189
int3
test ebx, 0x10000
je 0x439ef2
lea ecx, [esp + 0x870]
and ebx, 0xfffeffff
call fcn.0041b6f0
mov dword [0x4d8484], 0x4d8488
mov eax, dword [0x4d8484]
push 0
push dword [eax]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x439f52
cmp dword [0x4d8374], 3
jg 0x439f41
push 3
push 0x23
push 0x416758
lea ecx, [esp + 0x3c]
or ebx, 0x20000
call fcn.0041b540
add eax, 8
push 0x4167a4
push eax
call fcn.004200c0
add esp, 8
test ebx, 0x20000
je 0x439f52
lea ecx, [esp + 0x30]
call fcn.0041b6f0
mov esi, dword [edi + 0xd8]
mov dword [edi + 0xd8], 0
test esi, esi
je 0x439f76
mov ecx, esi
call fcn.0044e980
push esi
call fcn.004aa12f
add esp, 4
mov ecx, dword [edi + 0xd4]
or ebx, 0xffffffff
test ecx, ecx
je 0x439fb6
add ecx, 4
mov eax, ebx
lock xadd dword [ecx], eax
sub eax, 1
setne al
test al, al
jne 0x439fb6
test ecx, ecx
je 0x439f9f
add ecx, 0xfffffffc
jmp 0x439fa1
xor ecx, ecx
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, 0x417184
jne 0x43a190
push 1
call dword [eax + 8]
mov ecx, dword [edi + 0xd0]
test ecx, ecx
je 0x439ff3
add ecx, 4
mov eax, ebx
lock xadd dword [ecx], eax
sub eax, 1
setne al
test al, al
jne 0x439ff3
test ecx, ecx
je 0x439fdc
add ecx, 0xfffffffc
jmp 0x439fde
xor ecx, ecx
mov eax, dword [ecx]
mov edx, dword [eax + 0xc]
cmp eax, 0x417184
jne 0x43a197
push 1
call dword [eax + 8]
mov ecx, dword [edi + 0xcc]
test ecx, ecx
je 0x43a01f
add ecx, 4
mov eax, ebx
lock xadd dword [ecx], eax
sub eax, 1
setne al
test al, al
jne 0x43a01f
test ecx, ecx
je 0x43a01f
add ecx, 0xfffffffc
je 0x43a01f
mov eax, dword [ecx]
push 1
call dword [eax]
mov ecx, dword [edi + 0xb4]
lea esi, [edi + 0xb0]
test ecx, ecx
je 0x43a053
mov eax, dword [esi + 0xc]
sub eax, ecx
sar eax, 2
push eax
push ecx
call fcn.00428810
mov dword [esi + 4], 0
mov dword [esi + 8], 0
mov dword [esi + 0xc], 0
mov ecx, esi
call fcn.00435080
mov eax, dword [edi + 0xa4]
lea esi, [edi + 0x90]
cmp eax, 0x10
jb 0x43a076
inc eax
mov ecx, esi
push eax
push dword [esi]
call fcn.0041e500
mov dword [esi + 0x14], 0xf
mov dword [esi + 0x10], 0
mov byte [esi], 0
mov eax, dword [edi + 0x8c]
cmp eax, 0x10
jb 0x43a09f
inc eax
lea ecx, [edi + 0x78]
push eax
push dword [edi + 0x78]
call fcn.0041e500
mov dword [edi + 0x8c], 0xf
mov dword [edi + 0x88], 0
mov byte [edi + 0x78], 0
mov ecx, dword [edi + 0x70]
test ecx, ecx
je 0x43a0d5
lock xadd dword [ecx], ebx
sub ebx, 1
setne al
test al, al
jne 0x43a0d5
mov eax, dword [ecx + 4]
push ecx
call eax
add esp, 4
mov ecx, dword [edi + 0x58]
test ecx, ecx
je 0x43a100
mov eax, dword [edi + 0x60]
sub eax, ecx
sar eax, 2
push eax
push ecx
call fcn.00428810
mov dword [edi + 0x58], 0
mov dword [edi + 0x5c], 0
mov dword [edi + 0x60], 0
lea ecx, [edi + 0x54]
call fcn.00435080
lea ecx, [edi + 0x40]
call fcn.0043bc50
push 8
push 1
push dword [edi + 0x40]
call fcn.0041a690
add esp, 0xc
mov dword [edi + 0x40], 0
lea ecx, [edi + 0x28]
call fcn.0043a1d0
lea ecx, [edi + 0xc]
call fcn.0043bc50
push 8
push 1
push dword [edi + 0xc]
call fcn.0041a690
mov dword [edi + 0xc], 0
add esp, 0xc
mov ecx, dword [edi + 4]
mov dword [edi + 4], 0
test ecx, ecx
je 0x43a160
mov eax, dword [ecx]
push 1
call dword [eax]
mov dword [edi], 0x41684c
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
call eax
jmp 0x439a85
call edx
jmp 0x439d83
call edx
jmp 0x439dca
push 1
call fcn.004b94a2
push 1
call fcn.004b94a2
call edx
jmp 0x439fb6
call edx
jmp 0x439ff3