<commit_before>/**
 * @file mem.c
 * @date 13.02.2009
 * @author <NAME>
 */
#include "shell_command.h"

#define COMMAND_NAME     "mem"
#define COMMAND_DESC_MSG "read from memory"
#define HELP_MSG         "Usage: mem [-h] [-a addr] [-n num]"
static const char *man_page =
	#include "mem_help.inc"
	;

DECLARE_SHELL_COMMAND(COMMAND_NAME, exec, COMMAND_DESC_MSG, HELP_MSG, man_page);

char mem_keys[] = {
	'a', 'n', 'h'
};

void mem_print(uint32_t *addr, unsigned int amount) {
	long i = 0;
	uint32_t *cur_addr = (uint32_t *) ((uint32_t) addr & 0xFFFFFFFC);
	while (i < amount) {
		if (0 == (i % 4)) {
			printf("0x%08x:\t", (unsigned)cur_addr);
		}
		printf("0x%08x\t", (unsigned) cur_addr);<commit_msg>Print of a value by its address is corrected in the function mem_print<commit_after>/**
 * @file mem.c
 * @date 13.02.2009
 * @author <NAME>
 */
#include "shell_command.h"

#define COMMAND_NAME     "mem"
#define COMMAND_DESC_MSG "read from memory"
#define HELP_MSG         "Usage: mem [-h] [-a addr] [-n num]"
static const char *man_page =
	#include "mem_help.inc"
	;

DECLARE_SHELL_COMMAND(COMMAND_NAME, exec, COMMAND_DESC_MSG, HELP_MSG, man_page);

char mem_keys[] = {
	'a', 'n', 'h'
};

void mem_print(uint32_t *addr, unsigned int amount) {
	long i = 0;
	uint32_t *cur_addr = (uint32_t *) ((uint32_t) addr & 0xFFFFFFFC);
	while (i < amount) {
		if (0 == (i % 4)) {
			printf("0x%08x:\t", (unsigned)cur_addr);
		}
		printf("0x%08x\t", *(unsigned *) cur_addr);
{'fraction_non_alphanumeric': 0.16826265389876882, 'fraction_numerical': 0.03556771545827633, 'mean_word_length': 4.151408450704225, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2313106', 'n_tokens_mistral': 645, 'n_tokens_neox': 590, 'n_words': 149}