Function at 0x402aa0
Capabilities:
Create thread
Terminate thread

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
push 0xffffffffffffffff
push 0x406a78
mov eax, dword fs:[0]
push eax
sub esp, 0x68
mov eax, dword [0x40d018]
xor eax, esp
mov dword [esp + 0x30], eax
push ebx
push esi
push edi
mov eax, dword [0x40d018]
xor eax, esp
push eax
lea eax, [esp + 0x78]
mov dword fs:[0], eax
mov eax, dword [ebp + 0xc]
push 1
push 0x402a20
mov dword [esp + 0x28], eax
call dword [sym.imp.KERNEL32.dll_SetConsoleCtrlHandler]
call dword [sym.imp.lua51.dll_luaL_newstate]
mov esi, eax
push esi
call dword [sym.imp.lua51.dll_luaL_openlibs]
mov ebx, dword [sym.imp.lua51.dll_lua_getfield]
add esp, 4
push str.package
push 0xffffd8ee
push esi
mov dword [0x40dbac], esi
call ebx
add esp, 0xc
push str.preload
push 0xffffffffffffffff
push esi
call ebx
add esp, 0xc
push 0
push 0x403e50
push esi
call dword [sym.imp.lua51.dll_lua_pushcclosure]
mov edi, dword [sym.imp.lua51.dll_lua_setfield]
add esp, 0xc
push str.__ggehpserver__
push 0xfffffffffffffffe
push esi
call edi
add esp, 0xc
push 0xfffffffffffffffd
push esi
call dword [sym.imp.lua51.dll_lua_settop]
mov esi, dword [0x40dbac]
push str.package
push 0xffffd8ee
push esi
call ebx
add esp, 0x14
push str.preload
push 0xffffffffffffffff
push esi
call ebx
add esp, 0xc
push 0
push 0x4017f0
push esi
call dword [sym.imp.lua51.dll_lua_pushcclosure]
add esp, 0xc
push str.__ggehpclient__
push 0xfffffffffffffffe
push esi
call edi
add esp, 0xc
push 0xfffffffffffffffd
push esi
call dword [sym.imp.lua51.dll_lua_settop]
mov esi, dword [0x40dbac]
push str.package
push 0xffffd8ee
push esi
call ebx
add esp, 0x14
push str.preload
push 0xffffffffffffffff
push esi
call ebx
add esp, 0xc
push 0
push 0x405a60
push esi
call dword [sym.imp.lua51.dll_lua_pushcclosure]
add esp, 0xc
push str.__ggethread__
push 0xfffffffffffffffe
push esi
call edi
add esp, 0xc
push 0xfffffffffffffffd
push esi
call dword [sym.imp.lua51.dll_lua_settop]
add esp, 8
push 0x40db94
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
push 0x40db94
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ecx, dword [0x40dbac]
mov esi, dword [sym.imp.lua51.dll_lua_createtable]
push 0
push 0
push ecx
call esi
fld qword [0x40b198]
mov edx, dword [0x40dbac]
fstp qword [esp + 4]
add esp, 4
push edx
call dword [sym.imp.lua51.dll_lua_pushnumber]
mov eax, dword [0x40dbac]
add esp, 0xc
push str.version
push 0xfffffffffffffffe
push eax
call edi
mov eax, dword [0x40dbac]
mov ebx, dword [sym.imp.lua51.dll_lua_pushinteger]
add esp, 0xc
push eax
push eax
call ebx
mov ecx, dword [0x40dbac]
push str.state
push 0xfffffffffffffffe
push ecx
call edi
mov edx, dword [0x40dbac]
add esp, 0x14
push 0x40db94
push edx
call ebx
mov eax, dword [0x40dbac]
push 0x40ade4
push 0xfffffffffffffffe
push eax
call edi
mov ecx, dword [0x40dbac]
add esp, 0x14
push str.command
push ecx
call dword [sym.imp.lua51.dll_lua_pushstring]
mov edx, dword [0x40dbac]
push 0
push 0
push edx
call esi
mov esi, 1
add esp, 0x14
cmp dword [ebp + 8], esi
jle 0x402ce5
mov eax, dword [0x40dbac]
push esi
push eax
call ebx
mov ecx, dword [esp + 0x28]
mov edx, dword [ecx + esi*4]
mov eax, dword [0x40dbac]
push edx
push eax
call dword [sym.imp.lua51.dll_lua_pushstring]
mov ecx, dword [0x40dbac]
push 0xfffffffffffffffd
push ecx
call dword [sym.imp.lua51.dll_lua_settable]
inc esi
add esp, 0x18
cmp esi, dword [ebp + 8]
jl 0x402cb0
mov edx, dword [0x40dbac]
push 0xfffffffffffffffd
push edx
call dword [sym.imp.lua51.dll_lua_settable]
mov eax, dword [0x40dbac]
push 0x40adf0
push 0xffffd8ee
push eax
call edi
mov ecx, dword [0x40dbac]
add esp, 0x14
push 0x40adf0
push 0x1bf9
push 0x409190
push ecx
call dword [sym.imp.lua51.dll_luaL_loadbuffer]
mov edx, dword [0x40dbac]
mov edi, dword [sym.imp.lua51.dll_lua_call]
push 1
xor esi, esi
push esi
push edx
call edi
mov eax, dword [0x40dbac]
add esp, 0x1c
push 0xffffd8f0
push eax
call dword [sym.imp.lua51.dll_luaL_ref]
mov ebx, dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
add esp, 8
push 0x40db94
mov dword [0x40dbb0], eax
call ebx
push esi
push esi
push esi
push 0x4029c0
push esi
push esi
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esp + 0x20], eax
jmp 0x402d82
xor esi, esi
mov dword [esp + 0x38], 0xf
mov dword [esp + 0x34], esi
mov byte [esp + 0x24], 0
mov dword [esp + 0x80], esi
mov eax, dword [sym.imp.MSVCP100.dll_class_std::basic_istream_char__struct_std::char_traits_char___std::cin]
mov ecx, dword [eax]
mov ecx, dword [ecx + 4]
push 0xa
add ecx, eax
mov esi, eax
call dword [sym.imp.MSVCP100.dll_public:_char___thiscall_std::basic_ios_char__struct_std::char_traits_char__::widen_char_const]
movzx edx, al
push edx
push esi
lea ecx, [esp + 0x2c]
call fcn.00403200
add esp, 8
push 0x40db94
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov eax, dword [0x40dbb0]
mov ecx, dword [0x40dbac]
push eax
push 0xffffd8f0
push ecx
call dword [sym.imp.lua51.dll_lua_rawgeti]
mov eax, dword [esp + 0x30]
add esp, 0xc
cmp dword [esp + 0x38], 0x10
jae 0x402df6
lea eax, [esp + 0x24]
mov edx, dword [0x40dbac]
push eax
push edx
call dword [sym.imp.lua51.dll_lua_pushstring]
mov eax, dword [0x40dbac]
push 1
push 1
push eax
call edi
mov ecx, dword [0x40dbac]
add esp, 0x14
push 0xffffffffffffffff
push ecx
call dword [sym.imp.lua51.dll_lua_toboolean]
mov edx, dword [0x40dbac]
push 0xfffffffffffffffe
push edx
mov esi, eax
call dword [sym.imp.lua51.dll_lua_settop]
add esp, 0x10
push 0x40db94
call ebx
mov dword [esp + 0x80], 0xffffffff
cmp dword [esp + 0x38], 0x10
jb 0x402e5d
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.MSVCR100.dll_void___cdecl_operator_delete_void__]
add esp, 4
mov dword [esp + 0x38], 0xf
mov dword [esp + 0x34], 0
mov byte [esp + 0x24], 0
test esi, esi
je 0x402d80
mov esi, dword [esp + 0x20]
push 0
push esi
call dword [sym.imp.KERNEL32.dll_TerminateThread]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [0x40dbc4]
mov edi, dword [0x40dbac]
cmp esi, dword [0x40dbc8]
je 0x402ebb
mov ecx, dword [esi]
test ecx, ecx
je 0x402eb0
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
add esi, 4
cmp esi, dword [0x40dbc8]
jne 0x402ea2
mov esi, dword [0x40dbb4]
cmp esi, dword [0x40dbb8]
je 0x402ee9
lea esp, [esp]
mov ecx, dword [esi]
test ecx, ecx
je 0x402ede
mov edx, dword [ecx]
mov eax, dword [edx]
push 1
call eax
add esi, 4
cmp esi, dword [0x40dbb8]
jne 0x402ed0
push edi
call dword [sym.imp.lua51.dll_lua_close]
add esp, 4
xor eax, eax
mov ecx, dword [esp + 0x78]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00406014
mov esp, ebp
pop ebp
ret