InEnglish

Libgourou v0.8

Sunday, 11 September 2022
|
Écrit par
Grégory Soutadé

Reminder : Libgourou is a free ADEPT protocol implementation (from Adobe) that helps download ACSM files from Linux.

Good news, libgourou v0.8 is out now !

I missed to speak about it since v0.5 (april 2022), but a lot of work has been done :

  • Bug fixes, especially in PDF part
  • Qt has been replaced by libcurl (lighter & better display when downloading ePub)
  • Option to resume (big) downloads that may have failed
  • Manage loaned (and returnable) books
  • Migrate utils to OpenSSL 3
  • Integrate Base64 code into sources
  • Support for over encrypted private key when removing DRM (192 bytes keys)

Another improvement asked by a lot of people is the build of an AppImage. I don't really like it because it's big and you do not receive (security) updates from your package manager, but it allows to run on most of Linux platforms by embedding all necessary dependencies.

Gimp tutorial : Custom sepia tone effect

Sunday, 06 February 2022
|
Écrit par
Grégory Soutadé

Sepia filters were re popularized some years ago with instagram filters before disappear once again. It helps create some nice "old style" picture effects or simply for artistic pictures. Gimp offers a quick menu to change your picture into sepia colors. But I don't really agree with this filter as it's more N&B + dark yellow rather than red/brown/bronze tones. Here is a small and simple tutorial to get custom effect.

First, let's take a random picture from unsplash.com

Original picture

Then, we simply apply Gimp effect

Colors -> Desaturate -> Sepia

Gimp sepia effect

After that, we have to create a new transparent layer and select a red like color (195 / 22 / 22 for instance)

Fill created layer with this color and change mixing mode to "Hard light"

Select Mode -> Hard Light

Finally, play with opacity (here 30%)

Final result

Source color is a key parameter for effect tuning. It allows lighter or darker result. Opacity has also to be adjusted for each picture depending on original luminosity.

Another example with a darker color mask (108 / 19 / 19) and 50% opacity. We get something more brown and heavier :

Brown result

Libgourou v0.5

Sunday, 19 December 2021
|
Écrit par
Grégory Soutadé

Reminder : Libgourou is a free ADEPT protocol implementation (from Adobe) that helps download ACSM files from Linux.

It's Christmas soon. A time of heavy natural resources consumption, in all domains, because tradition and technological progress makes earth burning a bit more again and again. I suggest you to offer culture more than stupid and useless things.

And, what a good news, I have a gift for you ! Libgourou in version 0.5. It doesn't look like great as it's not the v1.0, but it's a big update. First versions were mainly bugfixes (plus PDF support) and I would like to tkank everyone who reported all that, more or less, stupid bugs. Reporting is not funny, but very useful for me and everybody.

So, my first intention when I created libgourou was not to support DRM removal but I saw a lot of people buying PDF (while I was focused on ePub). Using an eReader for reading PDF is not the best solution, big colored screens are so much better. After a long work in both libgourou and uPDFParser, you can now use the new adept_remove utility to remove DRM form ePub AND PDF ! Another good thing is the add of anonymous account support (no need to create or use your account from adobe.com). I recommend to use anonymous account only with a DRM removal software (like adept_remove), because the book will not be linked to your account and in case of failure, you'll have to buy/loan it once again.

I hope you'll enjoy this release. You can retrieve source code here or directly download pre compiled binaries (for Debian testing) here.

See you in 2022 !

Script : find shared library dependencies

Monday, 19 July 2021
|
Écrit par
Grégory Soutadé

While developping the reverse of Adobe's library libRMSDK.so, I needed a script to find all dependencies of this library and dependencies of dependencies. All of them must be copied into one folder in order to be packaged. So I wrote this script that parses recursively objdump's ouput. Here is the code :

#!/bin/bash

# Copyright Grégory Soutadé

# This is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with iwla.  If not, see <http://www.gnu.org/licenses/>.
#


#
# Find all dependant shared libraries of a target (using objdump) and copy them into a directory
#


# Options
TARGET=""
OUTPUT=""
ROOT_LIB_DIRECTORY=""
OBJDUMP=objdump
VERBOSE=0
EXIT_ON_ERROR=0
QUIET_NOT_FOUND=0
CLEAN_BEFORE_START=0
COPY_TARGET=0

function debug()
{
    if [ $VERBOSE -eq 1 ] ; then
    echo -e "$1"
    fi
}

function copy()
{
    target=$1
    symlink_name=$2

    if [ ! -e ${target} ] ; then
    debug "${target} not found"
    return
    fi

    debug "cp --no-dereference ${target} ${OUTPUT}"
    cp --no-dereference ${target} ${OUTPUT}

    if [ ! $? -eq 0 ] ; then
    [ ${EXIT_ON_ERROR} -eq 1 ] && exit 1
    return
    fi

    if [ ! -z "${symlink_name}" ] ; then
    echo ln -s `basename ${target}` ${OUTPUT}/${symlink_name}
    ln -s `basename ${target}` ${OUTPUT}/${symlink_name}
    fi

    # Symlink ? Copy target file
    if [ -L ${target} ] ; then
    copy `readlink -e ${target}`
    fi
}

