Giter Club home page Giter Club logo

Comments (4)

rurban avatar rurban commented on May 18, 2024

What is missing is the recalculation of relative jumps, dependent on the size of the new ASM_MOV_EBP, 5 or 2.

from potion.

rurban avatar rurban commented on May 18, 2024

Latest udis86 has the signed mem offset problem for offset sizes>1byte fixed.

BTW: the needed udis86 fix for 1.7 was

diff --git a/libudis86/syn-att.c b/libudis86/syn-att.c
index 7a7fc7c..f8d703e 100644
--- a/libudis86/syn-att.c
+++ b/libudis86/syn-att.c
@@ -64,10 +64,16 @@ gen_operand(struct ud* u, struct ud_operand* op)
                                mkasm(u, "-0x%x", (-op->lval.sbyte) & 0xff);
                        else    mkasm(u, "0x%x", op->lval.sbyte);
                } 
-               else if (op->offset == 16) 
-                       mkasm(u, "0x%x", op->lval.uword);
-               else if (op->offset == 32) 
-                       mkasm(u, "0x%lx", op->lval.udword);
+               else if (op->offset == 16) {
+                        if (op->lval.sword < 0) /* rurban: large negative offsets */
+                                mkasm(u, "-0x%x", (-op->lval.sword) & 0xffff);
+                       else    mkasm(u, "0x%x", op->lval.sword);
+                }
+               else if (op->offset == 32) {
+                        if (op->lval.sdword < 0) /* rurban: large negative offsets */
+                                mkasm(u, "-0x%lx", (-op->lval.sdword) & 0xffff);
+                       else    mkasm(u, "0x%lx", op->lval.udword);
+                }
                else if (op->offset == 64) 
                        mkasm(u, "0x" FMT64 "x", op->lval.uqword);

from potion.

rurban avatar rurban commented on May 18, 2024

And this patch improves gdb readbility: https://sourceware.org/ml/gdb-patches/2013-10/msg00393.html

from potion.

rurban avatar rurban commented on May 18, 2024

There are 3 more cases of such possible overflows (15: 64bit, 31: 32bit)

  • potion_x86_upvals: upc > 15
  • potion_x86_method: (lregs + opp.b) > 15/31 and upc > 15/31

from potion.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.