Comments (7)
It's not possible. Currently you have to do everything from a script, figure out another way to dynamically locate the address (via editing the address's formula), do something in between like copy & paste from logs or some hack using the process' memory as your own storage.
Consider this a feature request that may depend on #16... Perhaps I'd envision allowing an existing variable to be an output rather than arbitrarily allowing adding variables to the table.
from bit-slicer.
I have built something that can facilitate this exact use case. I’ve added a second optional parameter to the vm.allocate
function that allows you to define a label for the memory address of the allocated region. (e.g. vm.allocate(8, 'importantPointer')
I’ve also added a new function (label
) for DDMathParser
which you can use as following with the above label in the address field of a variable: [label('importantPointer')] + 0x5
.
I’ll open a PR for this but I am sure the impl. will require some polishing. It’s not that big of an addition. (In terms of LoC).
from bit-slicer.
Interesting approach. I don't think vm.allocate is appropriate for that but maybe a setLabel function can be added instead. That way you can label something existing too.
from bit-slicer.
And I guess for completeness it should be possible to set a label to an address in the UI too.
from bit-slicer.
Interesting approach. I don't think vm.allocate is appropriate for that but maybe a setLabel function can be added instead. That way you can label something existing too.
Yeah, I had realized this as well. I figured that debug.setLabel
and debug.removeLabel
is the best to add instead.
Regarding the UI approach. I believe labels should be associated with a document then. The easiest approach is added a optional label property on ZGVariable, and adding a specific ZGLabelManager to manage all label associations? Unless you’re referring to the MemoryViewer and/or Debugger?
from bit-slicer.
Yeah, I had realized this as well. I figured that debug.setLabel and debug.removeLabel is the best to add instead.
Either just debug.setLabel (and have None set no label or remove existing label) or addLabel and removeLabel. Former may make more sense.
Regarding the UI approach. I believe labels should be associated with a document then.
I think this is a fine approach. I don't think the ZGVariable's should have a label property then, since labels would be for the document, not variable. The variable address formula would just reference the label. Maybe setting labels in the UI could be done later.
from bit-slicer.
Setting labels in the UI is a bit more work than I initially thought. I think the best approach is to have a dedicated spot where one can view all labels that exists for a document. I am not sure what the best way to display them is. (Maybe something like what's done in the debugger view with the registers/trace)
I do believe that the best approach would be to create a ZGLabel
container class for a ZGVariable
, because I see two main use cases for labels:
- Assign a static address to a label. (From a script or maybe manually through some UI interaction)
- Assign the result of an address formula (from a variable with type
ZGPointer
) to a label.
Now, both cases can be easily supported when a ZGLabel
has a addressFormula
field and associated semantics similar to ZGVariable
. You could even go as far as saying that a ZGLabel
is in fact a ZGVariable
with an immutable size
(4 for 32bit and 8 for 64bit) and type
(pointer
), and that it has an additional field name
which allows it to be referenced in ZGVariable
addressFormula
field(s) using the aforementioned label()
mechanic.
I'll try to play around with that concept a bit, but I won't do anything with displaying all existing labels for a document yet. As I have no idea what the best approach is for that. Maybe a SplitView in the Search Document with both a Variables and Labels TableView? Where the Labels view is hidden by default but can be toggled or something?
I also see a possible issue with cyclic references of labels, but I am not sure if this is a real issue. I do know how to detect these, but that requires a lot more code and subsequent UI/UX to guide the user. So I'd prefer to not add it yet.
from bit-slicer.
Related Issues (20)
- Instacrash when searching HOT 11
- Memory cannot be searched because it may be running with elevated privileges. HOT 5
- Threading for a lot of While loops HOT 3
- Bit Slicer suddenly doesn't work for any app HOT 7
- [Feature Request] Can you add a feature that we can see decimal value in memory viewer or debugger. HOT 1
- Group-Search function HOT 3
- "<game name> memory cannot be searched due to system protections." HOT 5
- Support code injection for Apple Silicon HOT 3
- use external python or use pip of internal python HOT 6
- debugger defaults to ARM on x86 executable HOT 7
- Add closable section of variables HOT 1
- Allow use of symbol() function in variable address field HOT 5
- Feature request: Searching for multiples HOT 2
- Addresses not corresponding to addresses in ROM HOT 1
- ~1MB difference in 1.7.12 DMG file sizes HOT 7
- Need more guide of Scripting
- Scripts fail to edit/open in IDLE HOT 20
- [Feature Request] Nearby Search HOT 9
- [Feature Request] Searching in Memory Viewer
- 1.8 Alphas HOT 5
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 bit-slicer.