Skip to content

Commit

Permalink
merging missing commits from branch
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbiallas committed Sep 11, 2014
2 parents fa0ee35 + 19d2838 commit 9e121fd
Show file tree
Hide file tree
Showing 31 changed files with 5,402 additions and 2,166 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Expand Up @@ -10,6 +10,11 @@ version 2.0.22:
- Fixed selection of nodes in call chain
- Added ability to view/edit 64 bit symbols and relocation for ELFs
(Thanks tecknicaltom)
- Added new option "editor/scroll offset" which determines how many
extra lines the cursor should be visible when scolling
(Thanks tecknicaltom)
- Fixed loading of ELF files for alpha
- Updated address of FSF

version 2.0.21:
- [x86] AVX2 updates
Expand All @@ -29,6 +34,7 @@ version 2.0.19:
- [x86] AVX updates
- [x86] AVX2 instructions
- [x86] BMI, BMI2 and TBM instructions
- fixed loading of ELF files with no section headers
- [Win32] Fixed loading of files with path length > 100 (thanks Vitaliy)

version 2.0.18:
Expand Down
3 changes: 0 additions & 3 deletions README
Expand Up @@ -283,9 +283,6 @@ Special variables/functions that can be used in EXPRESSION:
`i'
contains the iteration count/index starting with 0

`o'
contains the current offset

Search and its different modes
==============================

Expand Down
7 changes: 6 additions & 1 deletion analyser/Makefile.am
@@ -1,5 +1,11 @@
AUTOMAKE_OPTIONS = foreign

AM_CPPFLAGS = ${my_CPPFLAGS} -I$(top_srcdir) -I$(top_srcdir)/asm \
-I$(top_srcdir)/io/@IO_DIR@ -I$(top_srcdir)/io \
-I$(top_srcdir)/output -I$(top_srcdir)/eval
AM_CFLAGS = ${my_CFLAGS}
AM_CXXFLAGS = ${my_CXXFLAGS}

noinst_LIBRARIES = libanalyser.a

libanalyser_a_SOURCES = analy.cc analy.h analy_alpha.cc analy_alpha.h \
Expand All @@ -14,5 +20,4 @@ analy_ppc.cc analy_ppc.h macho_analy.cc macho_analy.h flt_analy.cc flt_analy.h \
xbe_analy.cc xbe_analy.h pef_analy.cc pef_analy.h analy_arm.cc analy_arm.h \
xex_analy.cc xex_analy.h analy_avr.cc analy_avr.h

INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/asm -I$(top_srcdir)/io/@IO_DIR@ -I$(top_srcdir)/io -I$(top_srcdir)/output -I$(top_srcdir)/eval

8 changes: 4 additions & 4 deletions analyser/analy.cc
Expand Up @@ -189,7 +189,7 @@ AddressFlat32 *AddressFlat32::clone() const

void AddressFlat32::getFromArray(const byte *array)
{
UNALIGNED_MOVE(addr, *(uint32*)array);
memcpy(&addr, array, sizeof(addr));
}

void AddressFlat32::getFromCPUAddress(CPU_ADDR *ca)
Expand Down Expand Up @@ -224,7 +224,7 @@ int AddressFlat32::parseString(const char *s, int length, Analyser *a)

void AddressFlat32::putIntoArray(byte *array) const
{
UNALIGNED_MOVE(*(uint32*)array, addr);
memcpy(array, &addr, sizeof(addr));
}

void AddressFlat32::putIntoCPUAddress(CPU_ADDR *ca) const
Expand Down Expand Up @@ -318,7 +318,7 @@ AddressFlat64 *AddressFlat64::clone() const

void AddressFlat64::getFromArray(const byte *array)
{
UNALIGNED_MOVE(addr, *(uint64*)array);
memcpy(&addr, array, sizeof(addr));
}

void AddressFlat64::getFromCPUAddress(CPU_ADDR *ca)
Expand Down Expand Up @@ -349,7 +349,7 @@ int AddressFlat64::parseString(const char *s, int length, Analyser *a)

void AddressFlat64::putIntoArray(byte *array) const
{
UNALIGNED_MOVE(*(uint64*)array, addr);
memcpy(array, &addr, sizeof(addr));
}

void AddressFlat64::putIntoCPUAddress(CPU_ADDR *ca) const
Expand Down
20 changes: 10 additions & 10 deletions analyser/analy_x86.cc
Expand Up @@ -78,7 +78,7 @@ AddressX86Flat32 *AddressX86Flat32::clone() const

void AddressX86Flat32::getFromArray(const byte *array)
{
UNALIGNED_MOVE(addr, *(uint32*)array);
memcpy(&addr, array, sizeof(addr));
}

void AddressX86Flat32::getFromCPUAddress(CPU_ADDR *ca)
Expand Down Expand Up @@ -113,7 +113,7 @@ int AddressX86Flat32::parseString(const char *s, int length, Analyser *a)

void AddressX86Flat32::putIntoArray(byte *array) const
{
UNALIGNED_MOVE(*(uint32*)array, addr);
memcpy(array, &addr, sizeof(addr));
}

void AddressX86Flat32::putIntoCPUAddress(CPU_ADDR *ca) const
Expand Down Expand Up @@ -217,8 +217,8 @@ AddressX86_1632 *AddressX86_1632::clone() const

void AddressX86_1632::getFromArray(const byte *array)
{
UNALIGNED_MOVE(addr, *(uint32*)array);
UNALIGNED_MOVE(seg, *(uint16*)(array+sizeof addr));
memcpy(&addr, array, sizeof(addr));
memcpy(&seg, array + sizeof(addr), sizeof(seg));
}

void AddressX86_1632::getFromCPUAddress(CPU_ADDR *ca)
Expand Down Expand Up @@ -250,8 +250,8 @@ int AddressX86_1632::parseString(const char *s, int length, Analyser *a)

void AddressX86_1632::putIntoArray(byte *array) const
{
UNALIGNED_MOVE(*(uint32*)array, addr);
UNALIGNED_MOVE(*(uint16*)(array+sizeof addr), seg);
memcpy(array, &addr, sizeof(addr));
memcpy(array + sizeof(addr), &seg, sizeof(seg));
}

void AddressX86_1632::putIntoCPUAddress(CPU_ADDR *ca) const
Expand Down Expand Up @@ -360,8 +360,8 @@ AddressX86_1616 *AddressX86_1616::clone() const

void AddressX86_1616::getFromArray(const byte *array)
{
UNALIGNED_MOVE(addr, *(uint16*)array);
UNALIGNED_MOVE(seg, *(uint16*)(array+sizeof addr));
memcpy(&addr, array, sizeof(addr));
memcpy(&seg, array + sizeof(addr), sizeof(seg));
}

bool AddressX86_1616::getFromUInt64(uint64 u)
Expand Down Expand Up @@ -393,8 +393,8 @@ int AddressX86_1616::parseString(const char *s, int length, Analyser *a)

void AddressX86_1616::putIntoArray(byte *array) const
{
UNALIGNED_MOVE(*(uint16*)array, addr);
UNALIGNED_MOVE(*(uint16*)(array+sizeof seg), seg);
memcpy(array, &addr, sizeof(addr));
memcpy(array + sizeof(addr), &seg, sizeof(seg));
}

void AddressX86_1616::putIntoCPUAddress(CPU_ADDR *ca) const
Expand Down
2 changes: 1 addition & 1 deletion analyser/elf_analy.cc
Expand Up @@ -672,7 +672,7 @@ void ElfAnalyser::initUnasm()
((AnalyAVRDisassembler*)analy_disasm)->init(this);
}
break;
case 0x9026:
case ELF_EM_ALPHA:
if (elf_shared->ident.e_ident[ELF_EI_CLASS] != ELFCLASS64) {
errorbox("Alpha can't be used in a 32-Bit ELF.");
} else {
Expand Down
4 changes: 2 additions & 2 deletions asm/alphadis.cc
Expand Up @@ -81,8 +81,8 @@ dis_insn *Alphadis::decode(byte *code, int maxlen, CPU_ADDR addr)
insn.valid = false;
insn.size = maxlen;
insn.table = 0;
// FIXME: this reads to much bytes!
UNALIGNED_MOVE(insn.data, *(uint32 *)code);
// FIXME: this reads too many bytes!
memcpy(&insn.data, code, sizeof(insn.data));
} else {
insn.valid = true;
insn.size = 4;
Expand Down
4 changes: 2 additions & 2 deletions asm/x86asm.cc
Expand Up @@ -2110,7 +2110,7 @@ bool x86asm::translate_str(asm_insn *asm_insn, const char *s)
}

/**/
splitstr(s, insn->n, sizeof insn->n, (char**)&opp, 256);
splitstr(s, insn->n, sizeof insn->n, (char**)opp, 256);
insn->name = insn->n;
for (int i=0; i<5; i++) {
if (!*op[i]) break;
Expand Down Expand Up @@ -2151,7 +2151,7 @@ int x86asm::simmsize(uint64 imm, int immsize)
return 8;
}

void x86asm::splitstr(const char *s, char *name, int size, char *op[5], int opsize)
void x86asm::splitstr(const char *s, char *name, int size, char **op, int opsize)
{
const char *a, *b;
bool wantbreak = false;
Expand Down
15 changes: 12 additions & 3 deletions classview.cc
Expand Up @@ -713,11 +713,20 @@ static format_viewer_if *htcls_ifs[] = {
static ht_view *class_init(Bounds *b, File *file, ht_format_group *group)
{
u1 magic[4];
u1 extra_magic[4];

file->seek(0);
file->read(magic, 4);
try {
file->seek(0);
file->readx(magic, 4);
file->readx(extra_magic, 4);
} catch (...) {
return NULL;
}
// Mach-O binaries also use 0xcafebabe here. The second byte is the
// number of architectures; if there's more than 10 it's probably
// a Java class file instead.
if (magic[0] == 0xca && magic[1] == 0xfe
&& magic[2] == 0xba && magic[3] == 0xbe) {
&& magic[2] == 0xba && magic[3] == 0xbe && extra_magic[3] > 10) {
file->seek(0);
void *shared_data = (void*)class_read(file);
if (!shared_data) return NULL;
Expand Down
2 changes: 2 additions & 0 deletions elfstruc.h
Expand Up @@ -224,10 +224,12 @@ typedef uint16 elf64_quarter;

#define ELF_EM_MMDSP_PLUS 160 /* STMicroelectronics 64bit VLIW Data Signal Processor */
#define ELF_EM_CYPRESS_M8C 161 /* Cypress M8C microprocessor */

#define ELF_EM_R32C 162 /* Renesas R32C series microprocessors */
#define ELF_EM_TRIMEDIA 163 /* NXP Semiconductors TriMedia architecture family */
#define ELF_EM_QDSP6 164 /* QUALCOMM DSP6 Processor */
#define ELF_EM_8051 165 /* Intel 8051 and variants */

#define ELF_EM_STXP7X 166 /* STMicroelectronics STxP7x family */
#define ELF_EM_NDS32 167 /* Andes Technology compact code size embedded RISC processor family */
#define ELF_EM_ECOG1 168 /* Cyan Technology eCOG1X family */
Expand Down
8 changes: 5 additions & 3 deletions eval/Makefile.am
@@ -1,12 +1,14 @@
YFLAGS=-d

LFLAGS=
AM_CPPFLAGS = ${my_CPPFLAGS} -I$(srcdir) -I$(top_srcdir)
AM_CFLAGS = ${my_CFLAGS}
AM_CXXFLAGS = ${my_CXXFLAGS}
AM_YFLAGS = -d
AM_LFLAGS =

AUTOMAKE_OPTIONS=foreign

noinst_LIBRARIES = libhteval.a
libhteval_a_SOURCES = evalparse.y evalparse.h eval.cc eval.h lex.l lex.h evalx.c evalx.h evaltype.h
INCLUDES = -I$(srcdir) -I$(top_srcdir)

#bin_PROGRAMS = testeval
#testeval_SOURCES = testeval.c
Expand Down
4 changes: 2 additions & 2 deletions htcfg.cc
Expand Up @@ -112,7 +112,7 @@ loadstore_result save_systemconfig(String &error_info)
break;
}
/* write config */
app->store(*d.get());
app->store(*d);
} catch (const Exception &e) {
e.reason(error_info);
return LS_ERROR_WRITE;
Expand Down Expand Up @@ -157,7 +157,7 @@ bool load_systemconfig(loadstore_result *result, int *error_info)
}

/* read config */
app->load(*d.get());
app->load(*d);
} catch (const ObjectNotRegisteredException &) {
*result = LS_ERROR_CORRUPTED;
if (object_stream_type==object_stream_txt && d.get()) {
Expand Down
1 change: 1 addition & 0 deletions htelfhd.cc
Expand Up @@ -194,6 +194,7 @@ static int_hash elf_machine[] =

{ELF_EM_L1OM, "Intel L1OM"},

{ELF_EM_ALPHA, "Alpha"},
{0, 0}
};

Expand Down
14 changes: 7 additions & 7 deletions htformat.cc
Expand Up @@ -2366,9 +2366,9 @@ void ht_uformat_viewer::handlemsg(htmsg *msg)
return;
}
case K_Tab: {
int c = cursor.tag_group;
int c=cursor.tag_group;
cursor_tab();
if (cursor.tag_group != c) {
if (cursor.tag_group!=c) {
focus_cursor();
update_visual_info();
dirtyview();
Expand All @@ -2378,7 +2378,7 @@ void ht_uformat_viewer::handlemsg(htmsg *msg)
break;
}
case K_Home:
if (cursor_state == cursor_state_visible) {
if (cursor_state==cursor_state_visible) {
select_mode_pre();
cursor_home();
select_mode_post(0);
Expand All @@ -2389,7 +2389,7 @@ void ht_uformat_viewer::handlemsg(htmsg *msg)
}
break;
case K_End:
if (cursor_state == cursor_state_visible) {
if (cursor_state==cursor_state_visible) {
select_mode_pre();
cursor_end();
select_mode_post(0);
Expand All @@ -2400,13 +2400,13 @@ void ht_uformat_viewer::handlemsg(htmsg *msg)
}
break;
case K_Control_Left:
xscroll -= 2;
if (xscroll < 0) xscroll = 0;
xscroll-=2;
if (xscroll<0) xscroll=0;
dirtyview();
clearmsg(msg);
return;
case K_Control_Right:
xscroll += 2;
xscroll+=2;
dirtyview();
clearmsg(msg);
return;
Expand Down

0 comments on commit 9e121fd

Please sign in to comment.