| 69 | return false; |
| 70 | } |
| 71 | void outputHex(uint8_t *buf,uint8_t *lbuf,size_t len,size_t start,color_ostream &con,vector<t_memrange> & ranges) |
| 72 | { |
| 73 | const size_t page_size=16; |
| 74 | |
| 75 | for(size_t i=0;i<len;i+=page_size) |
| 76 | { |
| 77 | //con.gotoxy(1,i/page_size+1); |
| 78 | con.print("0x{:0>8X} ",i+start); |
| 79 | for(size_t j=0;(j<page_size) && (i+j<len);j++) |
| 80 | { |
| 81 | if(j%sizeof(void*)==0) |
| 82 | { |
| 83 | con.reset_color(); |
| 84 | |
| 85 | if(isAddrAt((uintptr_t *)(buf+j+i),ranges)) |
| 86 | con.color(COLOR_LIGHTRED); //coloring in the middle does not work |
| 87 | //TODO make something better? |
| 88 | } |
| 89 | if(lbuf[j+i]!=buf[j+i]) |
| 90 | con.print("*{:0>2X}",static_cast<unsigned>(buf[j+i])); //if modfied show a star |
| 91 | else |
| 92 | con.print(" {:0>2X}",static_cast<unsigned>(buf[j+i])); |
| 93 | } |
| 94 | con.reset_color(); |
| 95 | con.print(" | "); |
| 96 | for(size_t j=0;(j<page_size) && (i+j<len);j++) |
| 97 | if((buf[j+i]>31)&&(buf[j+i]<128)) //only printable ascii |
| 98 | con.print("{}",static_cast<char>(buf[j+i])); |
| 99 | else |
| 100 | con.print("."); |
| 101 | con.print("\n"); |
| 102 | } |
| 103 | con.print("\n"); |
| 104 | } |
| 105 | void Deinit() |
| 106 | { |
| 107 | if(memdata.state==STATE_ON) |
no test coverage detected