Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • opensrc/zipr
  • whh8b/zipr
2 results
Show changes
Commits on Source (32)
......@@ -8,6 +8,7 @@ after_script:
stages:
- clean
- build
- protect_bins
- test
- deploy
......@@ -25,38 +26,28 @@ do-nightly-clean-ubuntu18:
<<: *do-nightly-clean
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
# per os items
do-nightly-clean-ubuntu16:
<<: *do-nightly-clean
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
# per os items
do-nightly-clean-centos76:
<<: *do-nightly-clean
tags:
- centos76
variables:
OS: 'centos76'
do-nightly-clean-arm32:
<<: *do-nightly-clean
tags:
- arm32
variables:
OS: 'arm32'
do-nightly-clean-arm64:
<<: *do-nightly-clean
tags:
- arm64
variables:
OS: 'arm64'
#
......@@ -74,36 +65,93 @@ do-build-ubuntu18:
<<: *do-build
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
do-build-ubuntu16:
<<: *do-build
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
do-build-centos76:
<<: *do-build
tags:
- centos76
variables:
OS: 'centos76'
do-build-arm32:
<<: *do-build
tags:
- arm32
variables:
OS: 'arm32'
do-build-arm64:
<<: *do-build
tags:
- arm64
variables:
OS: 'arm64'
#
# gather artifacts and ship them tox 86 boxes
#
.gather-bins: &do_gather
stage: build
script:
- ./cicd_testing/do-gather-bins.sh
artifacts:
expire_in: 1 day
paths:
- artifacts/
gather-bins-arm32:
<<: *do_gather
tags:
- arm32
gather-bins-arm64:
<<: *do_gather
tags:
- arm64
#
# gather artifacts and ship them tox 86 boxes
#
.protect-arm-bins: &prot_bins
stage: protect_bins
script:
- ./cicd_testing/do-prot-bins.sh
artifacts:
expire_in: 1 day
paths:
- artifacts/
protect-arm-ubuntu18:
<<: *prot_bins
tags:
- ubuntu18
protect-bins-ubuntu16:
<<: *prot_bins
tags:
- ubuntu16
#
# gather artifacts and ship them tox 86 boxes
#
.test_arm_bins: &test_arm_bins
stage: test
script:
- ./cicd_testing/do-test-bins.sh
artifacts:
expire_in: 1 day
paths:
- artifacts/
test-bins-arm32:
<<: *test_arm_bins
tags:
- arm32
test-bins-arm64:
<<: *test_arm_bins
tags:
- arm64
#
......@@ -151,8 +199,18 @@ builtin-xforms-centos76:
<<: *builtin-xforms
tags:
- centos76
variables:
OS: 'centos76'
# doesn't work yet
#builtin-xforms-arm32:
# <<: *builtin-xforms
# tags:
# - arm32
builtin-xforms-arm64:
<<: *builtin-xforms
tags:
- arm64
#
# elfdep test
......@@ -168,22 +226,16 @@ elfdep-ubuntu18:
<<: *elfdep
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
elfdep-ubuntu16:
<<: *elfdep
tags:
- ubuntu16
variables:
OS: 'ubuntu16'
elfdep-centos76:
<<: *elfdep
tags:
- centos76
variables:
OS: 'centos76'
......@@ -196,5 +248,3 @@ deploy-u18:
- ./cicd_testing/deploy.sh
tags:
- ubuntu18
variables:
OS: 'ubuntu18'
Subproject commit 44cfc100775e3d69f9b627e9d98d52b3ff797faa
Subproject commit 732a3a9b2c8d17f6f9f25048f921c3f36b6a071d
......@@ -5,5 +5,11 @@ set -x
cd /tmp/peasoup_test
source set_env_vars
cd $PEASOUP_HOME/tests
make clean;
./test_cmds.sh -c "fix_calls_rida fix_calls_ida" -l -a "bzip2 tcpdump"
if [[ $(uname -m) == 'armv7l' ]] || [[ $(uname -m) == 'aarch64' ]]; then
./test_cmds.sh -c "rida" -l -a "bzip2 ls"
else
./test_cmds.sh -c "rida fix_calls_rida fix_calls_ida" -l -a "bzip2 tcpdump"
fi
#/bin/bash
set -x
set -e
mkdir -p artifacts/test_binaries/
cp $(which ls) artifacts/test_binaries/ls.$(uname -m)
cp $(which bzip2) artifacts/test_binaries/bzip2.$(uname -m)
ls
#!/bin/bash
set -e
set -x
pushd /tmp/peasoup_test
source set_env_vars
popd
install_deps()
{
sudo apt-get install -y binutils-aarch64-linux-gnu
}
main()
{
install_deps
export PS_OBJDUMP=$(which aarch64-linux-gnu-objdump)
export PS_READELF=$(which aarch64-linux-gnu-readelf)
mkdir -p artifacts/protected_binaries
for i in $(ls artifacts/test_binaries/); do
$PSZ artifacts/test_binaries/$i artifacts/protected_binaries/$(basename $i.$(hostname))
done
}
main "$@"
#!/bin/bash
set -e
set -x
main()
{
for i in $(ls artifacts/protected_binaries/*$(uname -m)*); do
$i --help
done
}
main "$@"
#!/bin/bash
set -e
set -x
cd /tmp/peasoup_test
source set_env_vars
cd /tmp
rm -rf xxx ped_ls; $PSZ /bin/ls ./xxx -c rida=on -s meds_static=off --tempdir ped_ls || true
if [[ ! -x ./xxx ]]; then cat ped_ls/logs/*; fi
rm -rf ped_ls
./xxx
#/bin/bash
function main()
{
set -e
set -x
sudo apt-get install libunwind-dev -y
g++ unc.c -o unc.exe -lunwind
$PSZ unc.exe unc-zipr.exe --tempdir unc-temp
./unc.exe
./unc-zipr.exe
rm -rf unc.exe unc-zipr.exe unc-temp
}
main "$@"
#include <stdio.h>
#define UNW_LOCAL_ONLY
#include <libunwind.h>
void show_backtrace (void) {
unw_cursor_t cursor; unw_context_t uc;
unw_word_t ip, sp;
unw_getcontext(&uc);
unw_init_local(&cursor, &uc);
while (unw_step(&cursor) > 0) {
unw_get_reg(&cursor, UNW_REG_IP, &ip);
unw_get_reg(&cursor, UNW_REG_SP, &sp);
printf ("ip = %lx, sp = %lx\n", (long) ip, (long) sp);
}
}
int main()
{
show_backtrace();
return 0;
}
......@@ -3272,7 +3272,7 @@ void unpin_elf_tables(FileIR_t *firp, int64_t do_unpin_opt)
auto insn=lookupInstruction(firp,vo);
// OK for .got scoop to miss, some entries are empty.
if(scoop->getName()==".got" && insn==nullptr)
if(scoop->getName()==".got" && (vo==0 || insn==nullptr))
{
if(getenv("UNPIN_VERBOSE")!=0)
cout<<"Skipping "<<scoop->getName()<<" unpin for "<<hex<<vo<<" due to no instruction at vo"<<endl;
......
......@@ -74,14 +74,16 @@ class CreateFunctions_t
}
const auto cs_mode=
machine_type==mtAarch64 ? CS_MODE_LITTLE_ENDIAN :
file_class==ELF64 ? CS_MODE_64 :
file_class==ELF32 ? CS_MODE_32 :
machine_type == mtArm32 ? CS_MODE_LITTLE_ENDIAN :
machine_type == mtAarch64 ? CS_MODE_LITTLE_ENDIAN :
file_class == ELF64 ? CS_MODE_64 :
file_class == ELF32 ? CS_MODE_32 :
throw std::runtime_error("Cannot handle ELF class");
const auto my_cs_arch =
machine_type == mtX86_64 ? CS_ARCH_X86 :
machine_type == mtI386 ? CS_ARCH_X86 :
machine_type == mtX86_64 ? CS_ARCH_X86 :
machine_type == mtI386 ? CS_ARCH_X86 :
machine_type == mtArm32 ? CS_ARCH_ARM :
machine_type == mtAarch64 ? CS_ARCH_ARM64 :
throw std::runtime_error("Cannot handle architecture");
......@@ -233,7 +235,7 @@ class CreateFunctions_t
cout<<hex;
if(getenv("SELF_VALIDATE"))
assert(fdes->size()>0);
assert(fdes->size()>=0);
for(const auto fde : *fdes)
{
......@@ -393,7 +395,7 @@ class CreateFunctions_t
addName(i,dynsymEntryIndex++);
}
};
const auto handle_arm_plt=[&]()
const auto handle_arm64_plt=[&]()
{
const auto plt_entry_size=16;
const auto plt_header_size=8*4;
......@@ -405,6 +407,18 @@ class CreateFunctions_t
addName(i,dynsymEntryIndex++);
}
};
const auto handle_arm32_plt=[&]()
{
const auto plt_entry_size=3*4; // 3 instructions
const auto plt_header_size=5*4; // 5 instructions
addRange(startAddr,plt_header_size);
for(auto i=startAddr+plt_header_size; i<endAddr; i+=plt_entry_size)
{
addRange(i,plt_entry_size);
addName(i,dynsymEntryIndex++);
}
};
switch(machine_type)
{
......@@ -413,7 +427,10 @@ class CreateFunctions_t
handle_x86_plt();
break;
case mtAarch64:
handle_arm_plt();
handle_arm64_plt();
break;
case mtArm32:
handle_arm32_plt();
break;
default:
assert(0);
......@@ -510,7 +527,7 @@ class CreateFunctions_t
doBelongTos(scc);
}
if(getenv("SELF_VALIDATE"))
assert(sccs.size()>0);
assert(sccs.size()>=0);
}
string getUseFp(const RangeSet_t scc)
......
......@@ -222,7 +222,6 @@ set_step_option()
no_delim_option=`echo "$1" | cut -d: -f99999-`
if [[ ! -z $no_delim_option ]]; then
echo "Detected elided step option in $1"
set_step_option "$last_step_parsed:$no_delim_option"
return $?
fi
......