Skip to content

Commit e82041e

Browse files
committed
'ghost exceptions' fix - spoof hit detection needs to occur based on the demon event's reported exception address, rather than wherever the instruction pointer happens to be at the time of the exception
1 parent c1a2023 commit e82041e

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/ctrl/ctrl_core.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -5331,7 +5331,7 @@ ctrl_thread__run(DMN_CtrlCtx *ctrl_ctx, CTRL_Msg *msg)
53315331
if(spoof_mode &&
53325332
dmn_handle_match(target_process.dmn_handle, event->process) &&
53335333
dmn_handle_match(target_thread.dmn_handle, event->thread) &&
5334-
spoof.new_ip_value == event->instruction_pointer)
5334+
spoof.new_ip_value == event->address)
53355335
{
53365336
hit_spoof = 1;
53375337
log_infof("hit_spoof\n");

src/raddbg/raddbg_core.c

+7
Original file line numberDiff line numberDiff line change
@@ -10933,6 +10933,7 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
1093310933
if(thread != &ctrl_entity_nil)
1093410934
{
1093510935
dr_fancy_string_list_push_new(arena, &fstrs, rd_font_from_slot(RD_FontSlot_Icons), ui_top_font_size(), ui_top_palette()->text, rd_icon_kind_text_table[RD_IconKind_CircleFilled]);
10936+
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" "));
1093610937
dr_fancy_string_list_concat_in_place(&fstrs, &thread_fstrs);
1093710938
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" hit a breakpoint"));
1093810939
}
@@ -10948,6 +10949,7 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
1094810949
{
1094910950
default:
1095010951
{
10952+
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" "));
1095110953
dr_fancy_string_list_concat_in_place(&fstrs, &thread_fstrs);
1095210954
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" hit an exception - "));
1095310955
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
@@ -10961,13 +10963,15 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
1096110963
}break;
1096210964
case CTRL_ExceptionKind_CppThrow:
1096310965
{
10966+
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" "));
1096410967
dr_fancy_string_list_concat_in_place(&fstrs, &thread_fstrs);
1096510968
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" hit a C++ exception - "));
1096610969
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
1096710970
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, exception_code_string);
1096810971
}break;
1096910972
case CTRL_ExceptionKind_MemoryRead:
1097010973
{
10974+
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" "));
1097110975
dr_fancy_string_list_concat_in_place(&fstrs, &thread_fstrs);
1097210976
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" hit an exception - "));
1097310977
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
@@ -10976,6 +10980,7 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
1097610980
}break;
1097710981
case CTRL_ExceptionKind_MemoryWrite:
1097810982
{
10983+
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" "));
1097910984
dr_fancy_string_list_concat_in_place(&fstrs, &thread_fstrs);
1098010985
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" hit an exception - "));
1098110986
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
@@ -10984,6 +10989,7 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
1098410989
}break;
1098510990
case CTRL_ExceptionKind_MemoryExecute:
1098610991
{
10992+
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" "));
1098710993
dr_fancy_string_list_concat_in_place(&fstrs, &thread_fstrs);
1098810994
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" hit an exception - "));
1098910995
String8 exception_code_string = str8_from_u64(arena, event->exception_code, 16, 0, 0);
@@ -11011,6 +11017,7 @@ rd_stop_explanation_fstrs_from_ctrl_event(Arena *arena, CTRL_Event *event)
1101111017
case CTRL_EventCause_InterruptedByTrap:
1101211018
{
1101311019
dr_fancy_string_list_push_new(arena, &fstrs, rd_font_from_slot(RD_FontSlot_Icons), ui_top_font_size(), ui_top_palette()->text, rd_icon_kind_text_table[RD_IconKind_WarningBig]);
11020+
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" "));
1101411021
dr_fancy_string_list_concat_in_place(&fstrs, &thread_fstrs);
1101511022
dr_fancy_string_list_push_new(arena, &fstrs, ui_top_font(), ui_top_font_size(), ui_top_palette()->text, str8_lit(" hit a trap"));
1101611023
}break;

0 commit comments

Comments
 (0)