Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Aug 12, 2020
1 parent ba9cdf2 commit c41604f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ include $(DEVKITPRO)/libnx/switch_rules
#---------------------------------------------------------------------------------
VERSION_MAJOR := 3
VERSION_MINOR := 6
VERSION_MICRO := 4
VERSION_MICRO := 5
NIGHTLY :=

APP_TITLE := EdiZon SE
Expand Down
1 change: 1 addition & 0 deletions include/guis/gui_cheats.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ class GuiCheats : public Gui
u64 m_heapBaseAddr = 0x00;
u64 m_mainBaseAddr = 0x00;
u64 m_EditorBaseAddr = 0x00;
u64 m_BookmarkAddr = 0;
u8 m_addressmod = 0;
time_t m_Time1;
struct helperinfo_t
Expand Down
20 changes: 11 additions & 9 deletions source/guis/gui_cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1603,14 +1603,14 @@ void GuiCheats::onInput(u32 kdown)
bookmark.type = m_searchType;
Gui::requestKeyboardInput("Enter Label", "Enter Label to add to bookmark .", "", SwkbdType_QWERTY, bookmark.label, 18);

if (address >= m_memoryDump->getDumpInfo().heapBaseAddress && address < (m_memoryDump->getDumpInfo().heapBaseAddress + m_memoryDump->getDumpInfo().heapSize))
if (address >= m_heapBaseAddr && address < m_heapEnd)
{
bookmark.offset = address - m_memoryDump->getDumpInfo().heapBaseAddress;
bookmark.offset = address - m_heapBaseAddr;
bookmark.heap = true;
}
else if (address >= m_memoryDump->getDumpInfo().mainBaseAddress && address < (m_memoryDump->getDumpInfo().mainBaseAddress + m_memoryDump->getDumpInfo().mainSize))
else if (address >= m_mainBaseAddr && address < m_mainend)
{
bookmark.offset = address - m_memoryDump->getDumpInfo().mainBaseAddress;
bookmark.offset = address - m_mainBaseAddr;
bookmark.heap = false;
}

Expand All @@ -1630,6 +1630,7 @@ void GuiCheats::onInput(u32 kdown)
if (kdown & KEY_RSTICK && m_memoryDump->getDumpInfo().dumpType == DumpType::ADDR)
{
m_memoryDump->getData((m_selectedEntry + m_addresslist_offset) * sizeof(u64), &m_EditorBaseAddr, sizeof(u64));
m_BookmarkAddr = m_EditorBaseAddr;
m_AttributeDumpBookmark->getData((m_selectedEntry + m_addresslist_offset) * sizeof(bookmark_t), &m_bookmark, sizeof(bookmark_t));
m_searchMenuLocation = SEARCH_editRAM;
m_selectedEntry = (m_EditorBaseAddr % 16) / 4 + 11;
Expand Down Expand Up @@ -2162,14 +2163,14 @@ void GuiCheats::onInput(u32 kdown)
u64 address = m_EditorBaseAddr - (m_EditorBaseAddr % 16) - 0x20 + (m_selectedEntry - 1 - (m_selectedEntry / 5)) * 4 + m_addressmod;

bookmark_t bookmark;
if (address >= m_memoryDump->getDumpInfo().heapBaseAddress && address < (m_memoryDump->getDumpInfo().heapBaseAddress + m_memoryDump->getDumpInfo().heapSize))
if (address >= m_heapBaseAddr && address < m_heapEnd)
{
bookmark.offset = address - m_memoryDump->getDumpInfo().heapBaseAddress;
bookmark.offset = address - m_heapBaseAddr;
bookmark.heap = true;
}
else if (address >= m_memoryDump->getDumpInfo().mainBaseAddress && address < (m_memoryDump->getDumpInfo().mainBaseAddress + m_memoryDump->getDumpInfo().mainSize))
else if (address >= m_mainBaseAddr && address < m_mainend)
{
bookmark.offset = address - m_memoryDump->getDumpInfo().mainBaseAddress;
bookmark.offset = address - m_mainBaseAddr;
bookmark.heap = false;
}

Expand All @@ -2179,7 +2180,8 @@ void GuiCheats::onInput(u32 kdown)
m_memoryDumpBookmark->addData((u8 *)&address, sizeof(u64));
if (m_bookmark.pointer.depth > 0)
{
s64 offset = address - m_EditorBaseAddr + m_bookmark.pointer.offset[0];
s64 offset = address - m_BookmarkAddr + m_bookmark.pointer.offset[0];
// printf("address = %lx m_EditorBaseAddr = %lx m_bookmark.pointer.offset[0] = %lx m_addressmod = %lx\n", address, m_EditorBaseAddr, m_bookmark.pointer.offset[0],m_addressmod);
if (offset >= 0 && offset < (s64)m_max_range)
{
memcpy(&(bookmark.pointer), &(m_bookmark.pointer), (m_bookmark.pointer.depth + 2) * 8);
Expand Down

0 comments on commit c41604f

Please sign in to comment.