#!/usr/bin/python3.8
from sys import argv
from sys import stdin
from math import gcd

def dd(in_f, out_f, count, skip):
	count = int(count, 0)
	skip = int(skip, 0)
	bs = gcd(count, skip)
	count /= bs
	skip /= bs
	count = int(count)
	skip = int(skip)
	print(f"adb shell su -c 'dd {bs=} {count=} {skip=} if={in_f} of={out_f}'")

for line in stdin:
	name, size, start, type, mapto = line.split()
	dd(mapto, f'/data/media/0/emmc/{name}', size, start)

print('adb pull /data/media/0/emmc/')
