Rizin
unix-like reverse engineering framework and cli tools
c55plus.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <rz_types.h>
#include <rz_lib.h>
#include "../tms320_dasm.h"

Go to the source code of this file.

Functions

int c55x_plus_disassemble (tms320_dasm_t *dasm, const ut8 *buf, int len)
 

Function Documentation

◆ c55x_plus_disassemble()

int c55x_plus_disassemble ( tms320_dasm_t dasm,
const ut8 buf,
int  len 
)

Definition at line 21 of file c55plus.c.

21  {
22  unsigned int next_ins_pos;
23  char *ins_decoded;
24  size_t i, ins_decoded_len;
25 
26  ins_buff = (ut8 *)buf;
28 
29  next_ins_pos = 0;
30 
31  // decode instruction
32  ins_decoded = c55plus_decode(0, &next_ins_pos);
33  dasm->length = next_ins_pos;
34  if (!ins_decoded) {
35  return 0;
36  }
37 
38  // opcode length
39  dasm->length = next_ins_pos;
40  ins_decoded_len = strlen(ins_decoded);
41  for (i = 0; i < ins_decoded_len; i++) {
42  {
43  ins_decoded[i] = tolower((unsigned char)ins_decoded[i]);
44  }
45  }
46  snprintf(dasm->syntax, sizeof(dasm->syntax), "%s", ins_decoded);
47  free(ins_decoded);
48 
49  return next_ins_pos;
50 }
size_t len
Definition: 6502dis.c:15
lzma_index ** i
Definition: index.h:629
ut8 * ins_buff
Definition: ins.c:6
ut32 ins_buff_len
Definition: ins.c:7
char * c55plus_decode(ut32 ins_pos, ut32 *next_ins_pos)
uint32_t ut32
RZ_API void Ht_() free(HtName_(Ht) *ht)
Definition: ht_inc.c:130
voidpf void * buf
Definition: ioapi.h:138
snprintf
Definition: kernel.h:364
uint8_t ut8
Definition: lh5801.h:11
#define tolower(c)
Definition: safe-ctype.h:149
char syntax[1024]
Definition: tms320_dasm.h:127

References c55plus_decode(), free(), i, ins_buff, ins_buff_len, len, tms320_dasm_t::length, snprintf, tms320_dasm_t::syntax, and tolower.

Referenced by tms320_dasm().