mirror of
https://github.com/d0k3/GodMode9.git
synced 2025-06-26 13:42:47 +00:00
Hexviewer: some minor cosmetics
This commit is contained in:
parent
a7d17ccd22
commit
8b21d0209b
@ -460,6 +460,7 @@ u32 FileHexViewer(const char* path) {
|
|||||||
u32 last_offset = (u32) -1;
|
u32 last_offset = (u32) -1;
|
||||||
u32 offset = 0;
|
u32 offset = 0;
|
||||||
|
|
||||||
|
u8 found_data[64 + 1] = { 0 };
|
||||||
u32 found_offset = (u32) -1;
|
u32 found_offset = (u32) -1;
|
||||||
u32 found_size = 0;
|
u32 found_size = 0;
|
||||||
|
|
||||||
@ -649,9 +650,7 @@ u32 FileHexViewer(const char* path) {
|
|||||||
else if ((pad_state & BUTTON_A) && total_data) edit_mode = true;
|
else if ((pad_state & BUTTON_A) && total_data) edit_mode = true;
|
||||||
else if (pad_state & (BUTTON_B|BUTTON_START)) break;
|
else if (pad_state & (BUTTON_B|BUTTON_START)) break;
|
||||||
else if (found_size && (pad_state & BUTTON_R1) && (pad_state & BUTTON_X)) {
|
else if (found_size && (pad_state & BUTTON_R1) && (pad_state & BUTTON_X)) {
|
||||||
u8 data[64] = { 0 };
|
found_offset = FileFindData(path, found_data, found_size, found_offset + 1);
|
||||||
FileGetData(path, data, found_size, found_offset);
|
|
||||||
found_offset = FileFindData(path, data, found_size, found_offset + 1);
|
|
||||||
if (found_offset == (u32) -1) {
|
if (found_offset == (u32) -1) {
|
||||||
ShowPrompt(false, "Not found!");
|
ShowPrompt(false, "Not found!");
|
||||||
found_size = 0;
|
found_size = 0;
|
||||||
@ -668,23 +667,20 @@ u32 FileHexViewer(const char* path) {
|
|||||||
(unsigned int) offset);
|
(unsigned int) offset);
|
||||||
if (new_offset != (u64) -1) offset = new_offset;
|
if (new_offset != (u64) -1) offset = new_offset;
|
||||||
} else if (user_select == 2) {
|
} else if (user_select == 2) {
|
||||||
char string[64 + 1] = { 0 };
|
if (!found_size) *found_data = 0;
|
||||||
if (found_size) FileGetData(path, (u8*) string, (found_size <= 64) ? found_size : 64, found_offset);
|
if (ShowStringPrompt((char*) found_data, 64 + 1, "Enter search string below.\n(R+X to repeat search)", (unsigned int) offset)) {
|
||||||
if (ShowStringPrompt(string, 64 + 1, "Enter search string below.\n(R+X to repeat search)", (unsigned int) offset)) {
|
found_size = strnlen((char*) found_data, 64);
|
||||||
found_size = strnlen(string, 64);
|
found_offset = FileFindData(path, found_data, found_size, offset);
|
||||||
found_offset = FileFindData(path, (u8*) string, found_size, offset);
|
|
||||||
if (found_offset == (u32) -1) {
|
if (found_offset == (u32) -1) {
|
||||||
ShowPrompt(false, "Not found!");
|
ShowPrompt(false, "Not found!");
|
||||||
found_size = 0;
|
found_size = 0;
|
||||||
} else offset = found_offset;
|
} else offset = found_offset;
|
||||||
}
|
}
|
||||||
} else if (user_select == 3) {
|
} else if (user_select == 3) {
|
||||||
u8 data[64] = { 0 };
|
u32 size = found_size;
|
||||||
u32 size = 0;
|
if (ShowDataPrompt(found_data, &size, "Enter search data below.\n(R+X to repeat search)", (unsigned int) offset)) {
|
||||||
if (found_size) size = FileGetData(path, data, (found_size <= 64) ? found_size : 64, found_offset);
|
|
||||||
if (ShowDataPrompt(data, &size, "Enter search data below.\n(R+X to repeat search)", (unsigned int) offset)) {
|
|
||||||
found_size = size;
|
found_size = size;
|
||||||
found_offset = FileFindData(path, data, size, offset);
|
found_offset = FileFindData(path, found_data, size, offset);
|
||||||
if (found_offset == (u32) -1) {
|
if (found_offset == (u32) -1) {
|
||||||
ShowPrompt(false, "Not found!");
|
ShowPrompt(false, "Not found!");
|
||||||
found_size = 0;
|
found_size = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user