Da das ganze iBoot(iBec image - iBSS) ist, hat es ein interaktives Interface was per serial oder USB angesprochen werden kann.
Wir senden keine Datein oder rufen den Status ab, nein wie senden einfach mal Kommandos.
Wir arbeiten heute mit LibUSB (C) und PYUSB(Python) damit C und Python Entwickler etwas davon haben.
Es ist aber sehr einfach das ganze in vb.net, c++, c# etc zu porten da man nur die Funtkion wissen muss.
Hiermit senden wir ein Kommando:
PHP Code:
usb_control_msg(device_handle, 0x40, 0, 0, 0, buf, strlen(buf), 1000);
PHP Code:
libusb_control_transfer(device_handle, 0x40, 0, 0, 0, command[0], (strlen(command[0]) + 1), 1000)
PHP Code:
struct libusb_device_handle *handle;
handle = libusb_open_device_with_vid_pid(NULL, 0x05AC, 0x1281);
PHP Code:
libusb_init(NULL);
PHP Code:
0x05AC, 0x1281
PHP Code:
#include <stdlib.h>
#include <stdio.h>
#include <libusb-1.0/libusb.h>
#include <usb.h>
int cmd();
struct libusb_device_handle *device_handle;
int main() {
libusb_init(NULL);
device_handle = libusb_open_device_with_vid_pid(NULL, 0x05AC, 0x1281);
libusb_control_transfer(device_handle, 0x40, 0, 0, 0, "reboot", (strlen("reboot") + 1), 1000);
return 1;
}
PHP Code:
#include <stdlib.h>
#include <stdio.h>
#include <libusb-1.0/libusb.h>
#include <usb.h>
int cmd();
struct libusb_device_handle *device_handle;
int main() {
libusb_init(NULL);
device_handle = libusb_open_device_with_vid_pid(NULL, 0x05AC, 0x1281);
if (libusb_control_transfer(device_handle, 0x40, 0, 0, 0, "reboot", (strlen("reboot") + 1), 1000)) {
printf("[*] Successfully sent command.\r\n");
return 0;
} else {
printf("[*] Error with sending the Command");
return 0;
}
return 1;
}
Mit gcc könnt ihr dass z.b. für Mac so kompilieren:
PHP Code:
cal0x:~ cal0x$ gcc -o send_cmd send_cmd.c -lusb-1.0 -framework IOKit
PHP Code:
import usb.core
import usb.util
import sys
dev = usb.core.find(idVendor=0x05AC, idProduct=0x1281)
cmd = "reboot" # Add any command here.
ret = dev.ctrl_transfer(0x40, 0, 0, 0, cmd, 1000)
PHP Code:
import usb.core
import usb.util
import sys
dev = usb.core.find(idVendor=0x05AC, idProduct=0x1281)
if (dev):
print 'Device in recovery Mode connected.'
cmd = "reboot" # Add any command here.
ret = dev.ctrl_transfer(0x40, 0, 0, 0, cmd, 1000)
else:
print 'No device in recovery mode found.'
Es heißt OpeniSenc_rec und ist im OpenSun-C Paket oder alleine verfügbar:
Das Python Beispiel ist auch auf meinem Github Account verfügbar:
P.S: Ein Thx tut keinem weh . Aber wayne .