Skip to content

Unsupported value type with mcsema bitcode #220

Open

Description

@Heath123

Trying to decompile the code for xz from the walkthrough:

F0206 08:52:46.518694 132263 IRToASTVisitor.cpp:379] Unsupported value type: @data_1ff0d023 = internal alias i8, getelementptr inbounds (<{ %seg_1ff00000_LOAD_2af8_type, [1288 x i8], %seg_1ff03000__init_1b_type, [923 x i8], %seg_1ff0d000__rodata_32f0_type, [5184 x i8], %seg_1ff13190__init_array_10_type }>, <{ %seg_1ff00000_LOAD_2af8_type, [1288 x i8], %seg_1ff03000__init_1b_type, [923 x i8], %seg_1ff0d000__rodata_32f0_type, [5184 x i8], %seg_1ff13190__init_array_10_type }>* @__mcsema_all_segments, i32 0, i32 4, i32 0, i32 35)
*** Check failure stack trace: ***
    @     0x5635a51727fc  google::LogMessageFatal::~LogMessageFatal()
    @     0x5635a4fffbf9  rellic::IRToASTVisitor::GetOrCreateDecl()
    @     0x5635a4ffefbb  rellic::IRToASTVisitor::GetOperandExpr()
    @     0x5635a5002393  rellic::IRToASTVisitor::CreateLiteralExpr()
    @     0x5635a4ffec00  rellic::IRToASTVisitor::GetOrCreateStmt()
    @     0x5635a4ffef75  rellic::IRToASTVisitor::GetOperandExpr()
    @     0x5635a5002393  rellic::IRToASTVisitor::CreateLiteralExpr()
    @     0x5635a4ffec00  rellic::IRToASTVisitor::GetOrCreateStmt()
    @     0x5635a4ffef75  rellic::IRToASTVisitor::GetOperandExpr()
    @     0x5635a4fff940  rellic::IRToASTVisitor::VisitGlobalVar()
    @     0x5635a4ff9f92  rellic::GenerateAST::runOnModule()
    @     0x5635a6b81cf9  llvm::legacy::PassManagerImpl::run()
    @     0x5635a4f3a6c2  main
    @     0x7ff593771b25  __libc_start_main
    @     0x5635a4f54bea  _start
    @              (nil)  (unknown)
fish: Job 1, '/home/heath/rellic-test/usr/loc…' terminated by signal SIGABRT (Abort)

Happens at
https://github.com/lifting-bits/rellic/blob/master/lib/AST/IRToASTVisitor.cpp#L379

Activity

  1. Heath123 commented on Feb 6, 2022

    @Heath123
    Author

    Executable + bitcode:
    files.zip

  2. pgoodman commented on Feb 7, 2022

    @pgoodman
    Contributor

    Hrmm, this is a result of GlobalAliases. @frabert to handle these we'd probably need to lift the aliasee instead of the alias itself. We could probably lift to local variables accordingly initialized to retain the alias name. Then they wouldn't turn into global variables.

  3. Heath123 commented on Feb 7, 2022

    @Heath123
    Author

    Is Rellic designed to generate readable C code from mcsema output? At first I thought t would but mcsema bitcode doesn't seem to work like normal bitcode as it uses the State thing

  4. pgoodman commented on Feb 7, 2022

    @pgoodman
    Contributor

    @Heath123 Rellic is designed more for anvill-produced bitcode or Clang-produced bitcode. McSerma-produced bitcode makes heavy use of global aliases for human readability of the bitcode, but those aliases can be disabled with --disable_aliases.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions