mirror of
https://github.com/palera1n/palera1n.git
synced 2026-12-06 16:24:54 +01:00
* refactor refactor: remove wdi refactor: move openra1n to its own library refactor: move everything standalone file to src root * submodule * okay these shouldnt of been included * remove * readd * fix openra1n libusb * liteusb for ra1ncovery * fix action * token * whatever lwra bw apwxidix * I knew this was gonna happen * fix mac build * what if this doesnt work * okay bro * lzma resources * rename * use idevice++, fix multiple devices, enter recovery * whatever * fix * --force-enable-ssv * improve exploit stuff, mirror tui logic to gui also cooool logging for libopenra1n * fix idevice windows build * lets not be fancy * new idevice patch * easier to read * lets hope this action works! * remove useless ifs * not required for non tui * PLEASE COMPILE * gsed lmao * this might work idk * whatever bro * ah * amd fix * fix ts * fix * licensing * update paleinfo * LETS NOT do that * forgot a file
63 lines
2.1 KiB
C
63 lines
2.1 KiB
C
/*
|
|
* palera1n - https://palera.in
|
|
*
|
|
* Copyright (C) 2023 0x7ff
|
|
* Copyright (C) 2023 Mineek
|
|
* Copyright (c) 2026 palera1n team
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
#include <shim.h>
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
#ifdef __APPLE__
|
|
# include <usb_iokit.h>
|
|
#else
|
|
# include <usb_libusb.h>
|
|
#endif
|
|
|
|
transfer_ret_t send_usb_control_request_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len) {
|
|
transfer_ret_t result;
|
|
void *p_data;
|
|
|
|
if(w_len == 0) {
|
|
return send_usb_control_request(handle, bm_request_type, b_request, w_value, w_index, NULL, 0);
|
|
} else if((p_data = malloc(w_len)) != NULL) {
|
|
memset(p_data, '\0', w_len);
|
|
result = send_usb_control_request(handle, bm_request_type, b_request, w_value, w_index, p_data, w_len);
|
|
free(p_data);
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
transfer_ret_t send_usb_control_request_async_no_data(const usb_handle_t *handle, uint8_t bm_request_type, uint8_t b_request, uint16_t w_value, uint16_t w_index, size_t w_len, unsigned usb_abort_timeout) {
|
|
transfer_ret_t result;
|
|
void *p_data;
|
|
|
|
if(w_len == 0) {
|
|
return send_usb_control_request_async(handle, bm_request_type, b_request, w_value, w_index, NULL, 0, usb_abort_timeout);
|
|
} else if((p_data = malloc(w_len)) != NULL) {
|
|
memset(p_data, '\0', w_len);
|
|
result = send_usb_control_request_async(handle, bm_request_type, b_request, w_value, w_index, p_data, w_len, usb_abort_timeout);
|
|
free(p_data);
|
|
}
|
|
|
|
return result;
|
|
}
|