1

I am creating a PoC for anti-disassembly techniques, and I would like to know if there were ways to define the address of functions once compiled with gcc.

Here is the PoC program :

BITS 32
EXTERN puts
SECTION .data
    chaine      db "Hello world !", 0

SECTION .text
    GLOBAL main

    I_Want_to_control_this_func_addr:
    ret

    main:
    push chaine
    ; xor eax, eax
   jz beer+1
beer:
   db 0xe8
    add al, 3
    add al, 8
    pop eax
    ret

I would like the function to have the address 0x08040309.

I am compiling with : nasm -f elf test.asm; gcc -m32 -o test test.o

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.