Last active
August 29, 2015 14:22
-
-
Save hackathi/5bc715c292a75e5eae3d to your computer and use it in GitHub Desktop.
libGee.External.Capstone.Proxy.so
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CC = gcc # C compiler | |
| CFLAGS = -DNOT_WIN -fPIC -Wall -Wextra -O2 -g # C flags | |
| LDFLAGS = -shared # linking flags | |
| RM = rm -f # rm command | |
| TARGET_LIB = libGee.External.Capstone.Proxy.so # target lib | |
| SRCS = proxy.c # source files | |
| OBJS = $(SRCS:.c=.o) | |
| .PHONY: all | |
| all: ${TARGET_LIB} | |
| $(TARGET_LIB): $(OBJS) | |
| $(CC) ${LDFLAGS} -o $@ $^ | |
| $(SRCS:.c=.d):%.d:%.c | |
| $(CC) $(CFLAGS) -MM $< >$@ | |
| include $(SRCS:.c=.d) | |
| .PHONY: clean | |
| clean: | |
| -${RM} ${TARGET_LIB} ${OBJS} $(SRCS:.c=.d) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <capstone.h> | |
| #if !defined(NOT_WIN) | |
| #define DLLFOO __declspec(dllexport) | |
| #else | |
| #define DLLFOO | |
| #endif | |
| #if !defined(NOT_WIN) | |
| extern "C" { | |
| #endif | |
| DLLFOO cs_arm* CapstoneArmDetail(cs_detail *detail) { | |
| return &detail->arm; | |
| } | |
| DLLFOO cs_arm64* CapstoneArm64Detail(cs_detail *detail) { | |
| return &detail->arm64; | |
| } | |
| DLLFOO cs_x86* CapstoneX86Detail(cs_detail *detail) { | |
| return &detail->x86; | |
| } | |
| #if !defined(NOT_WIN) | |
| } | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment