Preparing the API for more flexible code deassembly
This commit is contained in:
parent
c9fe4919cb
commit
14ca806803
1
Makefile
1
Makefile
@ -33,6 +33,7 @@ dist:
|
|||||||
$(PACKAGE)-$(VERSION)/include/project.conf \
|
$(PACKAGE)-$(VERSION)/include/project.conf \
|
||||||
$(PACKAGE)-$(VERSION)/include/Asm/arch.h \
|
$(PACKAGE)-$(VERSION)/include/Asm/arch.h \
|
||||||
$(PACKAGE)-$(VERSION)/include/Asm/asm.h \
|
$(PACKAGE)-$(VERSION)/include/Asm/asm.h \
|
||||||
|
$(PACKAGE)-$(VERSION)/include/Asm/common.h \
|
||||||
$(PACKAGE)-$(VERSION)/include/Asm/format.h \
|
$(PACKAGE)-$(VERSION)/include/Asm/format.h \
|
||||||
$(PACKAGE)-$(VERSION)/include/Asm/Makefile \
|
$(PACKAGE)-$(VERSION)/include/Asm/Makefile \
|
||||||
$(PACKAGE)-$(VERSION)/include/Asm/project.conf \
|
$(PACKAGE)-$(VERSION)/include/Asm/project.conf \
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
# define _LITTLE_ENDIAN __LITTLE_ENDIAN
|
# define _LITTLE_ENDIAN __LITTLE_ENDIAN
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
|
# include "Asm/common.h"
|
||||||
# include "Asm/arch.h"
|
# include "Asm/arch.h"
|
||||||
# include "Asm/asm.h"
|
# include "Asm/asm.h"
|
||||||
# include "Asm/format.h"
|
# include "Asm/format.h"
|
||||||
|
@ -19,11 +19,14 @@ install:
|
|||||||
$(MKDIR) $(DESTDIR)$(PREFIX)/include/Devel/Asm
|
$(MKDIR) $(DESTDIR)$(PREFIX)/include/Devel/Asm
|
||||||
$(INSTALL) -m 0644 -- asm.h $(DESTDIR)$(PREFIX)/include/Devel/Asm/asm.h
|
$(INSTALL) -m 0644 -- asm.h $(DESTDIR)$(PREFIX)/include/Devel/Asm/asm.h
|
||||||
$(MKDIR) $(DESTDIR)$(PREFIX)/include/Devel/Asm
|
$(MKDIR) $(DESTDIR)$(PREFIX)/include/Devel/Asm
|
||||||
|
$(INSTALL) -m 0644 -- common.h $(DESTDIR)$(PREFIX)/include/Devel/Asm/common.h
|
||||||
|
$(MKDIR) $(DESTDIR)$(PREFIX)/include/Devel/Asm
|
||||||
$(INSTALL) -m 0644 -- format.h $(DESTDIR)$(PREFIX)/include/Devel/Asm/format.h
|
$(INSTALL) -m 0644 -- format.h $(DESTDIR)$(PREFIX)/include/Devel/Asm/format.h
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
$(RM) -- $(DESTDIR)$(PREFIX)/include/Devel/Asm/arch.h
|
$(RM) -- $(DESTDIR)$(PREFIX)/include/Devel/Asm/arch.h
|
||||||
$(RM) -- $(DESTDIR)$(PREFIX)/include/Devel/Asm/asm.h
|
$(RM) -- $(DESTDIR)$(PREFIX)/include/Devel/Asm/asm.h
|
||||||
|
$(RM) -- $(DESTDIR)$(PREFIX)/include/Devel/Asm/common.h
|
||||||
$(RM) -- $(DESTDIR)$(PREFIX)/include/Devel/Asm/format.h
|
$(RM) -- $(DESTDIR)$(PREFIX)/include/Devel/Asm/format.h
|
||||||
|
|
||||||
.PHONY: all clean distclean install uninstall
|
.PHONY: all clean distclean install uninstall
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#ifndef DEVEL_ASM_ASM_H
|
#ifndef DEVEL_ASM_ASM_H
|
||||||
# define DEVEL_ASM_ASM_H
|
# define DEVEL_ASM_ASM_H
|
||||||
|
|
||||||
# include <sys/types.h>
|
# include "common.h"
|
||||||
|
|
||||||
|
|
||||||
/* Asm */
|
/* Asm */
|
||||||
@ -31,30 +31,6 @@ typedef struct _AsmPrefs
|
|||||||
size_t defines_cnt;
|
size_t defines_cnt;
|
||||||
} AsmPrefs;
|
} AsmPrefs;
|
||||||
|
|
||||||
typedef unsigned int AsmId;
|
|
||||||
|
|
||||||
typedef struct _AsmFunction
|
|
||||||
{
|
|
||||||
AsmId id;
|
|
||||||
char const * name;
|
|
||||||
off_t offset;
|
|
||||||
ssize_t size;
|
|
||||||
} AsmFunction;
|
|
||||||
|
|
||||||
typedef struct _AsmLabel
|
|
||||||
{
|
|
||||||
char const * name;
|
|
||||||
off_t offset;
|
|
||||||
} AsmLabel;
|
|
||||||
|
|
||||||
typedef struct _AsmString
|
|
||||||
{
|
|
||||||
int id;
|
|
||||||
char const * name;
|
|
||||||
off_t offset;
|
|
||||||
ssize_t length;
|
|
||||||
} AsmString;
|
|
||||||
|
|
||||||
typedef enum _AsmPluginType { APT_ARCH = 0, APT_FORMAT } AsmPluginType;
|
typedef enum _AsmPluginType { APT_ARCH = 0, APT_FORMAT } AsmPluginType;
|
||||||
|
|
||||||
|
|
||||||
|
50
include/Asm/common.h
Normal file
50
include/Asm/common.h
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
/* Copyright (c) 2011 Pierre Pronchery <khorben@defora.org> */
|
||||||
|
/* This file is part of DeforaOS Devel asm */
|
||||||
|
/* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3 of the License.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef DEVEL_ASM_COMMON_H
|
||||||
|
# define DEVEL_ASM_COMMON_H
|
||||||
|
|
||||||
|
# include <sys/types.h>
|
||||||
|
|
||||||
|
|
||||||
|
/* common */
|
||||||
|
/* types */
|
||||||
|
typedef unsigned int AsmId;
|
||||||
|
|
||||||
|
typedef struct _AsmFunction
|
||||||
|
{
|
||||||
|
AsmId id;
|
||||||
|
char const * name;
|
||||||
|
off_t offset;
|
||||||
|
ssize_t size;
|
||||||
|
} AsmFunction;
|
||||||
|
|
||||||
|
typedef struct _AsmLabel
|
||||||
|
{
|
||||||
|
char const * name;
|
||||||
|
off_t offset;
|
||||||
|
} AsmLabel;
|
||||||
|
|
||||||
|
typedef struct _AsmString
|
||||||
|
{
|
||||||
|
int id;
|
||||||
|
char const * name;
|
||||||
|
off_t offset;
|
||||||
|
ssize_t length;
|
||||||
|
} AsmString;
|
||||||
|
|
||||||
|
#endif /* !DEVEL_ASM_AS_H */
|
@ -1,4 +1,4 @@
|
|||||||
includes=arch.h,asm.h,format.h
|
includes=arch.h,asm.h,common.h,format.h
|
||||||
dist=Makefile
|
dist=Makefile
|
||||||
|
|
||||||
[arch.h]
|
[arch.h]
|
||||||
@ -7,5 +7,8 @@ install=$(PREFIX)/include/Devel/Asm
|
|||||||
[asm.h]
|
[asm.h]
|
||||||
install=$(PREFIX)/include/Devel/Asm
|
install=$(PREFIX)/include/Devel/Asm
|
||||||
|
|
||||||
|
[common.h]
|
||||||
|
install=$(PREFIX)/include/Devel/Asm
|
||||||
|
|
||||||
[format.h]
|
[format.h]
|
||||||
install=$(PREFIX)/include/Devel/Asm
|
install=$(PREFIX)/include/Devel/Asm
|
||||||
|
Loading…
Reference in New Issue
Block a user