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

Segfault: detail is not filled by cs_disasm_iter?? #338

Open
the-moisrex opened this issue Mar 24, 2023 · 0 comments
Open

Segfault: detail is not filled by cs_disasm_iter?? #338

the-moisrex opened this issue Mar 24, 2023 · 0 comments

Comments

@the-moisrex
Copy link

I'm trying to run ./bloaty bloaty -d compileunits but I get a segfault error, it blows at line 76 here:

size_t count = in->detail->x86.op_count;
for (size_t i = 0; i < count; i++) {
cs_x86_op* op = &in->detail->x86.operands[i];
if (op->type == X86_OP_MEM && op->mem.base == X86_REG_RIP &&
op->mem.segment == X86_REG_INVALID &&
op->mem.index == X86_REG_INVALID) {
uint64_t to_address = in->address + in->size + op->mem.disp;
if (to_address) {
sink->AddVMRangeForVMAddr("x86_disassemble", in->address, to_address,
RangeSink::kUnknownSize);
}
}
}

It seems to me that details is filled with a random invalid pointer (0x454545) or it's nullptr depending on which binary is inputted.

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

No branches or pull requests

1 participant