Skip to content
This repository has been archived by the owner on Jan 22, 2021. It is now read-only.

Commit

Permalink
Fix bug case Startup crash.
Browse files Browse the repository at this point in the history
  • Loading branch information
CorrM committed Jun 10, 2019
1 parent d9f375f commit c7900a7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion UnrealFinderTool/ImControl.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ inline int process_id;
inline bool process_controller_toggles[] = { false };

inline std::string ue_version = "0.0.0";
inline std::string window_title = "NONE";
inline std::string window_title(27, '\0');

inline bool use_kernal_disabled = false;
inline bool use_kernal;
Expand Down
26 changes: 13 additions & 13 deletions UnrealFinderTool/UnrealFinderTool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@

#include <sstream>

static MemoryEditor mem_edit;

// => Address Viewer
PBYTE PCurrentAddressData = nullptr;
int BufSize = 0x200;
uintptr_t CurrentViewerAddress = uintptr_t(0x1000000000);
// => Address Viewer

MemoryEditor mem_edit;
bool memory_init = false;
float LeftWidth, RightWidth;

Expand Down Expand Up @@ -61,6 +54,10 @@ bool IsReadyToGo()
}

#pragma region Address Viewer
PBYTE PCurrentAddressData = nullptr;
int BufSize = 0x200;
uintptr_t CurrentViewerAddress = uintptr_t(0x1000000000);

MemoryEditor::u8 AddressViewerReadFn(const MemoryEditor::u8* data, const size_t off)
{
if (!PCurrentAddressData)
Expand Down Expand Up @@ -402,7 +399,10 @@ void InformationSection(UiWindow* thiz)
if (!window_title.empty())
{
HWND window = FindWindow(UNREAL_WINDOW_CLASS, nullptr);
GetWindowText(window, window_title.data(), 30);

if (window != INVALID_HANDLE_VALUE)
GetWindowText(window, window_title.data(), 27);

if (window_title.empty())
window_title = "NONE";
}
Expand Down Expand Up @@ -525,9 +525,9 @@ void Finder(UiWindow* thiz)

// Start Finder
ENABLE_DISABLE_WIDGET_IF(ui::Button("Find##GNames", { RightWidth / 5.4f, 0.0f }), g_names_find_disabled,
{
if (IsReadyToGo())
StartGNamesFinder();
{
if (IsReadyToGo())
StartGNamesFinder();
else
popup_not_valid_process = true;
});
Expand Down Expand Up @@ -844,7 +844,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
Sleep(1);

// Cleanup
if (Utils::MemoryObj != nullptr)
if (Utils::MemoryObj)
{
Utils::MemoryObj->ResumeProcess();
CloseHandle(Utils::MemoryObj->ProcessHandle);
Expand Down

1 comment on commit c7900a7

@CorrM
Copy link
Owner Author

@CorrM CorrM commented on c7900a7 Jun 10, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this issues #26

Please sign in to comment.