Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
		
							parent
							
								
									59386f9fa9
								
							
						
					
					
						commit
						015ab4a024
					
				| @ -175,8 +175,15 @@ static const DuckyCmd ducky_commands[] = { | ||||
| #define WORKER_TAG TAG "Worker" | ||||
| 
 | ||||
| int32_t ducky_execute_cmd(BadUsbScript* bad_usb, const char* line) { | ||||
|     size_t cmd_word_len = strcspn(line, " "); | ||||
|     for(size_t i = 0; i < COUNT_OF(ducky_commands); i++) { | ||||
|         if(strncmp(line, ducky_commands[i].name, strlen(ducky_commands[i].name)) == 0) { | ||||
|         size_t cmd_compare_len = strlen(ducky_commands[i].name); | ||||
| 
 | ||||
|         if(cmd_compare_len != cmd_word_len) { | ||||
|             continue; | ||||
|         } | ||||
| 
 | ||||
|         if(strncmp(line, ducky_commands[i].name, cmd_compare_len) == 0) { | ||||
|             if(ducky_commands[i].callback == NULL) { | ||||
|                 return 0; | ||||
|             } else { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Nikolay Minaylov
						Nikolay Minaylov