Skip to content

Commit

Permalink
commenting
Browse files Browse the repository at this point in the history
added comments to the code
  • Loading branch information
BrianTehOwnerer committed Jul 1, 2022
1 parent 3daa531 commit 66e373a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions convertfiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,14 @@ func getaaxchecksum(fullFilename string, foldertoconvertfrom string) string {
if err != nil {
fmt.Println("error opening file")
}
//this sets the size of checksumbytes to 20 bytes long (which is the size of the aax file checksum)
checksumbytes := make([]byte, 20)

//jumps to the 653rd byte of the aax file and reads in the next 20 bytes
aaxfile.Seek(653, 0)
aaxfile.Read(checksumbytes)

//takes the raw binarydata and converts it to hex encoding
var checksum string = string(hex.EncodeToString(checksumbytes))
return checksum
}
Expand All @@ -102,6 +106,7 @@ func convertaax(justFileName []string, foldertoconvertfrom string, fullfilename
wg.Done()
}

//this function takes the checksum we found in getaaxchecksum and makes an API call to get the decryption bytes
func getactivationkey(fullFileName string, foldertoconvertfrom string) string {
checksum := getaaxchecksum(fullFileName, foldertoconvertfrom)
resp, err := http.Get("https://aax.api.j-kit.me/api/v2/activation/" + checksum)
Expand All @@ -114,8 +119,10 @@ func getactivationkey(fullFileName string, foldertoconvertfrom string) string {
if err != nil {
log.Fatalln(err)
}
//reads in the https responce data and makes a maped string list
var apiresponce map[string]interface{}
json.Unmarshal(body, &apiresponce)
//sets activationkey to the responded api's "activationBytes"
activationkey := fmt.Sprintf("%v", apiresponce["activationBytes"])

return activationkey
Expand Down

0 comments on commit 66e373a

Please sign in to comment.