Fix another bound for dex

This commit is contained in:
pancake 2021-05-11 23:41:47 +02:00
parent 9ad922df06
commit a8b13483af
3 changed files with 9 additions and 4 deletions

View File

@ -1623,7 +1623,7 @@ static bool dex_loadcode(RBinFile *bf) {
return false;
}
if (dex->header.method_size>dex->size) {
if (dex->header.method_size > dex->size) {
dex->header.method_size = 0;
return false;
}
@ -1658,8 +1658,8 @@ static bool dex_loadcode(RBinFile *bf) {
if (methods) {
int import_count = 0;
int sym_count = dex->methods_list->length;
for (i = 0; i < methods_size; i++) {
int last = (methods_size / sizeof(int)); // sym_count
for (i = 0; i < last; i++) {
int len = 0;
if (methods[i]) {
continue;

View File

@ -212,6 +212,10 @@ capstone: capstone-$(CS_VER).tar.gz
tar xzvf capstone-$(CS_VER).tar.gz
rm -rf capstone
mv capstone-$(CS_VER) capstone
$(MAKE) patch-capstone
# already implemented in capstone.sh
patch-capstone:
ifeq ($(CS_PATCHES),1)
if [ -d capstone/.git ]; then \
ifeq ($(USE_CS4),1)
@ -237,6 +241,7 @@ else
"$(SHELL)" capstone.sh "${CS_URL}" "${CS_BRA}" "${CS_TIP}" "${CS_REV}" "${CS_ARCHIVE_URL}"
endif
.PHONY: capstone capstone-sync
endif

View File

@ -31,7 +31,7 @@ patch_capstone() {
CV=v4
fi
for patchfile in ../capstone-patches/$CV/*.patch ; do
yes n | patch -p 1 -i "${patchfile}"
patch -p 1 < "${patchfile}"
done
}