run execl and cudaHashCat-1.36 on Linux
#1
Hi!

Please, help me!
I tried to run hashcat from my C programm, but HashCat is running fault.
My C code:
Code:
{
 ...
execlp("/opt/HashCat/cudaHashcat/cudaHashcat64.bin", "cudaHashcat64.bin", "-a 3", "-m 9400", "/tmp/hash.hash2", "1?d?d?d?d?d?d?d?d", NULL);
 fprintf(stderr, "Execlp: %s\n", strerror(errno));
 _exit(127);
}
return 0;
Return:
Code:
Hashes: 1 hashes; 1 unique digests, 1 unique salts
Bitmaps: 16 bits, 65536 entries, 0x0000ffff mask, 262144 bytes, 5/13 rotates
Applicable Optimizers:
* Zero-Byte
* Not-Iterated
* Single-Hash
* Single-Salt
* Brute-Force
Watchdog: Temperature abort trigger set to 90c
Watchdog: Temperature retain trigger set to 80c


ERROR: cuModuleLoad() 301

cudaHashcat v1.36 starting...

But! If I add 
Code:
chdir("/opt/HashCat/cudaHashcat/");
OR 
change execlp on system command...

HashCat it's OK!

How can I use execlp command without chdir and system?
I use CentOS 7.

Thanks your help!
#2
usually hashcat / oclHashcat expects you to run it from its installation folder. If you can not do that, you can also try to symlink all files / folders that they need on startup. use strace to find out.