Popular Post likeadoc Posted January 23, 2020 Popular Post #1 Posted January 23, 2020 (edited) Hi all:) After a little bit of reverse engineering I was able to bypass the license checking mechanism introduced in DSM 6 successfully with a simple two line binary patch of synocodectool and therefore enable transcoding without a valid serial number[emoji4]. I wrote a little script to make it easier for everyone. For more information please check the github repo: https://github.com/likeadoc/synocodectool-patch HOWTO: 1. wget https://raw.githubusercontent.com/likeadoc/synocodectool-patch/master/patch.sh 2. chmod +x patch.sh 3. ./patch.sh Done:) If things go wrong simply restore the original file: ./patch.sh -r Cheers Spoiler [28/01/2020] Updated patch from https://gist.githubusercontent.com/likeadoc/43fa9015d7d509c9c941a79e61286703/raw/9e7668599ace336e63b9083c5ae309cd9bd1d838/synocodectool_6.2.2-24922-5.sh to https://raw.githubusercontent.com/likeadoc/synocodectool-patch/master/patch.sh Edited January 30, 2020 by Polanskiman See change log above ^ 18 15 Quote
fatez Posted January 26, 2020 #2 Posted January 26, 2020 (edited) hi, for me the path is different : /usr/syno/bin/synocodectool whit work for me : CODEC=/usr/syno/bin/synocodectool CODECBACKUP=/usr/syno/bin/synocodectool.bkp CONF=/usr/syno/etc/codec/activation.conf CONFBACKUP=/usr/syno/etc/codec/activation..old.conf CONFDIR=/usr/syno/etc/codec/ Edited January 26, 2020 by fatez Quote
likeadoc Posted January 26, 2020 Author #3 Posted January 26, 2020 Yup, I am sorry I made an error - should be fixed now:) Quote
Keli Posted January 26, 2020 #4 Posted January 26, 2020 (edited) Does it work with DSM 6.1? I can't seem to get it working. I get this after applying the patch: cat /usr/syno/etc/codec/activation.conf {"success":true,"activated_codec":["hevc_dec","ac3_dec","h264_dec","h264_enc","aac_dec","aac_enc","mpeg4part2_dec","vc1_dec","vc1_enc"],"token":"123456789987654abc"} Then this immediately after trying to play a video in video station: cat /usr/syno/etc/codec/activation.conf {"success":false,"msg":"SN format is wrong."} Video doesn't play. Edited January 26, 2020 by Keli Added more info. 1 Quote
Keli Posted January 27, 2020 #5 Posted January 27, 2020 I tried messing with it again this morning.. still no joy. Here's my system info: DSM Ver: DSM 6.1.7-15284 Update 3 DSM image: DS3615xs Installation type: Bare metal Hardware: HP Pro 3500 Series MT Video Station version: 2.4.1-1554 (I was running the latest version but decided to downgrade) Some additional info: I get the "Music or videos don't play or display properly because the given codec is not successfully activated. Please check your Internet connection." error after disabling internet access and then trying to play a video. Output of cat /usr/syno/etc/codec/activation.conf remains as below -even after trying to play videos: {"success":true,"activated_codec":["hevc_dec","ac3_dec","h264_dec","h264_enc","aac_dec","aac_enc","mpeg4part2_dec","vc1_dec","vc1_enc"],"token":"123456789987654abc"} But goes to the output below after enabling internet access: {"success":false,"msg":"SN format is wrong."} ffmpeg package is installed (version 4.2.1-23) from SynoCommunity Quote
pasden Posted January 30, 2020 #6 Posted January 30, 2020 (edited) Hi guys, it's a good day! The patch worked successfully! @likeadoc, thank you! System info: DSM version: DSM 6.1.7-15284 Update 3 Loader version and model: JUN'S LOADER v1.02b - DS3615xs Using custom extra.lzma: NO Installation type: BAREMETAL - HP MicroServer Gen8 Photo Station version: 6.8.12-3496 Additional comments: My serial number is in the format: 1430LWNXXXXXX instead of: XXXXODNXXXXXX for 3615xs as required I use the Photo Station package. There were errors before using the patch: sudo cat /var/log/messages | grep -e G1Licence 2020-01-28T22:05:00+03:00 crbkds1 synocodectool: G1Licence.cpp:79 Licence not Success,error msg "SN format is wrong." 2020-01-28T22:05:00+03:00 crbkds1 synocodectool: SYNOCodecPatentG1.cpp:239 ValidateG1Licence failed They've been gone for two days. Also i`ve: cat /usr/syno/etc/codec/activation.conf {"success":true,"activated_codec":["hevc_dec","ac3_dec","h264_dec","h264_enc","aac_dec","aac_enc","mpeg4part2_dec","vc1_dec","vc1_enc"],"token":"123456789987654abc"} Edited January 30, 2020 by pasden Quote
polanskiman Posted January 30, 2020 #7 Posted January 30, 2020 Yes the patch restores the ability to allow video playback as well as showing video thumbnails in PhotoStation. I suppose the same applies to VideoStation and perhaps other applications that were relying on license checking. For the videos to be playable again and thumbnails to show back one needs to re-index media in PhotoStation > Settings > Photo > Re-index Additionally this patch will most certainly be overwritten during DSM updates, therefore it will need to be reapplied following an update. @likeadoc can you please confirm this? Quote
likeadoc Posted January 30, 2020 Author #8 Posted January 30, 2020 @Polanskiman exactly! The patch patches a function in synocodectool that checks with synologys servers if the serial number is valid and prevents it from erroring out. I added multipatch support two days ago, so applications like videostation (which ship with their own version) can also be patched. You can choose which binary you want to patch from a handydandy little menu. Furthermore, I also uploaded all original & patched binaries going back to DSM 6.0 to my Github repository. Should ******* hit the fan you can either try restoring the app from the automatically created backup or just download the original version from Github. Regarding overwrites: Until now Synology only updated synocodectool in releases (namely 6.0, 6.1, 6.1.2, 6.1.4, 6.2.1), so critical updates should not affect the binary. The patch itself checks your dsm version & the hash of the binary and compares it to a predefined list of hashes before patching so you do not accidentally patch an unsupported version. Should a new versions of synocodectool be released, I will update the script to include it. 2 Quote
likeadoc Posted January 30, 2020 Author #10 Posted January 30, 2020 @pasden Regarding the serial number. For 3615xs it should be XXXXLWNXXXXXX (so yours is RIGHT) Unfortunately I somehow mixed up the device identifiers for 3615xs and 3617xs on Github - but that should be fixed now! Btw I am currently working on creating a bash based serial generator for DS3615xs, DS3617xs and DS918+ because the one I found generates serials in the wrong format ( https://github.com/xpenogen/serial_generator ), but that is stuff for another topic 1 Quote
The_Dave Posted January 31, 2020 #11 Posted January 31, 2020 So just to be sure, this doesn`t enable hardware decoding right? Quote
likeadoc Posted January 31, 2020 Author #12 Posted January 31, 2020 @The_Dave Regarding HW transcoding - if all the other prerequisites are met( loader 1.04b & /dev/dri exists) then it activates hw transcoding for all synology apps (i.e. Moments, VideoStation, PhotoStation, AudioStation..) ------ Plex, Emby & Jellyfin should be unaffected by this patch since they don't use synologys license checking mechanism and come bundled with their own version of ffmpeg. 1 Quote
DerMoeJoe Posted January 31, 2020 #13 Posted January 31, 2020 hy likedoc, d u work on a update for the nuew 6.2.2. u5 for the ds918+ ? Quote
IG-88 Posted January 31, 2020 #14 Posted January 31, 2020 1 hour ago, DerMoeJoe said: d u work on a update for the nuew 6.2.2. u5 for the ds918+ ? U4->U5 are just a few kernel drivers, nothing new like the licensing module in question, it only need to list the u5 version in the script and thats it Quote
likeadoc Posted January 31, 2020 Author #15 Posted January 31, 2020 Jup..gonna update it asap:) Quote
jastsai Posted February 1, 2020 #17 Posted February 1, 2020 Thanks in advance for this. Can someone make a tutorial for us noobies? Quote
polanskiman Posted February 1, 2020 #18 Posted February 1, 2020 Thanks in advance for this. Can someone make a tutorial for us noobies?Tutorial on what exactly? The process is rather explicitly detailed in the OP as well as github link provided. Or am I missing something? Quote
IG-88 Posted February 1, 2020 #19 Posted February 1, 2020 3 hours ago, Polanskiman said: Tutorial on what exactly? The process is rather explicitly detailed in the OP as well as github link provided. Or am I missing something? i guess he asks for stage 2. - a spk package you just install from the web gui? Quote
jastsai Posted February 1, 2020 #21 Posted February 1, 2020 8 hours ago, IG-88 said: i guess he asks for stage 2. - a spk package you just install from the web gui? You guys can blame the youtube howto videos and tutorials on how to install xpenology on bare metal boxes. Because of them, I end up here asking ultra noob questions. I know you guys are super smart with this, but these comments dissuade people like me to not participate in this forum. Maybe that was the intent. 1 Quote
IG-88 Posted February 1, 2020 #22 Posted February 1, 2020 (edited) 54 minutes ago, jastsai said: . Because of them, I end up here asking ultra noob questions. my answer was just half joking, also a suggestion it is a question how easy it should be made to pirate things, there might be more consequences when it gets to common Quote I know you guys are super smart with this, i wish it would be that way its just i devote much time into this, i'm not just using what i found here, turn around and walk away, there was and is the thought of giving something back (i dont need the drivers from the package for myself, i do have hardware that is able to get along with the native dsm drivers, compared with the time it would be much cheaper just to buy a synology box) Quote but these comments dissuade people like me to not participate in this forum. Maybe that was the intent. no, but it can be be seen that way the patch as it is now is extremely comfy and the author did invest some time to make it that way (and its obvious he does not need it this way for himself) there can also be the question that you ask to much and did not ask yourself how can you help, if you think its not enough documented then make this tutorial instead of asking others to do it also most people have special interests and if someone likes to crack a nut using reverse engineering and disassembler he might not be that interested in writing a tutorial that even someone who never used linux can use, thats the point where we might work together - i have no coding skill, so what, i still can help Edited February 1, 2020 by IG-88 2 Quote
polanskiman Posted February 2, 2020 #23 Posted February 2, 2020 On 2/2/2020 at 2:48 AM, jastsai said: You guys can blame the youtube howto videos and tutorials on how to install xpenology on bare metal boxes. Because of them, I end up here asking ultra noob questions. I know you guys are super smart with this, but these comments dissuade people like me to not participate in this forum. Maybe that was the intent. My intention is not for you not to participate, rather the opposite and I am sorry if you felt offended. This said, your question has nothing of a noob question but rather of someone who clearly didn't take the time to read and reflect. The "tutorial" you are asking for is literally detailed in the OP, so I am not sure what else you are looking for. Perhaps explaining what it is that you do not understand would help us, help you. Quote
jastsai Posted February 3, 2020 #24 Posted February 3, 2020 I'm sorry I might have come off harsh. I might have done it already, but the last part was a bit confusing. After patching, there is this command: sudo ./patch.sh -p It gives me 2 options to backup. 1) /usr/syno/bin/synocodectool 2) /volume1/@appstore/VideoStation/bin/synocodectool I backed up both, but I'm not sure if I did something incorrect. Quote
polanskiman Posted February 3, 2020 #25 Posted February 3, 2020 (edited) On 2/3/2020 at 2:42 PM, jastsai said: After patching, there is this command: sudo ./patch.sh -p That is the actual patching command line (with the -p flag). If you only do what follows: ./patch.sh then you are merely calling the patch help and nothing is done (no patching, no backing up). It's the same as doing: ./patch.sh -h I could be wrong but the reason why the author did not put the actual full patching command line in the OP is because: 1. it lets the user understand what he is doing and the capabilities of the patch; 2. it reduces the possibilities of error as the user is forced to read instead of just copy pasting command lines and not understanding what is happening. In your case you should now be good to go. If you use PhotoStation / VideoStation you should not have any issue now and if you look at the /var/log/messages you shouldn't see errors such as: 2020-01-30T12:14:08+07:00 Server synocodectool: SYNOCodecPatentG1.cpp:239 ValidateG1Licence failed 2020-01-30T12:14:08+07:00 Server synoflvconv: synoflvconv.cpp:617 Failed to convert video [/volume/photo/Pictures/IMG_3.MOV] t$ In the future I would advise against running command lines if you don't know what it is doing and how it works. Better to ask prior any action. Edited February 6, 2020 by Polanskiman Edited for clarity. 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.