Function at 0x64a81140
Capabilities:
Get system information on windows
Get thread local storage value
Print debug messages
Terminate process

Disassembly:
sub esp, 0x24c
mov eax, dword [0x64a8b018]
xor eax, esp
mov dword [esp + 0x248], eax
mov ecx, dword [esp + 0x254]
push ebx
mov ebx, dword [esp + 0x254]
push ebp
mov eax, ecx
xor ebp, ebp
sub eax, ebp
push esi
push edi
mov dword [esp + 0x10], ebx
je 0x64a813b1
sub eax, 1
jne 0x64a81407
push 4
lea eax, [esp + 0x18]
push eax
push ebp
mov dword [esp + 0x20], 2
call dword [sym.imp.MSVCR80.dll__get_heap_handle]
push eax
call dword [sym.imp.KERNEL32.dll_HeapSetInformation]
call fcn.64a81470
push ebp
mov ebp, dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov byte [esp + 0x20], 1
call ebp
lea edx, [esp + 0x18]
mov dword [esp + 0x20], eax
call fcn.64a866d0
mov eax, str.thisProduct
mov esi, edx
call fcn.64a869e0
push 0
mov edi, eax
mov byte [esp + 0x20], 1
call ebp
lea edx, [esp + 0x18]
mov dword [esp + 0x20], eax
call fcn.64a866d0
mov eax, str.thisProgram
mov esi, edx
call fcn.64a869e0
test edi, edi
mov esi, eax
je 0x64a81209
test esi, esi
je 0x64a81209
call edi
mov dword [0x64a8caa4], eax
call esi
mov dword [0x64a8caa8], eax
jmp 0x64a812fa
push 0x104
lea ecx, [esp + 0x50]
push ecx
push 0
mov byte [0x64a8caa3], 1
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov ebx, dword [sym.imp.MSVCR80.dll_wcschr]
mov esi, eax
test esi, esi
je 0x64a8124e
lea edi, [esp + esi*2 + 0x4a]
movzx edx, word [edi]
push edx
push 0x64a882a0
call ebx
add esp, 8
test eax, eax
jne 0x64a8124e
sub esi, 1
sub edi, 2
test esi, esi
jne 0x64a81232
lea edi, [esp + esi*2 + 0x4c]
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x64a81257
sub eax, edx
sar eax, 1
lea esi, [eax + 1]
xor ecx, ecx
mov eax, esi
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.MSVCR80.dll_void____cdecl_operator_new___unsigned_int_
push edi
mov ebp, eax
push esi
push ebp
call dword [sym.imp.MSVCR80.dll_wcscpy_s]
xor esi, esi
add esp, 0x10
cmp word [edi], si
mov dword [0x64a8caa4], ebp
je 0x64a812bf
mov eax, edi
mov edi, edi
movzx eax, word [eax]
push eax
push 0x64a882a8
call ebx
add esp, 8
test eax, eax
jne 0x64a812bf
add esi, 1
cmp word [edi + esi*2], 0
lea eax, [edi + esi*2]
jne 0x64a812a0
xor ecx, ecx
lea ebx, [esi + 1]
mov eax, ebx
mov edx, 2
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call sub.MSVCR80.dll_void____cdecl_operator_new___unsigned_int_
push esi
push edi
mov ebp, eax
push ebx
push ebp
call dword [sym.imp.MSVCR80.dll_wcsncpy_s]
mov ebx, dword [esp + 0x24]
add esp, 0x14
mov word [ebp + esi*2], 0
mov dword [0x64a8caa8], ebp
mov dword [0x64a8b614], ebx
call fcn.64a814f0
test al, al
mov esi, dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov edi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
jne 0x64a8131c
push 0
call edi
push eax
call esi
call fcn.64a81700
test al, al
jne 0x64a8132c
push 0
call edi
push eax
call esi
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemInfo]
cmp word [esp + 0x18], 0
jne 0x64a81373
cmp dword [esp + 0x30], 0x182
jne 0x64a81373
call fcn.64a81650
test al, al
jne 0x64a8136c
mov ecx, dword [0x64a8caa4]
push ecx
push 0x15
push 0x11
push 0
mov ecx, 4
call fcn.64a81800
add esp, 0x10
push 0
call edi
push eax
call esi
cmp byte [0x64a8caa3], 0
jne 0x64a813a5
call fcn.64a81910
test al, al
jne 0x64a8138c
push 0
call edi
push eax
call esi
cmp byte [0x64a8caa3], 0
jne 0x64a813a5
call fcn.64a81a60
test al, al
jne 0x64a813a5
push 0
call edi
push eax
call esi
push ebx
call dword [sym.imp.KERNEL32.dll_DisableThreadLibraryCalls]
jmp 0x64a81444
push 0x64a882ac
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
call fcn.64a81c50
mov edx, dword [0x64a8b61c]
push edx
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 4
cmp byte [0x64a8caa3], 0
mov dword [0x64a8b61c], ebp
je 0x64a81410
mov eax, dword [0x64a8caa8]
push eax
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
mov ecx, dword [0x64a8caa4]
push ecx
mov dword [0x64a8caa8], ebp
call sub.MSVCR80.dll_void___cdecl_operator_delete___void__
add esp, 8
mov dword [0x64a8caa4], ebp
jmp 0x64a81410
cmp ecx, ebp
je 0x64a81410
cmp ecx, 3
jne 0x64a81444
mov ebx, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov esi, 0x64a8b628
jmp 0x64a81420
xor edx, edx
mov ecx, esi
xor eax, eax
lock cmpxchg dword [ecx], edx
mov edi, eax
test edi, edi
je 0x64a81436
push ebp
call ebx
push eax
call edi
add esi, 4
add ebp, 1
cmp esi, 0x64a8b828
jl 0x64a81420
mov ecx, dword [esp + 0x258]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
mov eax, 1
call fcn.64a8705a
add esp, 0x24c
ret 0xc