Function at 0x404ebc
Capabilities:
Get thread local storage value
Terminate process

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x23c
mov eax, dword [0x40e004]
xor eax, esp
mov dword [esp + 0x238], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x18]
push ebx
mov dword [esp + 0x20], eax
xor ebx, ebx
mov eax, dword [ebp + 0x1c]
and dword [esp + 0x10], ebx
push esi
mov dword [esp + 0x20], eax
mov eax, dword [ebp + 0x24]
push edi
mov dword [esp + 0x2c], edx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x34], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
push 5
pop ecx
push 0x1f4
mov dword [esp + 0x34], eax
lea edi, [esp + 0x3c]
lea eax, [esp + 0x50]
mov esi, 0x4016c8
push ebx
rep movsd dword es:[edi], dword [esi]
push eax
call sub.msvcrt.dll_memset
xor ecx, ecx
add esp, 0xc
mov dword [esp + 0x14], ecx
mov dword [esp + 0x20], ecx
cmp dword [0x410ab4], ecx
je 0x405123
mov esi, dword [esp + 0x1c]
test esi, esi
je 0x405123
mov eax, dword [esp + 0x2c]
or dword [esi + 4], eax
mov edi, dword [esp + 0x10]
test edi, edi
je 0x404fb3
mov ecx, edi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x404f66
sub ecx, edx
lea eax, [ecx + 1]
mov dword [esp + 0x10], eax
add eax, eax
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
je 0x404fb7
push edi
mov edi, dword [esp + 0x14]
push 0x4013ac
push edi
push ebx
call fcn.00403c0c
add esp, 0x10
test eax, eax
jns 0x404fad
xor eax, eax
mov word [ebx + edi*2 - 2], ax
mov dword [esp + 0x18], ebx
jmp 0x404fb7
mov dword [esp + 0x18], ecx
mov eax, dword [esp + 0x24]
test eax, eax
je 0x405001
mov ecx, eax
call fcn.00403d9c
test eax, eax
je 0x404ff9
push 0x104
lea ecx, [esp + 0x3c]
push ecx
push eax
call dword [0x410ad0]
lea eax, [esp + 0x38]
push 0x5c
push eax
call dword [sym.imp.msvcrt.dll_wcsrchr]
mov edi, eax
pop ecx
pop ecx
test edi, edi
je 0x404ff9
add edi, 2
mov dword [esp + 0x14], edi
jmp 0x405001
lea eax, [esp + 0x38]
mov dword [esp + 0x14], eax
mov edx, 0x65000000
cmp dword [esi], edx
je 0x40500f
cmp dword [esi], 0
jne 0x405041
mov ecx, dword [0x410ab0]
test ecx, 0x80000
je 0x405031
xor eax, eax
cmp dword [esi], edx
setne al
dec eax
and eax, 0x69000000
add eax, 0x2000000
mov dword [esi], eax
test ecx, 0x40000
je 0x405041
mov dword [esp + 0x20], 1
push dword [0x40e034]
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
test eax, eax
je 0x405068
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x405068
mov eax, dword [eax]
mov edi, dword [eax + ecx*4 - 4]
test edi, edi
je 0x405068
mov edi, dword [edi]
test edi, edi
jne 0x40506d
mov edi, 0x4013b4
mov eax, dword [0x410ab4]
mov esi, dword [eax]
call fcn.00404e5f
push ecx
push ecx
fstp qword [esp]
push dword [ebp + 0x28]
push dword [esp + 0x40]
push dword [ebp + 0x20]
push dword [esp + 0x28]
push str._unknown_
push dword [esp + 0x34]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
push dword [0x410a98]
mov eax, dword [esp + 0x44]
push dword [eax + 8]
push dword [eax + 4]
push dword [esp + 0x58]
push 0
push dword [ebp + 0x10]
call fcn.004053e2
mov ecx, dword [esp + 0x58]
push eax
push edi
push dword [ecx]
push 0x4010f0
push 0x11
push dword [0x410ab4]
call dword [esi + 0x14]
add esp, 0x54
mov esi, eax
test ebx, ebx
je 0x4050eb
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp esi, 4
jne 0x4050fd
call fcn.00404ddd
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
cmp dword [esp + 0x20], 0
je 0x405115
push 0
push 0
push 1
push 0xc0000025
call dword [sym.imp.KERNEL32.dll_RaiseException]
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, esi
jmp 0x405125
xor eax, eax
mov ecx, dword [esp + 0x244]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040bf76
mov esp, ebp
pop ebp
ret 0x24