From c80385298d40ab1fccab118aba7cfc60efce2b4b Mon Sep 17 00:00:00 2001 From: F1ssi0N Date: Sun, 7 Oct 2018 10:40:01 +0100 Subject: [PATCH] Cleanup bad code by yours truly --- make.bat | 2 +- make_release.bat | 2 +- src/doghook.cc | 59 ++++++++++++++++++----------------------- src/hooks/createmove.cc | 7 +---- src/modules/aimbot.cc | 55 ++++++++++++++++++-------------------- src/modules/backtra.cc | 32 +++++++++------------- src/modules/misc.cc | 16 +++++------ src/sdk/class_id.hh | 6 +++++ src/sdk/convar.cc | 2 +- src/sdk/convar.hh | 2 ++ src/sdk/gamesystem.hh | 2 +- src/sdk/hooks.hh | 4 +-- src/sdk/inputcodes.hh | 2 +- src/sdk/netvar.cc | 13 ++++----- src/sdk/netvar.hh | 1 - src/sdk/sdk.hh | 19 +++++++++++++ src/sdk/trace.cc | 8 +++--- 17 files changed, 119 insertions(+), 113 deletions(-) diff --git a/make.bat b/make.bat index 524a86b..e6a72a0 100644 --- a/make.bat +++ b/make.bat @@ -10,7 +10,7 @@ for /F "tokens=*" %%a in ('find_my_visual_studio.exe msbuild_exe') do set msbuil echo msbuild is located at %msbuild_folder% -"%msbuild_folder%\\msbuild" /property:GenerateFullPaths=true /t:build premake\workspace.sln /p:Configuration=Debug /verbosity:minimal +"%msbuild_folder%\\msbuild" /property:GenerateFullPaths=true /t:build premake\doghook.sln /p:Configuration=Debug /verbosity:minimal echo done. diff --git a/make_release.bat b/make_release.bat index cd1de8b..0a991b6 100644 --- a/make_release.bat +++ b/make_release.bat @@ -7,7 +7,7 @@ call create_projects for /F "tokens=*" %%a in ('find_my_visual_studio.exe msbuild_exe') do set msbuild_folder=%%a echo msbuild is located at %msbuild_folder% -"%msbuild_folder%\\msbuild" /property:GenerateFullPaths=true /t:build premake\workspace.sln /p:Configuration=Release /verbosity:minimal +"%msbuild_folder%\\msbuild" /property:GenerateFullPaths=true /t:build premake\doghook.sln /p:Configuration=Release /verbosity:minimal echo done. diff --git a/src/doghook.cc b/src/doghook.cc index abc4248..ec40ad3 100644 --- a/src/doghook.cc +++ b/src/doghook.cc @@ -81,21 +81,33 @@ public: IFace::set_from_interface("client", "VClient"); IFace::set_from_interface("engine", "VEngineClient"); IFace::set_from_interface("client", "VClientEntityList"); + IFace::set_from_interface("vstdlib", "VEngineCvar"); + IFace::set_from_interface("engine", "VModelInfoClient"); + IFace::set_from_interface("engine", "EngineTraceClient"); + IFace::set_from_interface("engine", "VDebugOverlay"); + IFace::set_from_interface("client", "GameMovement"); + IFace::set_from_interface("client", "VClientPrediction"); + IFace::set_from_interface("inputsystem", "InputSystemVersion"); - if constexpr (doghook_platform::windows()) + if constexpr (doghook_platform::windows()) { IFace::set_from_pointer(**reinterpret_cast( vfunc::get_func(sdk::iface::client, 15, 0) + 0x2)); - else if constexpr (doghook_platform::linux()) - IFace::set_from_pointer(**reinterpret_cast( - vfunc::get_func(sdk::iface::client, 15, 0) + 0x1)); - IFace::set_from_interface("vstdlib", "VEngineCvar"); - - if constexpr (doghook_platform::windows()) IFace::set_from_pointer( *signature::find_pattern( "client", "B9 ? ? ? ? A3 ? ? ? ? E8 ? ? ? ? 68 ? ? ? ? E8 ? ? ? ? 83 C4 04 C7 05", 1)); - else if constexpr (doghook_platform::linux()) { + + auto globals_real_address = (u32)*signature::find_pattern("engine", "A1 ? ? ? ? 8B 11 68", 8); + IFace::set_from_pointer((sdk::Globals *)globals_real_address); + + IFace::set_from_pointer( + *signature::find_pattern( + "client", "8B 0D ? ? ? ? 8B 01 FF 50 28 56", 2)); + + } else if constexpr (doghook_platform::linux()) { + IFace::set_from_pointer(**reinterpret_cast( + vfunc::get_func(sdk::iface::client, 15, 0) + 0x1)); + // ClientMode is a magic static. So getting a sig for it is difficult (conflicts with all other magic statics) // So we are going to do some multistage shit in order to retrieve it auto outer_function = signature::find_pattern("client", "55 89 E5 83 EC 18 E8 ? ? ? ? A3 ? ? ? ? E8", 6); @@ -106,11 +118,13 @@ public: IFace::set_from_pointer(*reinterpret_cast(inner_function + 10)); assert(sdk::iface::client_mode); - } - IFace::set_from_interface("engine", "VModelInfoClient"); - IFace::set_from_interface("engine", "EngineTraceClient"); - IFace::set_from_interface("engine", "VDebugOverlay"); + auto globals_real_address = (u32) * *signature::find_pattern("client", "8B 15 ? ? ? ? F3 0F 10 88 D0 08 00 00", 2); + + IFace::set_from_pointer((sdk::Globals *)globals_real_address); + + IFace::set_from_pointer(nullptr); + } #if 0 IFace::set_from_interface("server", "PlayerInfoManager"); @@ -118,27 +132,6 @@ public: auto globals_server_address = (u32)iface::sdk::Globals.get(); #endif - if constexpr (doghook_platform::windows()) { - auto globals_real_address = (u32)*signature::find_pattern("engine", "A1 ? ? ? ? 8B 11 68", 8); - IFace::set_from_pointer((sdk::Globals *)globals_real_address); - } else if constexpr (doghook_platform::linux()) { - auto globals_real_address = (u32) * *signature::find_pattern("client", "8B 15 ? ? ? ? F3 0F 10 88 D0 08 00 00", 2); - - IFace::set_from_pointer((sdk::Globals *)globals_real_address); - } - - IFace::set_from_interface("client", "GameMovement"); - IFace::set_from_interface("client", "VClientPrediction"); - - if constexpr (doghook_platform::windows()) - IFace::set_from_pointer( - *signature::find_pattern( - "client", "8B 0D ? ? ? ? 8B 01 FF 50 28 56", 2)); - else if constexpr (doghook_platform::linux()) - IFace::set_from_pointer(nullptr); - - IFace::set_from_interface("inputsystem", "InputSystemVersion"); - inited = true; } diff --git a/src/hooks/createmove.cc b/src/hooks/createmove.cc index b8a636f..61bb976 100644 --- a/src/hooks/createmove.cc +++ b/src/hooks/createmove.cc @@ -64,10 +64,6 @@ static inline auto local_player_prediction(Player *local, UserCmd *cmd) { iface::globals->curtime = old_cur_time; iface::globals->frametime = old_frame_time; iface::globals->tickcount = old_tick_count; - - // TODO: if you do this then make sure to change the fov time calculation - // in aimbot::try_autoshoot!! - //local->tick_base() += 1; } std::unique_ptr> create_move_hook; @@ -85,8 +81,7 @@ bool hooked_create_move(void *instance, float sample_framerate, UserCmd *user_cm __asm mov ebp_address, ebp; send_packet_ptr = reinterpret_cast(***(uptr ***)ebp_address - 1); #else - // kotm's method - uintptr_t **fp; + uptr **fp; __asm__("mov %%ebp, %0" : "=r"(fp)); send_packet_ptr = reinterpret_cast(**fp - 8); diff --git a/src/modules/aimbot.cc b/src/modules/aimbot.cc index 7d507e6..f4d468d 100644 --- a/src/modules/aimbot.cc +++ b/src/modules/aimbot.cc @@ -145,24 +145,26 @@ static auto find_best_box() { } static Convar doghook_aimbot_enable_backtrack{"doghook_aimbot_enable_backtrack", true, nullptr}; -static Convar doghook_aimbot_reverse_backtrack_order{"doghook_aimbot_reverse_backtrack_order", true, nullptr}; +static Convar doghook_aimbot_reverse_backtrack_order{"doghook_aimbot_reverse_backtrack_order", false, nullptr}; auto visible_target_inner(Player *player, std::pair best_box, u32 tick, math::Vector &pos) { PlayerHitboxes hitboxes; u32 hitboxes_count; + auto [best_hitbox, only_use_best] = best_box; + hitboxes_count = backtrack::hitboxes_for_player(player, tick, hitboxes); // check best hitbox first - if (visible(player, hitboxes.centre[best_box.first], best_box.first)) { - pos = hitboxes.centre[best_box.first]; + if (visible(player, hitboxes.centre[best_hitbox], best_hitbox)) { + pos = hitboxes.centre[best_hitbox]; return true; - } else if (multipoint(player, best_box.first, hitboxes.centre[best_box.first], hitboxes.min[best_box.first], hitboxes.max[best_box.first], pos)) { + } else if (multipoint(player, best_hitbox, hitboxes.centre[best_hitbox], hitboxes.min[best_hitbox], hitboxes.max[best_hitbox], pos)) { return true; } // .second is whether we should only check the best box - if (!best_box.second) { + if (!only_use_best) { for (u32 i = 0; i < hitboxes_count; i++) { if (visible(player, hitboxes.centre[i], i)) { pos = hitboxes.centre[i]; @@ -171,7 +173,7 @@ auto visible_target_inner(Player *player, std::pair best_box, u32 tic } #if 0 - // Perform multiboxing after confirming that we do not have any other options + // TODO: Perform multiboxing after confirming that we do not have any other options for (u32 i = 0; i < hitboxes_count; i++) { if (multipoint(player, i, hitboxes.centre[i], hitboxes.min[i], hitboxes.max[i], pos)) { return true; @@ -204,9 +206,6 @@ auto valid_target(Entity *e) { } void finished_target(Target t) { - // iface::overlay->add_entity_text_overlay(t.e->index(), 1, 0, 255, 255, 255, 255, "finished"); - // iface::overlay->add_entity_text_overlay(t.e->index(), 2, 0, 255, 255, 255, 255, "%d", t.cmd_delta); - targets.push_back(t); } @@ -228,17 +227,17 @@ auto find_targets() { for (auto e : iface::ent_list->get_range()) { if (!e->is_valid()) continue; - if (valid_target(e)) { - auto pos = math::Vector::invalid(); + if (!valid_target(e)) continue; - if (auto p = e->to_player()) { - if (visible_player(p, best_box, tick, pos)) { - finished_target(Target{e, pos, delta}); + auto pos = math::Vector::invalid(); - // TODO: only do this when we want to do speedy targets! - //break; - } - } + if (auto p = e->to_player()) { + if (!visible_player(p, best_box, tick, pos)) continue; + + finished_target(Target{e, pos, delta}); + + // TODO: only do this when we want to do speedy targets! + //break; } } }; @@ -248,25 +247,23 @@ auto find_targets() { bool reverse_order = doghook_aimbot_reverse_backtrack_order; // Easy out - if (!reverse_order || !doghook_aimbot_enable_backtrack) { + if (!doghook_aimbot_enable_backtrack) { find_target_inner(current_tick, 0); - if (targets.size() > 0) { - sort_targets(); - return; - } + if (targets.size() > 0) sort_targets(); + + return; } - if (!doghook_aimbot_enable_backtrack) return; - + // Change const auto delta_delta = reverse_order ? -1 : 1; - auto delta = reverse_order ? backtrack::max_ticks : 1; - u32 new_tick; + // Starting position + auto delta = reverse_order ? backtrack::max_ticks : 1; backtrack::RewindState rewind; do { - new_tick = current_tick - delta; + u32 new_tick = current_tick - delta; if (backtrack::tick_valid(new_tick)) { rewind.to_tick(new_tick); @@ -349,7 +346,7 @@ static Convar doghook_aimbot_disallow_attack_if_no_target = Convar{" void create_move(sdk::UserCmd *cmd) { profiler_profile_function(); - if (local_weapon == nullptr || !can_find_targets) return; + if (!can_find_targets) return; find_targets(); diff --git a/src/modules/backtra.cc b/src/modules/backtra.cc index 9d195c8..2f4d971 100644 --- a/src/modules/backtra.cc +++ b/src/modules/backtra.cc @@ -141,8 +141,9 @@ Convar doghook_backtrack_latency{"doghook_backtrack_latency", 0, 0, 1, nu // Sequence record struct sequence { - u32 in_state; - u32 out_state; + u32 in_state; + u32 out_state; + u32 in_sequence; u32 out_sequence; float cur_time; @@ -274,16 +275,8 @@ static bool restore_player_to_record(sdk::Player *p, const Record &r) { // This offset already seems to account for the + 4 needed... static auto hitbox_bone_cache_handle_offset = *signature::find_pattern("client", "FF B6 ? ? ? ? E8 ? ? ? ? 8B F8 83 C4 04 85 FF 74 47", 2); - - auto hitbox_bone_cache_handle = p->get(hitbox_bone_cache_handle_offset); - if (hitbox_bone_cache_handle == 0) return true; - - static auto studio_get_bone_cache = signature::find_pattern("client", "55 8B EC 83 EC 20 56 6A 01 68 ? ? ? ? 68", 0); - BoneCache * bone_cache = studio_get_bone_cache(hitbox_bone_cache_handle); - - static auto bone_cache_update_bones = signature::find_pattern("client", "55 8B EC 83 EC 08 56 8B F1 33 D2", 0); - - if (bone_cache != nullptr) bone_cache_update_bones(bone_cache, r.hitboxes.bone_to_world, 128, iface::globals->curtime); + static auto studio_get_bone_cache = signature::find_pattern("client", "55 8B EC 83 EC 20 56 6A 01 68 ? ? ? ? 68", 0); + static auto bone_cache_update_bones = signature::find_pattern("client", "55 8B EC 83 EC 08 56 8B F1 33 D2", 0); #else // 8B 86 ? ? ? ? 89 04 24 E8 ? ? ? ? 85 C0 89 C3 74 48 -> hitbox_bone_cache_handle_offset @@ -291,18 +284,17 @@ static bool restore_player_to_record(sdk::Player *p, const Record &r) { // 55 89 E5 57 31 FF 56 53 83 EC 1C 8B 5D 08 0F B7 53 10 -> UpdateBoneCache static auto hitbox_bone_cache_handle_offset = *signature::find_pattern("client", "8B 86 ? ? ? ? 89 04 24 E8 ? ? ? ? 85 C0 89 C3 74 48", 2); + static auto studio_get_bone_cache = signature::find_pattern("client", "55 89 E5 56 53 BB ? ? ? ? 83 EC 50 C7 45 D8", 0); + static auto bone_cache_update_bones = signature::find_pattern("client", "55 89 E5 57 31 FF 56 53 83 EC 1C 8B 5D 08 0F B7 53 10", 0); +#endif auto hitbox_bone_cache_handle = p->get(hitbox_bone_cache_handle_offset); if (hitbox_bone_cache_handle == 0) return true; - static auto studio_get_bone_cache = signature::find_pattern("client", "55 89 E5 56 53 BB ? ? ? ? 83 EC 50 C7 45 D8", 0); - BoneCache * bone_cache = studio_get_bone_cache(hitbox_bone_cache_handle); + BoneCache *bone_cache = studio_get_bone_cache(hitbox_bone_cache_handle); - static auto bone_cache_update_bones = signature::find_pattern("client", "55 89 E5 57 31 FF 56 53 83 EC 1C 8B 5D 08 0F B7 53 10", 0); if (bone_cache != nullptr) bone_cache_update_bones(bone_cache, r.hitboxes.bone_to_world, 128, iface::globals->curtime); -#endif - return true; } @@ -460,7 +452,7 @@ void create_move(sdk::UserCmd *cmd) { iface::overlay->add_box_overlay(r.hitboxes.origin[0], {-2, -2, -2}, {2, 2, 2}, {0, 0, 0}, 0, 255, 0, 100, 0); -#if 0 +#if 0 && _DEBUG auto &hitboxes = r.hitboxes; for (u32 i = 0; i < r.max_hitboxes; i++) { @@ -469,7 +461,7 @@ void create_move(sdk::UserCmd *cmd) { auto g = (int)(255.0f * hullcolor[j].y); auto b = (int)(255.0f * hullcolor[j].z); - iface::DebugOverlay->add_box_overlay(hitboxes.origin[i], hitboxes.raw_min[i], hitboxes.raw_max[i], hitboxes.rotation[i], r, g, b, 100, 0); + iface::overlay->add_box_overlay(hitboxes.origin[i], hitboxes.raw_min[i], hitboxes.raw_max[i], hitboxes.rotation[i], r, g, b, 100, 0); //math::Vector origin; //math::Vector angles; @@ -479,7 +471,7 @@ void create_move(sdk::UserCmd *cmd) { //g = 255; //b = 0; - //iface::DebugOverlay->add_box_overlay(origin, hitboxes.raw_min[i], hitboxes.raw_max[i], angles, r, g, b, 100, 0); + //iface::overlay->add_box_overlay(origin, hitboxes.raw_min[i], hitboxes.raw_max[i], angles, r, g, b, 100, 0); } #endif } diff --git a/src/modules/misc.cc b/src/modules/misc.cc index 87caf59..37d4ce5 100644 --- a/src/modules/misc.cc +++ b/src/modules/misc.cc @@ -60,14 +60,14 @@ Netvar local_angles{"DT_BasePlayer", "pl", "deadflag"}; void init_all() { for (auto c : sdk::ConvarWrapper::get_range()) { auto flags = c.flags(); - flags &= ~FCVAR_CHEAT; - flags &= ~FCVAR_DEVELOPMENTONLY; - flags &= ~FCVAR_PROTECTED; - flags &= ~FCVAR_SPONLY; - flags &= ~FCVAR_CHEAT; - flags &= ~FCVAR_REPLICATED; - flags &= ~FCVAR_NOT_CONNECTED; - flags &= ~FCVAR_HIDDEN; + flags &= ~(FCVAR_CHEAT | + FCVAR_DEVELOPMENTONLY | + FCVAR_PROTECTED | + FCVAR_SPONLY | + FCVAR_CHEAT | + FCVAR_REPLICATED | + FCVAR_NOT_CONNECTED | + FCVAR_HIDDEN); c.set_flags(flags); } diff --git a/src/sdk/class_id.hh b/src/sdk/class_id.hh index b83b408..997f80b 100644 --- a/src/sdk/class_id.hh +++ b/src/sdk/class_id.hh @@ -26,6 +26,9 @@ public: // For debug builds we want to be able to check our classids are correct and issue warnings if they are not correct // So that we can update the value for next time. + +// This macro is required as inline variables have multiple constructors / destructors per compilation unit. +// Since this calss relies on consctruction and destruction we can only create the checkers in 1 compilation unit. #if defined(_DEBUG) && defined(PLACE_CHECKER) #define ID(name, value) \ enum { name = value }; \ @@ -40,6 +43,9 @@ public: #endif // Put ids here +ID(CFuncRespawnRoomVisualizer, 64); +ID(CTFMedigunShield, 230); +ID(CFuncAreaPortalWindow, 55); ID(CTFPlayer, 246); ID(CTFRevolver, 285); ID(CTFSniperRifle, 306); diff --git a/src/sdk/convar.cc b/src/sdk/convar.cc index 7c188ee..51cf82d 100644 --- a/src/sdk/convar.cc +++ b/src/sdk/convar.cc @@ -8,7 +8,7 @@ #include "log.hh" #include "sdk.hh" -// implementation of a source convar +// implementation of a source engine convar namespace sdk { // Helper to prevent crashes if Cvar isnt initied properly yet diff --git a/src/sdk/convar.hh b/src/sdk/convar.hh index 5a2c24e..da7f3dd 100644 --- a/src/sdk/convar.hh +++ b/src/sdk/convar.hh @@ -16,6 +16,8 @@ // Convar types into their own templated class so that you can static_cast // to it once you know what you are dealing with. +// TODO: there is no reason why there should be any virtual functions here! + namespace sdk { class ConCommandBase; class IConVar; diff --git a/src/sdk/gamesystem.hh b/src/sdk/gamesystem.hh index 3fdcb05..7fffa43 100644 --- a/src/sdk/gamesystem.hh +++ b/src/sdk/gamesystem.hh @@ -121,7 +121,7 @@ public: virtual void post_render() override {} }; -// TODO: GameSystem could be in a namespace... +// TODO: GameSystem could be in a namespace (not directly required for the rtti hack)... class GameSystem : public CBaseGameSystemPerFrame { GameSystem *next; diff --git a/src/sdk/hooks.hh b/src/sdk/hooks.hh index ea9bd00..16f4ee3 100644 --- a/src/sdk/hooks.hh +++ b/src/sdk/hooks.hh @@ -178,8 +178,8 @@ public: } // Call the original function - // Only pass the return value as a template param as the args - // will be automatically infered from what you pass to the function + // Only pass the return value as a template param. + // as the arg will be automatically infered from what you pass to the function template auto call_original(Args... args) { #if doghook_platform_linux() diff --git a/src/sdk/inputcodes.hh b/src/sdk/inputcodes.hh index 0463677..ba7a13f 100644 --- a/src/sdk/inputcodes.hh +++ b/src/sdk/inputcodes.hh @@ -160,5 +160,5 @@ enum player_controls { }; // TODO: mb add enumerated key array -// ToDo: make seperate convar type for keys +// TODO: make seperate convar type for keys } // namespace sdk diff --git a/src/sdk/netvar.cc b/src/sdk/netvar.cc index 7c173f7..3579abe 100644 --- a/src/sdk/netvar.cc +++ b/src/sdk/netvar.cc @@ -43,24 +43,25 @@ uptr Netvar::Tree::find_offset(std::vector t) { auto nodes = &prop_tree; for (auto &name : t) { - auto old_nodes = nodes; auto end = nodes->end(); for (auto it = nodes->begin(); it != end; ++it) { auto p = *it; - if (strcmp(name, p.first) == 0) { - nodes = &p.second->children; - if (p.second->p != nullptr) - total += p.second->p->offset; + auto [node_name, child_node] = p; + + if (strcmp(name, node_name) == 0) { + nodes = &child_node->children; + if (child_node->p != nullptr) + total += child_node->p->offset; break; } } if (nodes == old_nodes) { // TODO: - //logging::msg("[Netvar] Unable to find '%s'", name); + // logging::msg("[Netvar] Unable to find '%s'", name); } } diff --git a/src/sdk/netvar.hh b/src/sdk/netvar.hh index 29c91ce..91c424e 100644 --- a/src/sdk/netvar.hh +++ b/src/sdk/netvar.hh @@ -9,7 +9,6 @@ namespace sdk { class Netvar { class Tree { - struct Node; using TreeNode = std::vector>>; diff --git a/src/sdk/sdk.hh b/src/sdk/sdk.hh index 81c86fd..15169c8 100644 --- a/src/sdk/sdk.hh +++ b/src/sdk/sdk.hh @@ -515,6 +515,7 @@ public: } }; +// Wrappers around the IFace system: iface:: namespace iface { extern IFace client; extern IFace client_mode; @@ -532,6 +533,24 @@ extern IFace move_helper; extern IFace game_movement; extern IFace engine_vgui; extern IFace input_system; + +// TODO: update to use type aliases instead of extern vars +// using client = IFace; +// using client_mode = IFace; +// using cvar = IFace; +// using engine = IFace; +// using engine_vgui = IFace; +// using ent_list = IFace; +// using game_movement = IFace; +// using globals = IFace; +// using info_manager = IFace; +// using input = IFace; +// using input_system = IFace; +// using model_info = IFace; +// using move_helper = IFace; +// using overlay = IFace; +// using prediction = IFace; +// using trace = IFace; } // namespace iface } // namespace sdk diff --git a/src/sdk/trace.cc b/src/sdk/trace.cc index 97f20b4..3e224c3 100644 --- a/src/sdk/trace.cc +++ b/src/sdk/trace.cc @@ -4,6 +4,8 @@ #include "sdk.hh" +#include "class_id.hh" + bool trace::Filter::should_hit_entity(sdk::Entity *handle_entity, int contents_mask) { auto handle = handle_entity->to_handle(); auto real_entity = sdk::iface::ent_list->from_handle(handle); @@ -14,9 +16,9 @@ bool trace::Filter::should_hit_entity(sdk::Entity *handle_entity, int contents_m // ignore "bad" entities switch (client_class->class_id) { - case 64: // CFuncRespawnRoomVisualizer - case 230: // CTFMedigunShield - case 55: // CFuncAreaPortalWindow + case sdk::class_id::CFuncRespawnRoomVisualizer: + case sdk::class_id::CTFMedigunShield: + case sdk::class_id::CFuncAreaPortalWindow: return false; }