Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hid-Keyboard binary fix #120

Open
Gr1MM-Hond0 opened this issue Jul 11, 2022 · 5 comments
Open

Hid-Keyboard binary fix #120

Gr1MM-Hond0 opened this issue Jul 11, 2022 · 5 comments

Comments

@Gr1MM-Hond0
Copy link

No description provided.

@Gr1MM-Hond0 Gr1MM-Hond0 changed the title Hid-Keybapr Hid-Keyboard binary fox Jul 11, 2022
@Gr1MM-Hond0 Gr1MM-Hond0 changed the title Hid-Keyboard binary fox Hid-Keyboard binary fix Jul 11, 2022
@Gr1MM-Hond0
Copy link
Author

I think this script is great, It has allowed me to unlock the mobile device of a family member who has passed.
After many hours of troubleshooting I stumbled onto this solution, I have done a small write up to see if this will help anyone else.
This method should fix the error 126/127 if all other items are implemented correctly

Compiling the binary yourself:

If the binary is not on your device you will need to compile yourself. You will need to go and grab the hid-gadget-test utility as a basis for the file you will need. Using git:

git clone- https://github.com/aagallag/hid_gadget_test

Edit the hid_gadget_test.c file. You need to edit 3 sections:
First you add the values for the number keys to the static struct options kval on line 32.

{.opt = "1",		.val = 0x1e},
{.opt = "2",		.val = 0x1f},
{.opt = "3",		.val = 0x20},
{.opt = "4",		.val = 0x21},
{.opt = "5",		.val = 0x22},
{.opt = "6",		.val = 0x23},
{.opt = "7",		.val = 0x24},
{.opt = "8",		.val = 0x25},
{.opt = "9",		.val = 0x26},
{.opt = "0",		.val = 0x27},

Secondly remove the print_options section on lines from 209 – 239. 
Thirdly remove the print_options function call around line 260. 

Now you can move the directory to the device being used for the brute forcing. You have to compile the binary ON THAT DEVICE. The binary will not work if compiled on another device then transferred.

On the device navigate to the directory you just transferred across. Run the “make” command In that directory.
Rename the new binary to match what the script looks for “hid-keyboard”, you can either move that file or keep it in that directory.
Edit the config file for the Android-PIN-Bruteforce.
On line 67 change the path for the hid-keyboard variable to where your new binary is, you will also need to edit this value in any pre-made configs that come with the script.

This should now work. Some tweaking may be required depending on the phone being brute forced.

@urbanadventurer
Copy link
Owner

Thank you for this @Gr1MM-Hond0 ! 🎉

@Cerber123
Copy link

I'm doing as in this description and nothing works :/

Anyone else got any ideas on how to fix this?
IMG_20230531_085626

@Outlawed-Earl
Copy link

Same issue here op 7 pro

@ZedbeHiro
Copy link

ZedbeHiro commented Feb 26, 2024

I think this script is great, It has allowed me to unlock the mobile device of a family member who has passed. After many hours of troubleshooting I stumbled onto this solution, I have done a small write up to see if this will help anyone else. This method should fix the error 126/127 if all other items are implemented correctly

Compiling the binary yourself:

If the binary is not on your device you will need to compile yourself. You will need to go and grab the hid-gadget-test utility as a basis for the file you will need. Using git:

git clone- https://github.com/aagallag/hid_gadget_test

Edit the hid_gadget_test.c file. You need to edit 3 sections: First you add the values for the number keys to the static struct options kval on line 32.

{.opt = "1",		.val = 0x1e},
{.opt = "2",		.val = 0x1f},
{.opt = "3",		.val = 0x20},
{.opt = "4",		.val = 0x21},
{.opt = "5",		.val = 0x22},
{.opt = "6",		.val = 0x23},
{.opt = "7",		.val = 0x24},
{.opt = "8",		.val = 0x25},
{.opt = "9",		.val = 0x26},
{.opt = "0",		.val = 0x27},

Secondly remove the print_options section on lines from 209 – 239. 
Thirdly remove the print_options function call around line 260. 

Now you can move the directory to the device being used for the brute forcing. You have to compile the binary ON THAT DEVICE. The binary will not work if compiled on another device then transferred.

On the device navigate to the directory you just transferred across. Run the “make” command In that directory. Rename the new binary to match what the script looks for “hid-keyboard”, you can either move that file or keep it in that directory. Edit the config file for the Android-PIN-Bruteforce. On line 67 change the path for the hid-keyboard variable to where your new binary is, you will also need to edit this value in any pre-made configs that come with the script.

This should now work. Some tweaking may be required depending on the phone being brute forced.

step3 - remove print_options function call around line 260.

really cant find it, could u be a bit more specific in step3 please?

is it this line?

print_options(argv[2][0]);

UPDATE:

@Gr1MM-Hond0

it works, thank u very very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants