Function at 0x40611a
Capabilities:
Get thread local storage value
Print debug messages
Set thread local storage value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x415f48
push 0x4114a8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
push ecx
mov eax, 0x204c
call fcn.00411500
mov eax, dword [0x4211a4]
xor eax, ebp
mov dword [ebp - 0x1c], eax
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov esi, ecx
mov dword [ebp - 0x2038], esi
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x2030], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x203c], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x2050], eax
xor ebx, ebx
cmp dword [ebp + 0x18], ebx
je 0x40619f
push dword [0x42104c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, eax
mov ecx, esi
call fcn.00406041
push edi
push dword [0x42104c]
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
cmp dword [esi + 0x28], ebx
jne 0x4061ad
cmp dword [esi + 0x2c], ebx
je 0x4065f5
mov eax, dword [ebp + 8]
cmp eax, dword [esi + 0x30]
jl 0x4065f5
mov word [ebp - 0x201c], bx
mov ecx, 0x7ff
xor eax, eax
lea edi, [ebp - 0x201a]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov word [ebp - 0x204c], bx
xor eax, eax
lea edi, [ebp - 0x204a]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
cmp dword [0x421b58], ebx
jne 0x4061f8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov dword [0x421b58], eax
lea eax, [ebp - 0x204c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
lea eax, [esi + 0xf0]
mov ecx, dword [eax]
lea edx, [ecx + 1]
mov dword [eax], edx
push dword [0x421b58]
movzx eax, word [ebp - 0x203e]
push eax
movzx eax, word [ebp - 0x2040]
push eax
movzx eax, word [ebp - 0x2042]
push eax
movzx eax, word [ebp - 0x2044]
push eax
push ecx
push str._08d_t_02d:_02d:_02d._03d_t__d_
mov ebx, 0x100
push ebx
lea eax, [ebp - 0x201c]
push eax
mov esi, dword [sym.imp.MSVCR71.dll__snwprintf]
call esi
add esp, 0x24
lea edi, [ebp + eax*2 - 0x201c]
mov dword [ebp - 0x202c], edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push str.__d_
push ebx
push edi
call esi
add esp, 0x10
lea edi, [edi + eax*2]
mov eax, dword [ebp + 8]
sub eax, 0
je 0x4062e5
dec eax
je 0x4062d8
dec eax
je 0x4062cb
dec eax
je 0x4062be
dec eax
je 0x4062b1
dec eax
je 0x4062a4
dec eax
jne 0x4065f5
call fcn.00401a6a
push eax
push str.PROMPT___s_
jmp 0x4062f0
call fcn.00401a6a
push eax
push str.FATAL____s_
jmp 0x4062f0
call fcn.00401a6a
push eax
push str.ERROR____s_
jmp 0x4062f0
call fcn.00401a6a
push eax
push str.WARN_____s_
jmp 0x4062f0
call fcn.00401a6a
push eax
push str.INFO_____s_
jmp 0x4062f0
call fcn.00401a6a
push eax
push str.DEBUG____s_
jmp 0x4062f0
call fcn.00401a6a
push eax
push str.TRACE____s_
push ebx
push edi
call esi
add esp, 0x10
lea edi, [edi + eax*2]
mov dword [ebp - 0x2020], edi
xor eax, eax
mov dword [ebp - 0x2024], eax
mov word [edi], 0x5b
mov dword [ebp - 4], eax
cmp dword [ebp + 0x18], eax
je 0x406321
push dword [0x42104c]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x2034], eax
xor eax, eax
cmp dword [ebp + 0x18], eax
je 0x40633a
push dword [0x421048]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [ebp - 0x2024], eax
xor edi, edi
cmp dword [ebp - 0x2034], edi
jne 0x406352
mov dword [ebp - 0x2054], edi
jmp 0x406382
push dword [ebp - 0x2034]
call dword [sym.imp.MSVCR71.dll_wcslen]
mov edi, eax
mov dword [ebp - 0x2054], edi
lea eax, [edi + edi]
push eax
push dword [ebp - 0x2034]
mov eax, dword [ebp - 0x2020]
add eax, 2
push eax
call sub.MSVCR71.dll_memcpy
add esp, 0x10
or dword [ebp - 4], 0xffffffff
jmp 0x4063c3
mov eax, dword [ebp - 0x2020]
mov word [eax + edi*2 + 2], 0x5d
mov word [eax + edi*2 + 4], 0x20
lea edi, [eax + edi*2 + 6]
mov dword [ebp - 0x2020], edi
cmp dword [ebp - 0x2024], 0
je 0x406475
and dword [ebp - 0x2028], 0
mov dword [ebp - 4], 1
push 4
lea eax, [ebp - 0x2024]
push eax
lea eax, [ebp - 0x2028]
push eax
call sub.MSVCR71.dll_memcpy
add esp, 0xc
or dword [ebp - 4], 0xffffffff
jmp 0x40643d
mov word [edi], 0x5b
push dword [ebp - 0x2028]
push str.0x_08x
push ebx
lea eax, [edi + 2]
push eax
call esi
push edi
call dword [sym.imp.MSVCR71.dll_wcslen]
add esp, 0x14
mov word [edi + eax*2], 0x5d
mov word [edi + eax*2 + 2], 0x20
lea edi, [edi + eax*2 + 4]
mov dword [ebp - 0x2020], edi
mov dword [ebp - 4], 2
lea ecx, [ebp - 0x201c]
mov eax, edi
sub eax, ecx
mov ecx, 0xfbf
sar eax, 1
sub ecx, eax
cmp dword [ebp - 0x203c], 0
jne 0x4064a9
push dword [ebp - 0x2030]
push 0x415e14
push ecx
push edi
call esi
jmp 0x4064bd
push dword [ebp - 0x203c]
push dword [ebp - 0x2030]
push ecx
push edi
call dword [sym.imp.MSVCR71.dll__vsnwprintf]
add esp, 0x10
mov dword [ebp - 0x205c], eax
jmp 0x406513
or dword [ebp - 4], 0xffffffff
cmp eax, 0xffffffff
jne 0x406524
push edi
call dword [sym.imp.MSVCR71.dll_wcslen]
pop ecx
lea edi, [edi + eax*2 - 2]
mov ax, word [edi]
cmp ax, 9
je 0x40653d
cmp ax, 0xd
je 0x40653d
cmp ax, 0xa
jne 0x406545
and word [edi], 0
dec edi
dec edi
jmp 0x406528
rdtsc
mov dword [ebp - 0x2060], edx
inc edi
inc edi
push 0x415d74
movzx ecx, ax
push ecx
shr eax, 0x10
push eax
push str._t_hu__hu_s
push 0x20
push edi
call esi
add esp, 0x18
lea esi, [edi + eax*2]
mov edi, dword [ebp - 0x2038]
cmp dword [ebp + 8], 6
je 0x4065c1
lea ecx, [edi + 0x34]
mov ebx, 0x414940
push ebx
call fcn.0040263f
test eax, eax
jne 0x40659c
push dword [ebp - 0x202c]
lea ecx, [edi + 0x34]
call fcn.004026f1
test eax, eax
je 0x4065f5
lea ecx, [edi + 0x88]
push ebx
call fcn.0040263f
test eax, eax
jne 0x4065f5
push dword [ebp - 0x202c]
lea ecx, [edi + 0x88]
call fcn.004026f1
test eax, eax
jne 0x4065f5
cmp dword [edi + 0x28], 0
je 0x4065d3
push dword [ebp - 0x202c]
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
cmp dword [edi + 0x2c], 0
je 0x4065f5
push dword [ebp - 0x2050]
lea eax, [ebp - 0x201c]
sub esi, eax
sar esi, 1
push esi
push eax
push dword [ebp + 8]
mov ecx, edi
call fcn.00403e4f
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x1c]
xor ecx, ebp
call fcn.004113e5
leave
ret 0x14