Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[move-diassembler][small] Display strings in disassembler #13956

Merged
merged 1 commit into from
Sep 25, 2023

Conversation

tzakian
Copy link
Contributor

@tzakian tzakian commented Sep 25, 2023

Description

Tries to determine if a constant in the constant pool can be interpreted as a utf8 string. If it can it displays it as such, and adds a comment saying it's interpreted the data that way.

Test Plan

Tested locally:

module 0x1::M {
    const X: vector<u8> = b"hello world";
    public fun use_X(): vector<u8> { X }
}
$ move disassemble --name M
// Move bytecode v6
module 1.M {


public use_X(): vector<u8> {
B0:
        0: LdConst[0](Vector(U8): 0b68656c..)
        1: Ret
}

Constants [
        0 => vector<u8>: "hello world" // interpreted as UTF8 string
]
}

If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process.

Type of Change (Check all that apply)

  • protocol change
  • user-visible impact
  • breaking change for a client SDKs
  • breaking change for FNs (FN binary must upgrade)
  • breaking change for validators or node operators (must upgrade binaries)
  • breaking change for on-chain data layout
  • necessitate either a data wipe or data migration

Release notes

Updated display of constants in disassembled Move bytecode to try and show the deserialized string if the constant is a vector<u8> that is valid utf8.

@vercel
Copy link

vercel bot commented Sep 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mysten-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2023 6:58pm
sui-typescript-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 25, 2023 6:58pm
3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
explorer ⬜️ Ignored (Inspect) Visit Preview Sep 25, 2023 6:58pm
multisig-toolkit ⬜️ Ignored (Inspect) Visit Preview Sep 25, 2023 6:58pm
sui-kiosk ⬜️ Ignored (Inspect) Visit Preview Sep 25, 2023 6:58pm

Copy link
Collaborator

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Tim!

@tzakian tzakian force-pushed the tzakian/display-strings-disassembler branch from 4382c46 to dd11fb1 Compare September 25, 2023 18:57
@tzakian tzakian enabled auto-merge (squash) September 25, 2023 18:58
@tzakian tzakian merged commit 7fa8258 into main Sep 25, 2023
36 checks passed
@tzakian tzakian deleted the tzakian/display-strings-disassembler branch September 25, 2023 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants