From 3922b5891aec41fe3f471a782dbd419fb9dd7def Mon Sep 17 00:00:00 2001 From: Jason Hiser <jdhiser@gmail.com> Date: Mon, 16 Sep 2019 22:51:44 -0400 Subject: [PATCH] more type-punning removal --- unpin_x86.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/unpin_x86.cpp b/unpin_x86.cpp index df11140..13ce614 100644 --- a/unpin_x86.cpp +++ b/unpin_x86.cpp @@ -72,7 +72,9 @@ void UnpinX86_t::HandleRetAddrReloc(Instruction_t* from_insn, Relocation_t* relo unsigned char newpush[5]; newpush[0]=0x68; - *(int*)&newpush[1]=(int)wrt_insn_location; + const auto newVal=(int)wrt_insn_location; + // *(int*)&newpush[1]=(int)wrt_insn_location; + memcpy(&newpush[1],&newVal,sizeof(newVal)); cout<<"Unpin::Updating push32/push64-exe insn:" <<dec<<from_insn->getBaseID()<<":"<<from_insn->getDisassembly()<<"@"<<hex<<from_insn_location<<" to point at " -- GitLab