Comments (4)
Hey @xmpf,
you've correctly located the instruction that gives that output :
While the 8-bits registry CL is (always) used for SAR second variable operand, reading the Intel x64 specs for SAR gives :
(Intel Software Developer’s Manual, Volume 2B, page 4-584)
and the corresponding bits for AMD64 :
(AMD64 Architecture Programmer's Manual volume 3, page 318)
So when the compiler is translating the >>
operator to a SAR instruction, it's implicit that the right operand will be used modulo 64 (or modulo 32 if using a 32-bits wide register).
Ghidra, being a friendly program, slaps an artificial & 0x3F
in its decompilation to reminds the reverser that fact.
from hackaday-u.
You're welcome.
If you're refering to :
then this logical AND
applies to the whole expression, not only index*8
and truncate the number to fit inside an unsigned char
.
This is visible in the decompiled code as a (char)
cast :
or in the disassembly when the 8-bits register AL
is used to store the result :
from hackaday-u.
Thanks :)
from hackaday-u.
Hi, thank you for your answer.
In the original source code however, the modulo is 0xff.
from hackaday-u.
Related Issues (11)
- Session 7 - PCode and PCode Emulation
- Session 8 - Building / Modifying a Processor Module
- (Session One) The skelexor exercice binary should be rebuild HOT 1
- Undefined behavior in session 3's `pointer-struct.c` and `files` binary
- Session 1 presentation - comments and typos HOT 1
- Solution walkthroughs? HOT 3
- [Unrelated] Do you know of a gdb plugin for ghidra that can debug 3ds? HOT 2
- simple-examples folder missing HOT 1
- Session 5 - Python Scripting
- Session 6 - Eclipse Integration / Plugin Building / Module Building
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hackaday-u.