Skip to content

Commit 8027d2b

Browse files
committed
fixed plugin loading/unloading.
1 parent 16b7457 commit 8027d2b

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

Android.mk

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ include $(CLEAR_VARS)
1818
LOCAL_CFLAGS += -O2 -g -DHAVE_CONFIG_H -DOPENSSL_NO_DEPRECATED -ffunction-sections\
1919
-fdata-sections
2020

21-
LOCAL_LDFLAGS += -lz -Wl,--gc-sections
21+
LOCAL_LDFLAGS += -rdynamic -Wl,-export-dynamic -Wl,--no-gc-sections
2222

2323
LOCAL_C_INCLUDES := \
2424
$(LOCAL_PATH)/include \
@@ -170,7 +170,8 @@ LOCAL_STATIC_LIBRARIES:= \
170170

171171
LOCAL_SHARED_LIBRARIES:= \
172172
libssl\
173-
libcrypto
173+
libcrypto\
174+
libz
174175

175176
LOCAL_MODULE:= ettercap
176177

include/ec_resolv.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@ EC_API_EXTERN int host_iptoa(struct ip_addr *ip, char *name);
4646
/* used by ec_dns to insert passively sniffed dns answers */
4747
EC_API_EXTERN void resolv_cache_insert(struct ip_addr *ip, char *name);
4848

49-
49+
#if (defined(ANDROID) || defined(__BIONIC__)) && !defined(dn_comp)
50+
/* Android expose system __dn_comp from KitKat, not before */
51+
#define dn_comp __dn_comp
52+
extern int dn_comp(const char*, u_char*, int, u_char**, u_char**);
53+
extern int dn_expand(const u_char*, const u_char*, const u_char*, char*, int);
54+
#endif
5055

5156
#endif
5257

plug-ins/sslstrip/Android.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LOCAL_C_INCLUDES := $(ettercap_pl_includes)
1010

1111
LOCAL_SRC_FILES := sslstrip.c
1212

13-
LOCAL_STATIC_LIBRARIES := libcurl
13+
LOCAL_STATIC_LIBRARIES := libcurl libprce
1414

1515
LOCAL_MODULE := ec_sslstrip
1616

src/ec_plugins.c

+2
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ void plugin_unload_all(void)
222222
p = SLIST_FIRST(&plugin_head);
223223
if(plugin_is_activated(p->ops->name) == 1)
224224
plugin_fini(p->ops->name);
225+
#if !defined(ANDROID) && !defined(__BIONIC__)
225226
dlclose(p->handle);
227+
#endif
226228
SLIST_REMOVE_HEAD(&plugin_head, next);
227229
SAFE_FREE(p);
228230
}

0 commit comments

Comments
 (0)