jaredsburrows / jaredsburrows/rarcrack
INFO: number of threads adjusted to 12
- Dominant language
- C
- Stars
- 226
- Forks
- 53
- PR merge metrics
- No merged PRs in 30d
Description
luxury problem on cpus with more than 12 threads
```
$ rarcrack --threads 13 asdf.rar
INFO: number of threads adjusted to 12
INFO: detected file type: rar
INFO: cracking asdf.rar, status file: asdf.rar.xml
INFO: Resuming cracking from password: '38vD'
Probing: '3bfs' [3505 pwds/sec]
Probing: '3dXE' [3476 pwds/sec]
Probing: '3gFT' [3477 pwds/sec]
Probing: '3jnS' [3471 pwds/sec]
Probing: '3m72' [3496 pwds/sec]
Probing: '3oQl' [3499 pwds/sec]
Probing: '3ryo' [3473 pwds/sec]
```
rarcrack.c
```
printf(" --threads: you can specify how many threads\n");
printf(" will be run, maximum 12 (default: 2)\n\n");
```
```c
} else if (strcmp(argv[i],"--threads") == 0) {
if ((i + 1) < argc) {
sscanf(argv[++i], "%d", &threads);
if (threads < 1) threads = 1;
if (threads > 12) {
printf("INFO: number of threads adjusted to 12\n");
threads = 12;
}
} else {
printf("ERROR: missing parameter for option: --threads!\n");
help = 1;
}
} else if (strcmp(argv[i],"--type") == 0) {
```
```
void crack_start(unsigned int threads) {
pthread_t th[13];
unsigned int i;
for (i = 0; i < threads; i++) {
(void) pthread_create(&th[i], NULL, crack_thread, NULL);
}
(void) pthread_create(&th[12], NULL, status_thread, NULL);
for (i = 0; i < threads; i++) {
(void) pthread_join(th[i], NULL);
}
(void) pthread_join(th[12], NULL);
}
```
workaround: use [rar2john](https://www.freecodecamp.org/news/crack-passwords-using-john-the-ripper-pentesting-tutorial/) from [john the ripper](https://github.com/openwall/john)
```
rar2john asdf.rar > asdf.rar.hashes
john asdf.rar.hashes
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in rarcrack.c at the --threads argument handling and crack_start(), including the fixed pthread_t array and status-thread indexing. Trace how the requested count is capped and how worker and status threads are joined. Done should mean higher thread counts are handled safely without the current adjustment message or thread-index conflict.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cli, security
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100