Skip to content

Commit

Permalink
don't confirm before cutting action
Browse files Browse the repository at this point in the history
  • Loading branch information
skyfloogle committed Sep 9, 2023
1 parent e4b49e1 commit 04eee56
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1158,12 +1158,15 @@ unsafe extern "fastcall" fn confirm_before_deleting_action(action_id: usize, eve
}

macro_rules! deleting_action_inj {
($name:ident, $mov:literal) => {
($name:ident, $test:literal, $mov:literal) => {
#[naked]
unsafe extern "fastcall" fn $name() {
asm!(
// call original function
"call [edx + 0xec]",
// if we're cutting, don't ask
$test,
"je 2f",
// call confirm_before_deleting_action
"mov ecx, eax",
$mov,
Expand All @@ -1182,8 +1185,16 @@ macro_rules! deleting_action_inj {
}
}

deleting_action_inj!(confirm_before_deleting_action_object, "mov edx, [esi + 0x817c]");
deleting_action_inj!(confirm_before_deleting_action_timeline, "mov edx, [esi + 0x434]");
deleting_action_inj!(
confirm_before_deleting_action_object,
"cmp dword ptr [esp + 0x10], 0x6c7873",
"mov edx, [esi + 0x817c]"
);
deleting_action_inj!(
confirm_before_deleting_action_timeline,
"cmp dword ptr [esp + 0x10], 0x6f9903",
"mov edx, [esi + 0x434]"
);

#[naked]
unsafe extern "C" fn object_clean_collide_events_inj() {
Expand Down

0 comments on commit 04eee56

Please sign in to comment.