SayoriOS 0.3.3

hexview.c
1 #include "common.h"
2
11 void hexview_advanced(void *buffer, size_t length, size_t width, bool relative, void (*printer_func)(const char *, ...)) {
12 char* cbuf = (char*)buffer;
13
14 for(size_t i = 0; i < length; i += width) {
15 if(relative)
16 printer_func("%08v: ", i);
17 else
18 printer_func("%08v: ", cbuf + i);
19
20 for(int j = 0; j < (length - i < width ? length - i : width); j++) {
21 printer_func("%02v ", ((char)*(cbuf + i + j)) & 0xFF);
22 }
23
24 printer_func("\n");
25 }
26 }
common.h
Основные определения ядра