Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 04-14-2021, 20:16
jonwil jonwil is offline
VIP
 
Join Date: Feb 2004
Posts: 374
Rept. Given: 2
Rept. Rcvd 21 Times in 9 Posts
Thanks Given: 2
Thanks Rcvd at 57 Times in 32 Posts
jonwil Reputation: 21
IDA/HexRays and bitfields...

Are there any ways (plugins etc) that will allow me to see the actual field being accessed in the HexRays decompilation output when its accessing a structure containing bitfields?

Or any other way to more easily figure out what field its actually accessing?
Reply With Quote
  #2  
Old 04-14-2021, 20:44
aijundi aijundi is offline
Friend
 
Join Date: Jul 2019
Posts: 21
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 1
Thanks Rcvd at 19 Times in 11 Posts
aijundi Reputation: 0
I think this might be what you are looking for.
Reply With Quote
  #3  
Old 04-14-2021, 21:13
jonwil jonwil is offline
VIP
 
Join Date: Feb 2004
Posts: 374
Rept. Given: 2
Rept. Rcvd 21 Times in 9 Posts
Thanks Given: 2
Thanks Rcvd at 57 Times in 32 Posts
jonwil Reputation: 21
No that's not it.

I have a structure that looks like this
struct PATHEVENT {
unsigned int queued;
unsigned int expiry;
unsigned int lastact;
unsigned int eventID : 24;
unsigned int numactions : 8;
unsigned int currentaction : 8;
unsigned int voices : 4;
int priority : 4;
unsigned int bumplower : 1;
unsigned int beingFiltered : 1;
int project : 3;
int unused : 11;
};
I want to get IDA/HexRays to show the correct fields when its doing an access to one of those fields.
Reply With Quote
  #4  
Old 04-14-2021, 22:24
deepzero's Avatar
deepzero deepzero is offline
VIP
 
Join Date: Mar 2010
Location: Germany
Posts: 284
Rept. Given: 104
Rept. Rcvd 63 Times in 41 Posts
Thanks Given: 134
Thanks Rcvd at 178 Times in 84 Posts
deepzero Reputation: 63
Are you sure hexrays is smart enough to decompile bitfields?
Reply With Quote
  #5  
Old 04-14-2021, 23:43
Stingered Stingered is offline
Friend
 
Join Date: Dec 2017
Posts: 160
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 200
Thanks Rcvd at 104 Times in 52 Posts
Stingered Reputation: 2
Per Igor Skochinsky (Hex-Rays)

You can add a struct with bitfields to the Local Types list (Shift-F1, Ins) but they are not currently supported by the decompiler or on the disassembly level.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT +8. The time now is 02:57.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX
( 1998 - 2021 )