library lib1.so when the program is started (List 1 ):
./lib1.so(_ZNSt6vectorIiSaIiEED1Ev+0x60)[0xe8850c]
When the program ends, the Runtime library glibc detects that the shared library lib2.so parses objects not constructed by it, resulting in core dump.
In this case, if the option-fpie or-fpie is replaced, the operation steps and running results are as follows:
Listing 8. Option-
uboot handle these situations? More accurately, how should compiler and uboot work together to deal with these situations?
The PIC location-independent code is used here, which is generated by specifying the compilation option-FPIC or-fpie for the compiler,In this way, the target file generated by compilation contains the information required by the PIC.-FPIC and-fpie are the PIC compilation options of GCC
, only the data segments of the shared library are loaded in their own process, and the code snippets can be shared.Introduction to how PIE worksWe start with practical examples to observe the difference between pie and No-pie in the performance of executable programs. Glimpse explores the implementation principle of address-independent code.Example OneDefine the following C code:#include int global;void main(){ printf("global address = %x\n", global);}A global variable is defined in the prog
try again, iter=13.after sleep 1s, I [tid=1098918208] Want To try again, iter=14.after sleep 1s, I [tid=1098918208] want to try again, iter=15.after sleep 1s, I [tid=1098918208] wa NT to try again, iter=16.after sleep 1s, I [tid=1098918208] want to try again, iter=17.after sleep 1s, i [tid=1098918208] Want to try again, iter=18.after sleep 1s, I [tid=1098918208] want to try again, iter=19.it are my[tid=1098918208] turn, so Long I Waited...msg=unblockAndroid Runandroid compile and run Pt_lock r
stack pointer, addr for uboot start address. Set the baud rate,Set the DRAM address address and size, set the Uboot relocation address to addr, the starting stack pointer is addr_sp, set the relocation offset, the GD data from the current R9 copy to the new GD space.3, set the new GD address to R9, calculate relocation after the address of here is saved in LR, so that after performing relocate_code for Uboot relocation after the return, jump directly to the relocation uboot continue execution.S
first step, installation
1. Download vsftpd.tar.gz from https://security.appspot.com/vsftpd.html;
2. Execute the following command:
TAR-ZXVF vsftpd-xx.tar.gz
CD vsftpd-xx
3. Edit the Makefile file and edit the results as follows:
# Makefile for systems with GNU tools CC = gcc install = Install IFlags =-idirafter Dummyinc #CFLAGS = -G CFLAGS =-o2-fpie-fstack-protector--param=ssp-buffer-size=4 \-wall-w-wshadow-werror-wformat-secu rity \-d_fort
First of all, you have to have the NDK (Wood has its own search)/home/xxxx/tools/android-ndk-r12bPrepare your HelloWorld program source code:#include int main (void) { printf ("Hello world!\n " ); return 0 ;}Compile it: ~/tools/android-ndk-r12b/toolchains/aarch64-linux-android-4.9 / Prebuilt/linux-x86_64/bin/aarch64-linux-android-gcc-o Hello hello.c-pie-fpie-i/home/xxxx/tools/android-ndk-r12b/ Platforms/android-24 /arch-arm64/usr/include-l/home/xxx
The nginx-rtmp-module source code.
1 sudo wget https://github.com/arut/nginx-rtmp-module/archive/master.zip
Because nginx-rtmp-module has been open source on GitHub, you can also get it directly from GitHub. GitHub address: https://github.com/arut/nginx-rtmp-module.
6. decompress the nginx-rtmp-module source code package.
1 sudo unzip master.zip
7. Go to the nginx source code directory.
1 cd nginx-1.10.0/
8. view the current nginx configuration information and save the current configuration inf
difficulty of debugging an attacker. But the executable itself has a fixed starting address in most cases, which makes it easier for attackers to do so. But there is still a way to make this address random, which is pie (Position Independent executable), which compiles the binary into a location-independent file, but the kernel completes the location-independent randomization process. So this feature requires kernel support. And there is a need for location-independent, that is, dynamic librari
1. Modify the build-libpcap.sh libpcap version number2. Perform a script compilationA problem occurred:2. After discovering configure, there is a problem with makefileThe actual configure-arch armv7s version does not know why the error occurred.Remove part of red boxMake-j2 make InstallPass!3. Attach Configure./configure--disable-shared--enable-static --with-pcap=bpf--enable-ipv6--host arm-apple-darwin--prefix= /users/chulk/pcap/build/built/iphoneos8. 2-armv7s.sdk cc=/applications/xcode.app/con
followsFinally, I'll mention one of the projects that I just learned. How to compile multiple so files---hook---android.mk---application.mk---hook_d------ ANDROID.MK------MAIN.C---hook_so------android.mk------main.c Take the file structure above as an exampleHook/androi.mkInclude $ (call All-subdir-makefiles)Hook/hook_d/android.mkLocal_path: = $ (call my-dir+ =-pie- fpie+ =-pie-fpie-llogtarget_platfor
ARM Architecture C Language addressing resolution--Exploration from the U-boot relocation (II.)
by LazycatdesignWww.lazycatdesign.com
The analysis of ARM architecture C-language pic addressing mode
As mentioned in the preceding article, can you produce a code that runs in any address section? Yes, it's called Position-independent Code, or PIC (Windows Dll,linux Share Object, both of which are typical pic files). So how to produce pic? Can be generated by specifying compilation options for the
way, there are almost 1 GB of space (accurately TASK_SIZE/3-code segment Data segment, see AR Definition of Ch/x86/include/asm/processor.h) "4"5, the data section, mainly in the process initialization and uninitialized global data sum, of course, compiler generated some auxiliary data structure, and so on, the size depends on the specific process, its position is close to the code snippet.6, the code snippet, mainly is the process instruction, including the user code and the compiler generates
Since the NDK-compiled executables are called in the app, there has been no problem with versions 4.4 and earlier. Recently due to the test run on Android L found that when running the executable file, the following error was reported: Error:only position independent executables (PIE) is supported. The security mechanism for PIE was introduced from 4.1, but the system version before Android L did not verify that the executable was compiled based on PIE. So there is no error. However, Android L h
Tags: bin command top TAC process bit desktop Targe libcAccording to the data, the following conclusions are drawn for the time being:First of all, ASLR is the operating system's functional option for executable (ELF) load memory runtime, thus only the base address of the stack, heap, libraries is randomized, and Pie (Position Independent Executables) is a compiler (GCC,.. ) feature option (-fpie), which is used for the excutable compilation process,
Default User path:/USR/BIN:/BIN:/USR/SB
In:/sbin:/usr/local/bin manpage Format:doc PAM support:no OSF SIA support:no kerberosv support:no SELinux support:no SMARTCA Rd Support:s/key support:no MD5 password Support:no libedit Ort:no Solaris Process contract Support:no Solaris project Support:no Solaris Privilege Support: No IP address in$DISPLAY hack:no Translate v4 in V6 hack:no BSD Auth support:no Random Numbe
R Source:openssl Internal only privsep sandbox Style:da
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.