mirror of
https://github.com/Xpl0itU/WiiUDownloader.git
synced 2025-05-15 07:34:47 -04:00
Unfinished work
This commit is contained in:
commit
0a319d80d8
21 changed files with 3257 additions and 0 deletions
25
decryption.go
Normal file
25
decryption.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package wiiudownloader
|
||||
|
||||
/*
|
||||
#cgo CFLAGS: -I${SRCDIR}/cdecrypt
|
||||
#cgo LDFLAGS: -Wl,-rpath,${SRCDIR}/cdecrypt
|
||||
#cgo LDFLAGS: -L${SRCDIR}/cdecrypt
|
||||
#cgo LDFLAGS: -lcdecrypt
|
||||
#include <cdecrypt.h>
|
||||
#include <ctype.h>
|
||||
*/
|
||||
import "C"
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func decryptContents(path string) error {
|
||||
argv := make([]*C.char, 2)
|
||||
argv[0] = C.CString("WiiUDownloader")
|
||||
argv[1] = C.CString(path)
|
||||
if int(C.cdecrypt_main(2, (**C.char)(unsafe.Pointer(&argv[0])))) != 0 {
|
||||
return fmt.Errorf("decryption failed")
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue