Skip to content

Commit

Permalink
147 32bit pointer dump
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvita committed Oct 4, 2020
1 parent 0850421 commit 2934fe0
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 4 deletions.
Binary file modified server/source/noexs/054e4f4558454000.zip
Binary file not shown.
Binary file modified server/source/noexs/054e4f4558454000/exefs.nsp
Binary file not shown.
Binary file modified server/source/noexs/exefs.nsp
Binary file not shown.
2 changes: 1 addition & 1 deletion server/source/noexs/include/gecko.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#define VER_MAJOR (1)
#define VER_MINOR (1)
#define VER_PATCH (146)
#define VER_PATCH (147)

#define GECKO_BUFFER_SIZE (2048 * 32)
#define GECKO_BUFFER_SIZE2 (2048 * 4)
Expand Down
Binary file modified server/source/noexs/noexs.nso
Binary file not shown.
Binary file modified server/source/noexs/noexs.nsp
Binary file not shown.
14 changes: 11 additions & 3 deletions server/source/noexs/source/commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ static Result _freeze_address(Gecko::Context& ctx){


static u64 m_heap_start, m_heap_end, m_main_start, m_main_end;
static bool m_32bitmode = false;
static u8 outbuffer[GECKO_BUFFER_SIZE * 9 / 8];
static FILE* g_memdumpFile = NULL;
// static FILE* g_bookmarkFile = NULL;
Expand Down Expand Up @@ -440,15 +441,17 @@ static Result getmeminfo(Gecko::Context& ctx) {
break;
}
addr += info.size;
}
};
if ((m_main_end | m_heap_end) & 0xFFFFFFFF00000000)
m_32bitmode = false; else m_32bitmode = true;
printf("Count = %d\n", count);
return rc;
}

static Result process(Gecko::Context &ctx, u64 m_start, u64 m_end) {
Result rc = 0;
u32 size, len;
u64 addr,from,to;
u64 addr,from,to=0;
MemoryInfo info = {};
u32 out_index =0;
addr = m_start;
Expand All @@ -473,8 +476,13 @@ static Result process(Gecko::Context &ctx, u64 m_start, u64 m_end) {
break;
}
// screening
if (m_32bitmode)
len = len + 4;
for (u32 i = 0; i < len-4; i += 4) {
to = *reinterpret_cast<u64 *>(&ctx.buffer[i]);
if (m_32bitmode)
to = *reinterpret_cast<u32 *>(&ctx.buffer[i]);
else
to = *reinterpret_cast<u64 *>(&ctx.buffer[i]);
if (to != 0)
if ((to >= m_heap_start && to <= m_heap_end) || (to >= m_main_start && to <= m_main_end)) {
from = addr + i;
Expand Down

0 comments on commit 2934fe0

Please sign in to comment.