nb_tabs=0
function find_lib()
{
    target="$1"

    if [ ! -e ${target} ] ; then
    debug "${target} not found"
    return
    fi

    nb_tabs=$((${nb_tabs}+1))
    local tabs=""
    for i in `seq 1 ${nb_tabs}`; do
    tabs="${tabs}  "
    done

    dependencies=`${OBJDUMP} -p ${target}|grep NEEDED|sed "s/ \+/ /g"|cut -d' ' -f3`
    for dependency in ${dependencies} ; do
    symlink_name=""
    echo -e "${tabs}${dependency}"
    debug "find ${ROOT_LIB_DIRECTORY} -name ${dependency}"
    file=`find ${ROOT_LIB_DIRECTORY} -name ${dependency}|head -n 1`
    if [ -z "$file" ] ; then
        # Try lib.so*
        file=`find ${ROOT_LIB_DIRECTORY} -name ${dependency}*|head -n 1`
        if [ -z "$file" ] ; then
        [ ${QUIET_NOT_FOUND} -eq 0 ] && echo "ERROR : ${dependency} not found in ${ROOT_LIB_DIRECTORY}"
        [ ${EXIT_ON_ERROR} -eq 1 ] && exit 1
        continue
        else
        symlink_name=${dependency}
        fi
    fi
    # Already copied
    [ -e "${OUTPUT}/${dependency}" ] && continue
    copy $file ${symlink_name}
    find_lib $file
    done

    nb_tabs=$((${nb_tabs}-1))
}

function usage()
{
    echo "Usage : ./find_libs [-O OBJDUMP] [-v] [-e] [-q] [-c] [-C] -t TARGET -o OUTPUT_DIR -l ROOT_LIBDIR"
    echo -e "\t-O OBJDUMP      objdump command"
    echo -e "\t-v              verbose"
    echo -e "\t-e              exit on error"
    echo -e "\t-q              quiet when dependency not found"
    echo -e "\t-c              clean target before start"
    echo -e "\t-C              Copy target in output directory"
    echo -e "\t-t TARGET       first executable or library to analyze"
    echo -e "\t-o OUTPUT_DIR   output directory where to place find libs"
    echo -e "\t-l ROOT_LIBDIR  root directory where to search dependancy libs"
}

while getopts "ht:o:l:O:veqcC" arg; do
    case $arg in
    t)
        TARGET=$OPTARG
        ;;
    o)
        OUTPUT=$OPTARG
        ;;
    l)
        ROOT_LIB_DIRECTORY=$OPTARG
        ;;
    O)
        OBJDUMP=$OPTARG
        ;;
    v)
        VERBOSE=1
        ;;
    e)
        EXIT_ON_ERROR=1
        ;;
    q)
        QUIET_NOT_FOUND=1
        ;;
    c)
        CLEAN_BEFORE_START=1
        ;;
    C)
        COPY_TARGET=1
        ;;
    h)
        usage
        ;;
    *)
        usage
        ;;
  esac
done

if [ -z "${TARGET}" -o -z "${OUTPUT}" -o -z "${ROOT_LIB_DIRECTORY}" ] ; then
    usage
    exit 0
fi

[ ${CLEAN_BEFORE_START} -eq 1 ] && rm -rf ${OUTPUT}

mkdir -p ${OUTPUT} || exit 1

echo ${TARGET}
[ ${COPY_TARGET} -eq 1 ] && copy ${TARGET}

find_lib ${TARGET}

A file version is available here

Libgourou : a Free ADEPT protocol implementation

Sunday, 04 July 2021
|
Écrit par
Grégory Soutadé

Two months ago I released a software that can use librmsdk.so from Adobe in order to retrieve ePub files (with Adobe DRM) from ACSM request files. It was the result of a long work of reverse engineering. The main problem with it is that it requires to run on an ARMv7 platform.

When I published it, I felt I can go further, but I was afraid of counter measures or cryptic algorithms that can be used by Adobe. Nevertheless, thanks to all knowledge acquired by my first reverse attempt I decided to try. In the end, Adobe choose to use standard algorithms with no obfuscation (maybe because it's delivered with a full SDK for clients). Plus, the target library wasn't compiled with code optimization \o/.

So I'm pleased to announce the first release of libgourou. It's a Free and Open Source implementation of ADEPT protocol. It supports :

  • Account signIn
  • Device activation
  • ePub download from ACSM request file

In addition to libgourou, two utils acsmdownloader and activate are provided in order to create a new device and download ePub from your favorite UNIX platform (like Linux x86/amd64 !) without any call to Adobe's code (no ADE, no WINE !).

Like RMSDK, it's based on a client/server model were the client has to implement some system specific functions (network, crypto...). It allows the library to be very portable (it's written in C++ 11).

The library by itself is licensed under LGPLv3 and the client (reference implementation) is under BSD license.

I can now tell it : we have a real alternative to ADE for Linux platforms !

Source are available on my forge

Basic usage

Basic usage of utils (you can use precompiled version). First, create a "device"

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD
./utils/adept_activate -u "AdobeID USERNAME"

Then a ./.adept directory is created with all configuration file

To download an ePub/PDF :

./utils/acsmdownloader -f <ACSM_FILE>