Skip to content

Lock nodes offset #48

Open
Open

Description

@Stridemann

Hi,
Thanks again for a program.

I just wanted to ask if it's possible to add LOCK node feature. When you lock node it's offset can't be broken after deleting/inserting bytes before/under it.
Sometimes we don't need to define types in whole structure, just some nodes at start, middle and end of structure.

Also this feature gives us other new awesome feature - we can delete some byte range we don't need (like "hide" in old reclass).

I know, this can be not easy task, just wanted to ask if this is possible.
Thanks you.

Activity

  1. Stridemann commented on Feb 28, 2018

    @Stridemann
    Author

    Also adding options for inserting 1 and 2 bytes will be awesome too.

  2. KN4CK3R commented on Mar 1, 2018

    @KN4CK3R
    Member

    ye, locking something would be amazing, like the checkbox when u add a value in cheat engine, u press it, and it forces the value to it every 50 milisecond

    That's not what he is talking about.

  3. KN4CK3R commented on Mar 1, 2018

    @KN4CK3R
    Member

    @Stridemann Currently that's not possible. There is a rewrite of the internal class representation planned. The new system may have support for that.

  4. Stridemann commented on Mar 2, 2018

    @Stridemann
    Author

    @KN4CK3R Thanks a lot for your work on this project. That will be really great.
    I also working on free program for reversing (searching offsets) https://github.com/Stridemann/StructureSpiderAdvanced

    I got one stable bug that throws crash error (can continue working, no data lost). Don't want to create a new issue due to low priority: When you double click on node to edit name (enable text input field) and then right click on any other place or node you will got error.

  5. KN4CK3R commented on Mar 2, 2018

    @KN4CK3R
    Member

    I got one stable bug that throws crash error (can continue working, no data lost). Don't want to create a new issue due to low priority: When you double click on node to edit name (enable text input field) and then right click on any other place or node you will got error.

    But a crash is a real issue so you should have created another one.

  6. added a commit that references this issue on Mar 2, 2018
  7. reopened this on Mar 2, 2018
  8. KN4CK3R commented on Mar 2, 2018

    @KN4CK3R
    Member

    The original request isn't implemented...

  9. dot-visual commented on Aug 21, 2019

    @dot-visual

    Still no fix for this? @KN4CK3R

  10. Timboy67678 commented on Aug 21, 2019

    @Timboy67678
    Contributor
  11. LoneDev6 commented on Feb 28, 2021

    @LoneDev6

    Hello!
    I think this feature request is a must have to avoid doing using a top-down approach when reversing a structure.
    Let us know what you think @KN4CK3R

  12. oculus472 commented on Jun 16, 2021

    @oculus472

    Does anyone know of a good way to handle this? At the moment redefining fields is a nightmare.

  13. LoneDev6 commented on Jun 16, 2021

    @LoneDev6

    No idea sincerely, all the tools I tried have the same problem.
    I always have to redefine all my structures from the ground up and use a top down approach

  14. ross-weir commented on Jun 17, 2021

    @ross-weir

    @KN4CK3R Is this still something you'd be interested having added?

    If so I'd like to have a go at implementing this. Do you have any preferences/suggestions on how to go about it?

    From a quick look I was thinking something like:

    • Before adding nodes in InsertBytes save all defined node offsets - defined nodes being those with a non empty Name value.
    • After adding nodes restore saved nodes to original offsets
  15. LoneDev6 commented on Jun 18, 2021

    @LoneDev6

    @KN4CK3R Is this still something you'd be interested having added?

    If so I'd like to have a go at implementing this. Do you have any preferences/suggestions on how to go about it?

    From a quick look I was thinking something like:

    * Before adding nodes in `InsertBytes` save all defined node offsets - defined nodes being those with a non empty `Name` value.
    
    * After adding nodes restore saved nodes to original offsets
    

    Why not implementing it anyway, opening a pull request and in the meantime publish your fork?

  16. KN4CK3R commented on Jun 18, 2021

    @KN4CK3R
    Member

    You have to keep in mind that BaseNode.Offset is not intended to be frozen. Every action which changes the class layout recalculates the offset for all nodes.

  17. LoneDev6 commented on Jun 19, 2021

    @LoneDev6

    @KN4CK3R So basically this means that the program is structured in a way that this feature is very hard to implement without a lot of modifications?

  18. KN4CK3R commented on Jun 19, 2021

    @KN4CK3R
    Member

    Yes, you would have to insert HexNodes infront to increase a nodes offset or remove them. Removing will be a problem if there are no unused hex nodes to remove.
    Something like this is already there:

    if (ShouldCompensateSizeChanges)
    {
    var oldSize = oldNode.MemorySize;
    var newSize = newNode.MemorySize;
    if (newSize < oldSize)
    {
    InsertBytes(index + 1, oldSize - newSize, ref additionalCreatedNodes);
    }
    /*else if (newSize > oldSize)
    {
    RemoveNodes(index + 1, newSize - oldSize);
    }*/
    }

    Commented out 5 years ago because I decided it's not worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions