Hi all,
I've just got my hands on the source code for the Buzz kernel and thought it would be a good starting point to build it from source without any changes.
I've got my cross-compile environment nicely set up, however, when building, I am halting at:
make[1]: *** No rule to make target `arch/arm/mach-msm/board-bee.o', needed by `arch/arm/mach-msm/built-in.o'. Stop.
This seems to be due to a problem in the Makefile:
Code:
# MSM7225 boards
obj-$(CONFIG_MACH_BUZZ) += board-buzz.o board-buzz-panel.o board-buzz-keypad.o board-buzz-microp.o
obj-$(CONFIG_MACH_BUZZ) += board-buzz-rfkill.o board-buzz-mmc.o board-buzz-wifi.o
obj-$(CONFIG_HTC_OFFMODE_CHARGING) += htc_offmode_charging.o
obj-$(CONFIG_MACH_BEE) += board-bee.o board-bee-panel.o board-bee-keypad.o board-bee-microp.o
obj-$(CONFIG_MACH_BEE) += board-bee-rfkill.o board-bee-mmc.o board-bee-wifi.o
obj-$(CONFIG_MACH_BUZZC) += board-buzzc.o board-buzzc-panel.o board-buzzc-keypad.o board-buzzc-microp.o
obj-$(CONFIG_MACH_BUZZC) += board-buzzc-rfkill.o board-buzzc-mmc.o board-buzzc-wifi.o
obj-$(CONFIG_MACH_PARADISE) += board-paradise.o board-paradise-panel.o board-paradise-keypad.o
obj-$(CONFIG_MACH_PARADISE) += board-paradise-rfkill.o board-paradise-wifi.o
obj-$(CONFIG_MACH_PARADISE) += board-paradise-mmc.o board-paradise-microp.o
obj-$(CONFIG_MACH_BAHAMAS) += board-bahamas.o board-click-panel.o board-bahamas-keypad.o
obj-$(CONFIG_MACH_BAHAMAS) += board-bahamas-mmc.o board-bahamas-rfkill.o
QUESTION 1: board-bee, board-bahamas and board-paradise are not included suffixes for the various boards in the kernel distribution; is the recommended course of action to remove these from the Makefile (as I am intending this kernel purely for Buzz)?
Doing so allows me to complete the build process.
The next step I am taking is to pack this into a boot.img file following the steps at: http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack,_Edit,_and_Re-Pack_Boot_Images
I'm using:
Code:
~/eclair/out/host/linux-x86/bin/mkbootimg --cmdline 'no_console_suspend=1 console=null' --kernel ./boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz -o boot-new.img
where ./boot-img-kernel is the zImage file at arch/arm/boot/
The ramdisk is exactly as I extracted from the device originally.
Finally, in recovery mode (clockworkmod) I executed:
Code:
# cat /dev/zero > /dev/mtd/mtd2
# flash_image boot /sdcard/boot-new.img
# reboot
However, on reboot the device never comes up and, obviously, I can therefore get no meaningful info from adb.
Booting the kernel in an emulator results in:
Command:
Code:
~/android-sdk-linux_86/tools/emulator -kernel ~/Desktop/buzz-2.6.29-534e5f81/arch/arm/boot/zImage -avd 2.1 -show-kernel -verbose -logcat *:v
Output:
Code:
emulator: found SDK root at /home/martin/android-sdk-linux_86
emulator: root virtual device file at /home/martin/.android/avd/2.1.ini
emulator: virtual device content at /home/martin/.android/avd/2.1.avd
emulator: virtual device config file: /home/martin/.android/avd/2.1.avd/config.ini
emulator: locking user data image at /home/martin/.android/avd/2.1.avd/userdata-qemu.img
emulator: locking cache image at /home/martin/.android/avd/2.1.avd/cache.img
emulator: locking SD Card image at /home/martin/.android/avd/2.1.avd/sdcard.img
emulator: found skin 'HVGA' in directory: /home/martin/android-sdk-linux_86/platforms/android-7/skins
emulator: autoconfig: -skin HVGA
emulator: autoconfig: -skindir /home/martin/android-sdk-linux_86/platforms/android-7/skins
emulator: keyset loaded from: /home/martin/.android/default.keyset
emulator: trying to load skin file '/home/martin/android-sdk-linux_86/platforms/android-7/skins/HVGA/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: registered 'boot-properties' qemud service
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'qemu.sf.lcd_density' = '160'
emulator: Adding boot property: 'dalvik.vm.heapsize' = '16m'
emulator: argv[00] = "/home/martin/android-sdk-linux_86/tools/emulator"
emulator: argv[01] = "-kernel"
emulator: argv[02] = "/home/martin/Desktop/buzz-2.6.29-534e5f81/arch/arm/boot/zImage"
emulator: argv[03] = "-initrd"
emulator: argv[04] = "/home/martin/android-sdk-linux_86/platforms/android-7/images//ramdisk.img"
emulator: argv[05] = "-nand"
emulator: argv[06] = "system,size=0x4a00000,initfile=/home/martin/android-sdk-linux_86/platforms/android-7/images//system.img"
emulator: argv[07] = "-nand"
emulator: argv[08] = "userdata,size=0x4200000,file=/home/martin/.android/avd/2.1.avd/userdata-qemu.img"
emulator: argv[09] = "-nand"
emulator: argv[10] = "cache,size=0x4200000,file=/home/martin/.android/avd/2.1.avd/cache.img"
emulator: argv[11] = "-hda"
emulator: argv[12] = "/home/martin/.android/avd/2.1.avd/sdcard.img"
emulator: argv[13] = "-serial"
emulator: argv[14] = "android-kmsg"
emulator: argv[15] = "-serial"
emulator: argv[16] = "stdio"
emulator: argv[17] = "-serial"
emulator: argv[18] = "android-qemud"
emulator: argv[19] = "-append"
emulator: argv[20] = "qemu=1 console=ttyS0 androidboot.console=ttyS1 android.checkjni=1 androidboot.logcat=*:v android.qemud=ttyS2 android.ndns=2"
emulator: argv[21] = "-m"
emulator: argv[22] = "96"
emulator: argv[23] = "-clock"
emulator: argv[24] = "unix"
emulator: mapping 'system' NAND image to /tmp/android/emulator-lc0c1q
emulator: rounding devsize up to a full eraseunit, now 4a1f000
emulator: using 'esd' audio input backend
emulator: using 'esd' audio output backend
emulator: Trace file name is not set
emulator: control console listening on port 5554, ADB on port 5555
emulator: sent '0012host:emulator:5555' to ADB server
emulator: ping program: /home/martin/android-sdk-linux_86/tools/ddms
emulator: ping command: /home/martin/android-sdk-linux_86/tools/ddms ping emulator 6.0
It then hangs at this point.
QUESTION 2: What am I doing wrong? Could this be related to the removed lines above? (seems unlikely as Buzz should be the only configuration being used)
I've attached a zip file that contains the compiled kernel and boot.img files if anybody found a minute or two to look.
Many thanks in advance and best wishes,
Martin
Can you post your .config? I'll take a look. I don't have a device to test with, but I don't mind testing the compiling part.
Hi,
Many thanks for the offer; I have since got this working.
It seemed to be due to the wrong offset when packing for the Wildfire (the correct offset I have now posted in the dev forum there).
It is fine to remove the non-included board- references
Best
Martin
MartinEve said:
Hi,
Many thanks for the offer; I have since got this working.
It seemed to be due to the wrong offset when packing for the Wildfire (the correct offset I have now posted in the dev forum there).
It is fine to remove the non-included board- references
Best
Martin
Click to expand...
Click to collapse
Cool beans. In the mean time, I took a few minutes and worked out one of the scripts needed to add the buzz to Android Builder.
ab_get_Buzz.29
clear
if [ ! -d $KITCHEN_ROOT/source/kernels/buzz/2.6.29/ ]
then
mkdir -p $KITCHEN_ROOT/source/kernels/buzz/2.6.29
cd $KITCHEN_ROOT/source/kernels/buzz/2.6.29
echo "Downloading Buzz 2.6.29 kernel source code"
wget http://member.america.htc.com/download/RomCode/Source_and_Binaries/buzz-2.6.29-534e5f81.tar.gz
tar xvzf buzz-2.6.29-534e5f81.tar.gz
cp -r buzz-2.6.29-534e5f81/* $KITCHEN_ROOT/source/kernels/buzz/2.6.29/
rm -r buzz-2.6.29-534e5f81/
rm buzz-2.6.29-534e5f81.t*
fi
Related
Hi,
I need to get the default gateway of a device on my application. I am coding in native application in android. Here is my current code to get the default gateway.
Code:
static int get_default_gateway(char *def_gateway, int buf_size)
{
FILE* pipe;
char buffer[128];
char result[2049];
char cmd[] = "netstat -r | grep ^default | awk '{print $2}'";
pipe = popen(cmd, "r");
if (!pipe) return 1;
memset(result, 0, sizeof(result));
while(!feof(pipe)) {
memset(buffer, 0, sizeof(buffer));
if(fgets(buffer, 128, pipe) != NULL)
{
strcat(result, buffer);
}
}
pclose(pipe);
memset(def_gateway, 0, buf_size);
strncpy (def_gateway, result, buf_size );
return 0;
}
It works on my LG p500 but on some devices it doesn't return anything.
My question is this. Does popen() works on android? I read somewhere that it is not included in bionic.
And is there any other method to get the default gateway? I need it to be written in C and not java.
Thank you
I think I found the problem. Maybe grep and awk is not working on their phone. Its working on my phone since I created links to awk and grep to busybox.
Can someone confirm this if awk and grep is not working on a stock rom without creating links to busybox?
Thanks
On a stock ROM there is no busybox too. There is toolbox instead and it does not support much commands. When I first ran a shell on Android, was unpleasantly surprised when I didn't find some things like 'find' and 'grep' on a "Linux-based OS".
Here is complete list of the links to the toolbox on the Android 2.2 emulator: cat chmod chown cmp date dd df dmesg getevent getprop hd id ifconfig iftop insmod ioctl ionice kill ln log ls lsmod mkdir mount mv nandread netstat newfs_msdos notify printenv ps reboot renice rm rmdir rmmod route schedtop sendevent setconsole setprop sleep smd start stop sync top umount vmstat watchprops wipe. On my HTC Wildfire (with a stock Android 2.2.1) there is almost the same. The only difference is: reboot on HTC is a separate binary and there is additional link to toolbox here - strange chownto command.
praetorian droid said:
On a stock ROM there is no busybox too. There is toolbox instead and it does not support much commands. When I first ran a shell on Android, was unpleasantly surprised when I didn't find some things like 'find' and 'grep' on a "Linux-based OS".
Here is complete list of the links to the toolbox on the Android 2.2 emulator: cat chmod chown cmp date dd df dmesg getevent getprop hd id ifconfig iftop insmod ioctl ionice kill ln log ls lsmod mkdir mount mv nandread netstat newfs_msdos notify printenv ps reboot renice rm rmdir rmmod route schedtop sendevent setconsole setprop sleep smd start stop sync top umount vmstat watchprops wipe. On my HTC Wildfire (with a stock Android 2.2.1) there is almost the same. The only difference is: reboot on HTC is a separate binary and there is additional link to toolbox here - strange chownto command.
Click to expand...
Click to collapse
Thanks for posting the complete list of commands
Listed commands are only those that implemented by 'toolbox'. There are also some more: for example sh, gzip, ping and others. You can see them all by doing
Code:
ls /sbin /system/bin /system/xbin
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
hi ,
I am working on my project for android kernel module development i am getting error
like
insmod: init_module 'hello.ko' failed (Exec format error) in android
after performing all process as described below
First we must retrieve and copy the kernel config from our device.
$ cd /path/to/android-sdk/tools
$ ./adk pull /proc/config.gz
$ gunzip ./config.gz
$ cp config /path/to/kernel/.config
changed config file as
CONFIG_MODULES=y
then current config is like this
CONFIG_MODULES=y
CONFIG_MODULE_FORCE_LOAD=y
CONFIG_MODULE_UNLOAD=y
CONFIG_MODULE_FORCE_UNLOAD=y
CONFIG_MODVERSIONS=y
CONFIG_MODULE_SRCVERSION_ALL=y
Next we have to prepare our kernel source for our module.
$ cd /path/to/kernel
$ export ARCH=arm
$ export CROSS_COMPILE=/path/to/android-ndk/toolchains/arm-eabi-4.4.3/prebuilt/linux-x86/bin/arm-eabi-
$ make
then zimage is created and loaded it into emulator succefully.
PREPARING MODULE FOR COMPILATION
i created a Makefile to cross-compile our kernel module. The contents of your Makefile is:
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 29
EXTRAVERSION = -00054-gef9c64a
obj-m += hello.o
KDIR=~/Sukha_android/goldfish/
PWD := $(shell pwd)
default:
make -C $(KDIR) ARCH=arm CROSS_COMPILE=~/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- SUBDIRS=$(PWD) modules
clean:
make -C $(KDIR) ARCH=arm CROSS_COMPILE=~/android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi- SUBDIRS=$(PWD) clean
My Hello.c is :
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("suhas, 2012");
MODULE_DESCRIPTION("Demo module");
int init_module(void)
{
printk("<1>Hello world\n");
return 0;
}
void cleanup_module(void)
{
printk(KERN_ALERT "Goodbye world 1.\n");
}
COMPILING AND INSTALLING MODULE
$ cd /path/to/module/src
$ make
$ cd /path/to/android-sdk/tools/
$ ./adb push /path/to/module/src/hello.ko /data
RUNNING YOUR MODULE
$ cd /path/to/android-sdk/
$ ./adb shell
$ su
# insmod /data/hello.ko
then getting error
insmod: init_module 'hello.ko' failed (Exec format error) in android
after :
dmesg:
unknown relocation: 27 when insmod
occured please help me i ts very important for me.
Regards,
Suhas
I guess it should be a ".so" file and not ".ko"..
Sent from my GT-S5830 using Tapatalk
suhascomp.143 said:
dmesg:
unknown relocation: 27 when insmod
Click to expand...
Click to collapse
Try to add EXTRA_CFLAGS=-fno-pic compilation option inside your mod makefile.
Hi!
i'm trying to use my custom kernel on avd, when i launch
Code:
./emulator -avd sgsp40 -kernel /home/rmbq/zImage -show-kernel -verbose
the output is:
Code:
emulator: found SDK root at /home/rmbq/android-sdk-linux
emulator: Android virtual device file at: /home/rmbq/.android/avd/sgsp40.ini
emulator: virtual device content at /home/rmbq/.android/avd/sgsp40.avd
emulator: virtual device config file: /home/rmbq/.android/avd/sgsp40.avd/config.ini
emulator: using core hw config path: /home/rmbq/.android/avd/sgsp40.avd/hardware-qemu.ini
emulator: Found AVD target API level: 15
emulator: found skin 'WVGA800' in directory: /home/rmbq/android-sdk-linux/platforms/android-15/skins
emulator: autoconfig: -skin WVGA800
emulator: autoconfig: -skindir /home/rmbq/android-sdk-linux/platforms/android-15/skins
emulator: found skin-specific hardware.ini: /home/rmbq/android-sdk-linux/platforms/android-15/skins/WVGA800/hardware.ini
emulator: keyset loaded from: /home/rmbq/.android/default.keyset
emulator: trying to load skin file '/home/rmbq/android-sdk-linux/platforms/android-15/skins/WVGA800/layout'
emulator: skin network speed: 'full'
emulator: skin network delay: 'none'
emulator: autoconfig: -ramdisk /home/rmbq/android-sdk-linux/system-images/android-15/armeabi-v7a//ramdisk.img
emulator: Using initial system image: /home/rmbq/android-sdk-linux/system-images/android-15/armeabi-v7a//system.img
emulator: autoconfig: -data /home/rmbq/.android/avd/sgsp40.avd/userdata-qemu.img
emulator: autoconfig: -initdata /home/rmbq/.android/avd/sgsp40.avd/userdata.img
emulator: autoconfig: -cache /home/rmbq/.android/avd/sgsp40.avd/cache.img
emulator: Physical RAM size: 512MB
Content of hardware configuration file:
hw.cpu.arch = arm
hw.cpu.model = cortex-a8
hw.ramSize = 512
hw.screen = touch
hw.mainKeys = yes
hw.trackBall = yes
hw.keyboard = no
hw.keyboard.lid = no
hw.keyboard.charmap = qwerty2
hw.dPad = yes
hw.gsmModem = yes
hw.gps = yes
hw.battery = yes
hw.accelerometer = yes
hw.audioInput = yes
hw.audioOutput = yes
hw.sdCard = yes
disk.cachePartition = yes
disk.cachePartition.path = /home/rmbq/.android/avd/sgsp40.avd/cache.img
disk.cachePartition.size = 66m
hw.lcd.width = 480
hw.lcd.height = 800
hw.lcd.depth = 16
hw.lcd.density = 240
hw.lcd.backlight = yes
hw.gpu.enabled = no
hw.camera.back = emulated
hw.camera.front = none
vm.heapSize = 48
hw.sensors.proximity = yes
hw.sensors.magnetic_field = yes
hw.sensors.orientation = yes
hw.sensors.temperature = yes
kernel.path = /home/rmbq/zImage
kernel.parameters = android.checkjni=1
disk.ramdisk.path = /home/rmbq/android-sdk-linux/system-images/android-15/armeabi-v7a//ramdisk.img
disk.systemPartition.initPath = /home/rmbq/android-sdk-linux/system-images/android-15/armeabi-v7a//system.img
disk.systemPartition.size = 200m
disk.dataPartition.path = /home/rmbq/.android/avd/sgsp40.avd/userdata-qemu.img
disk.dataPartition.size = 200m
avd.name = sgsp40
.
QEMU options list:
emulator: argv[00] = "./emulator-arm"
emulator: argv[01] = "-show-kernel"
emulator: argv[02] = "-android-hw"
emulator: argv[03] = "/home/rmbq/.android/avd/sgsp40.avd/hardware-qemu.ini"
Concatenated QEMU options:
./emulator-arm -show-kernel -android-hw /home/rmbq/.android/avd/sgsp40.avd/hardware-qemu.ini
emulator: registered 'boot-properties' qemud service
emulator: nand_add_dev: system,size=0xc800000,initfile=/home/rmbq/android-sdk-linux/system-images/android-15/armeabi-v7a//system.img
emulator: mapping 'system' NAND image to /tmp/android-rmbq/emulator-mPhPfB
emulator: rounding devsize up to a full eraseunit, now c810000
emulator: nand_add_dev: userdata,size=0xc800000,file=/home/rmbq/.android/avd/sgsp40.avd/userdata-qemu.img
emulator: rounding devsize up to a full eraseunit, now c810000
emulator: registered 'boot-properties' qemud service
emulator: Adding boot property: 'dalvik.vm.heapsize' = '48m'
emulator: Adding boot property: 'qemu.sf.lcd_density' = '240'
emulator: Adding boot property: 'qemu.hw.mainkeys' = '1'
emulator: Adding boot property: 'qemu.sf.fake_camera' = 'back'
emulator: nand_add_dev: cache,size=0x4200000,file=/home/rmbq/.android/avd/sgsp40.avd/cache.img
emulator: Initializing hardware OpenGLES emulation support
emulator: Kernel parameters: qemu.gles=0 qemu=1 console=ttyS0 android.qemud=ttyS1 android.checkjni=1 ndns=1
emulator: Trace file name is not set
emulator: autoconfig: -scale 1
serial0 console
emulator: Could not open file: (null)/system/build.prop: No such file or directory
emulator: control console listening on port 5554, ADB on port 5555
emulator: sent '0012host:emulator:5555' to ADB server
emulator: ping program: /home/rmbq/android-sdk-linux/tools/ddms
emulator: ping command: /home/rmbq/android-sdk-linux/tools/ddms ping emulator 20.0.1.0 "NVIDIA Corporation" "GeForce GTX 460/PCIe/SSE2" "4.2.0 NVIDIA 295.49"
and it freeze.
there is this line:
Code:
emulator: Could not open file: (null)/system/build.prop: No such file or directory
which appear only when i use a custom kernel.
Anyone know how to solve?
thanks
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums & Read the Forum Rules
Thanks ✟
Moving to Q&A
Hello,
You may have read about an error in a piece of software named bash. [1]
This software is installed on my DSC, I think it came from GingerStreak.
You may find it also on CM-based ROMS.
Just try:
Code:
sh-4.1# test="() { echo Hello; }; echo hacked" bash -c ""
hacked
sh-4.1# X='() { function a a>\' bash -c echo; [ -e echo ] && echo "hacked"
hacked
If it shows "hacked" your tablet is in trouble. It is highly encouraged to replace the
bash software, because there are so many applications for this flaw, you'd never know
how it can be used to trick your tablet in doing things it shouldn't.
Attached is a zip of a static binary of bash-4.3 [2] with the latest patches from [3]
I compiled it, like it is described in [4] and [5]. I just changed the default
PATH to "/system/bin:/system/xbin:/sbin:/data/local/bin" to suit android
needs. Just put it into /system/bin/ for DSC/GingerStreak or /system/xbin/ for
CM-based ROMS.
So it should look like this
Code:
sh-4.3# test="() { echo Hello; }; echo hacked" bash -c ""
bash: warning: test: ignoring function definition attempt
bash: error importing function definition for `test'
sh-4.3# X='() { function a a>\' bash -c echo; [ -e echo ] && echo "hacked"
bash: X: line 1: syntax error near unexpected token `a'
bash: X: line 1: `'
bash: error importing function definition for `X'
Have fun,
hunderteins
[1] http://en.wikipedia.org/wiki/Shellshock_(software_bug)
[2] https://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
[3] https://ftp.gnu.org/gnu/bash/bash-4.3-patches/
[4] http://blog.droidzone.in/2014/08/06/cross-compile-bash-for-android/
[5] https://shellshocker.net/
Just tested PseudoCream, and its bash script returned the error messages on the second command, but returned "hacked" on the first. So, partly vulnerable? Irrelevant as I'm just going to change bash anyway to your version.
this is no fun at all
Hello,
just an hour after I compiled the static bash, an other patch appeared [1]
going after CVE-2014-6277.
I compiled bash and attached it, again.
[1] https://ftp.gnu.org/gnu/bash/bash-4.3-patches/bash43-027
Hasn't that been the norm for this bug? They keep finding exploit vectors because the bug dates back to 1993?
no, I think the first one was CVE-2014-6271 yeah, really old bug. Maybe msh should be enough.
CVE-2014-7186 also applies to this build.
Code:
bash -c 'true <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF <<EOF' ||
echo "CVE-2014-7186 vulnerable, redir_stack"
but at least that's not done via environment.
Unfortually I've found a possible attack vector on Android. To get an IP-
adress f.e. via WLAN we use dhcpcd and shell-skripts in /etc/dhdpcd/dhcpcd-hooks.
A special crafted public accesspoint may be able to use this to run code as dhcp user on the Streak.
I have no concrete exploit, but that looks bad.
hunderteins
Here we go again
Hello,
under [1] is a shell-script to test against known bash bugs. I attached an android-version of this script (changed path to bash and /tmp) and my latest build of bash 4.3 patchlevel 30.
I tried to compile this with gcc-4.8 for 'address sanitizer', but the kernel on the streak is too old for that. So I got back to 4.7.
now I get:
Code:
Testing /system/bin/bash ...
GNU bash, version 4.3.30(1)-release (arm-unknown-linux-gnueabihf)
Variable function parser pre/suffixed [%%, upstream], bugs not exploitable
Not vulnerable to CVE-2014-6271 (original shellshock)
Not vulnerable to CVE-2014-7169 (taviso bug)
Not vulnerable to CVE-2014-7186 (redir_stack bug)
Test for CVE-2014-7187 not reliable without address sanitizer
Not vulnerable to CVE-2014-6277 (lcamtuf bug #1)
Not vulnerable to CVE-2014-6278 (lcamtuf bug #2)
have fun,
hunderteins
[1] https://raw.githubusercontent.com/hannob/bashcheck/master/bashcheck
The main objective is to send a splited file to an android and join it back up with a .sh script, the file is splited to 5MB parts but its total size is unknown (trying to make an universal script), I've splited the file and transferred the file parts and the script to a dir inside the android device and ran the .sh with adb shell sh script.sh. every thing is is ok but the dd command which wont accept a variable
Code:
file="$(ls /data/local/tmp/ | grep -i --include="*.tul" tul)"
echo file is "$file"
name="${file%.*}"
echo short name is "$name"
tmp="${file: -3}";
num=${tmp//[!0-9]/}
echo number of files is "$num"
N="${name}.part1"
i=1
while [ $i -le $num ]; do
dd if="/data/local/tmp/$"${name}.part""$i"" of="/data/local/tmp/cust" bs=1024 count=5120 seek="$((($i-1)*5120))"
let i=i+1
done
echo DONE
exit
the output normally is that the end of the name cuts the beginning and I get dd if No such file or directory meaning
Code:
/data/local/new_file.part1
becomes something like
Code:
.part1local/new_file
while in command lind adb shell it works OK
adb shell
Code:
adb shell
>dd if="/data/local/tmp/$"${name}.part1"" of=/data/local/tmp/cust bs=1024 count=5120
$file is an index file that has the parts name and total number of them generated by the split code (in java) Important to say that Im a total noob and it took me few hours to get to this so any help is appreciated
edit:
Code:
dd if=/data/local/tmp/"$name".part"$i" of=/data/local/tmp/cust bs=1024 count=5120 seek="$((($i-1)*5120))"
working in command line (adb shell) but when running the .sh file I get
Code:
.part2: No such file or directory
Bump, can any one help ?