예제 #1
0
def unpack_function(file_path, tmp_dir):
    '''
    file_path specifies the input file.
    tmp_dir should be used to store the extracted files.
    '''
    output = execute_shell_command(
        '(cd {} && fakeroot {} --extract {})'.format(tmp_dir, TOOL_PATH,
                                                     file_path))
    return {'output': output}
예제 #2
0
def unpack_function(file_path, tmp_dir):
    '''
    file_path specifies the input file.
    local_tmp_dir should be used to store the extracted files.
    '''
    output = execute_shell_command(
        'fakeroot ubireader_extract_files -v --output-dir {} {}'.format(
            tmp_dir, file_path)) + '\n'

    meta_data = {'output': output}
    logging.debug(output)
    return meta_data
예제 #3
0
파일: untrx.py 프로젝트: xuacker/FACT_core
def _unpack_trx(file_path, target_dir):
    path_to_unpacker = path.join(get_faf_bin_dir(), 'untrx')
    return execute_shell_command('fakeroot {} {} {}'.format(path_to_unpacker, file_path, target_dir))
예제 #4
0
def _extract_kernel_image(file_path, tmp_dir):
    return execute_shell_command('{} {} {}/kernel_decompressed.img'.format(UNPACK_KERNEL_TOOL_PATH, file_path, tmp_dir))
예제 #5
0
def _extract_squashfs(file_path, tmp_dir):
    return execute_shell_command('cd {} && {} {}'.format(tmp_dir, FIND_SQUASHFS_TOOL_PATH, file_path))
예제 #6
0
def _unpack_trx(file_path, target_dir):
    return execute_shell_command('fakeroot {} {} {}'.format(
        UNPACKER_EXECUTEABLE, file_path, target_dir))