The libdisasm project provides C (and SWIG Python/Perl bindings) for disassembling x86 opcode streams into instruction and operand details.