Skip to content

Commit

Permalink
Remove the problem function
Browse files Browse the repository at this point in the history
  • Loading branch information
luoyesiqiu committed Aug 3, 2024
1 parent 06d40c1 commit 0eaddb6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 51 deletions.
50 changes: 0 additions & 50 deletions shell/src/main/cpp/dpt_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,56 +436,6 @@ const char* find_symbol_in_elf_file(const char *elf_file,int keyword_count,...)
return nullptr;
}

void hexdump(__unused const char* name,const void* data, size_t size){
char ascii[17];
size_t i, j;
ascii[16] = '\0';
char *buffer = (char*)calloc(size,1);
const size_t MAX_LEN = size/2;
char *item = (char*)calloc(MAX_LEN,1);
for (i = 0; i < size; ++i) {
memset(item,0,MAX_LEN);
snprintf(item,MAX_LEN,"%02X ", ((unsigned char*)data)[i]);
snprintf(buffer + strlen(buffer),MAX_LEN,"%s",item);
if (((unsigned char*)data)[i] >= ' ' && ((unsigned char*)data)[i] <= '~') {
ascii[i % 16] = ((unsigned char*)data)[i];
} else {
ascii[i % 16] = '.';
}
if ((i+1) % 8 == 0 || i+1 == size) {
memset(item,0,MAX_LEN);
snprintf(item,MAX_LEN,"%s"," ");
snprintf(buffer + strlen(buffer),MAX_LEN,"%s",item);

if ((i+1) % 16 == 0) {
memset(item,0,MAX_LEN);
snprintf(item,MAX_LEN,"| %s ", ascii);
snprintf(buffer + strlen(buffer),MAX_LEN,"%s\n",item);

} else if (i+1 == size) {
ascii[(i+1) % 16] = '\0';
if ((i+1) % 16 <= 8) {
memset(item,0,MAX_LEN);
snprintf(item,MAX_LEN,"%s"," ");
snprintf(buffer + strlen(buffer) + 1,MAX_LEN,"%s",item);
}
for (j = (i+1) % 16; j < 16; ++j) {
memset(item,0,MAX_LEN);
snprintf(item,MAX_LEN,"%s"," ");
snprintf(buffer + strlen(buffer),MAX_LEN,"%s",item);
}
memset(item,0,MAX_LEN);
snprintf(item,MAX_LEN,"| %s ", ascii);
snprintf(buffer + strlen(buffer),MAX_LEN,"%s\n",item);
}
}
}
DLOGD("%s: \n%s",name,buffer);
free(item);
free(buffer);
}


int find_in_maps(int count,...) {
const int MAX_READ_LINE = 10 * 1024;
char maps_path[128] = {0};
Expand Down
1 change: 0 additions & 1 deletion shell/src/main/cpp/dpt_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ void getCompressedDexesPath(JNIEnv *env,char *outDexZipPath,size_t max_len);
void getCodeCachePath(JNIEnv *env,char *outCodeCachePath,size_t max_len);
jstring getCompressedDexesPathExport(JNIEnv *,jclass __unused);
void appendLog(const char* log);
void hexdump(const char* name,const void* data, size_t size);
void load_apk(JNIEnv *env,void **apk_addr,size_t *apk_size);
void extractDexesInNeeded(JNIEnv *env,void *apk_addr,size_t apk_size);
void unload_apk(void *apk_addr,size_t apk_size);
Expand Down

0 comments on commit 0eaddb6

Please sign in to comment.