/*## (c) SECURITY EXPLORATIONS 2018 Poland #*/ /*## http://www.security-explorations.com #*/ /*## (c) AG Security Research 2019-2022 Poland #*/ /*## http://www.agsecurityresearch.com #*/ /* THIS SOFTWARE IS PROTECTED BY DOMESTIC AND INTERNATIONAL COPYRIGHT LAWS */ /* UNAUTHORISED COPYING OF THIS SOFTWARE IN EITHER SOURCE OR BINARY FORM IS */ /* EXPRESSLY FORBIDDEN. ANY USE, INCLUDING THE REPRODUCTION, MODIFICATION, */ /* DISTRIBUTION, TRANSMISSION, RE-PUBLICATION, STORAGE OR DISPLAY OF ANY */ /* PART OF THE SOFTWARE, FOR COMMERCIAL OR ANY OTHER PURPOSES REQUIRES A */ /* VALID LICENSE FROM THE COPYRIGHT HOLDER. */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS */ /* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,*/ /* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL */ /* SECURITY EXPLORATIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, */ /* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF */ /* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ /* SOFTWARE. */ package mod.mspr; import agsecres.tool.*; import agsecres.helper.*; import mod.cdn.*; import mod.vod.*; import java.lang.*; import java.util.*; import java.io.*; import java.math.*; import java.util.concurrent.*; import java.awt.*; import java.awt.image.*; import javax.imageio.*; import java.nio.file.*; public class Init implements TolkitMod { .... public static class CMD_GENTEST implements CmdHandler { static String input_collections[]={ "PREMIERY VOD+", "CANAL+ Premium", "HBO" }; static final String PLAYER_PATH = "c:\\Program Files (x86)\\Windows Media Player\\wmplayer.exe"; static final int FONT_SIZE = 20; static int random_int(int max) { return ThreadLocalRandom.current().nextInt(max); } static String gen_collection() { return input_collections[random_int(input_collections.length)]; } static void print_text(BufferedImage screen_image,int pos_x,int pos_y,String txt,Color color,int font_size) { String lines[]=Utils.tokenize(txt,"\n"); Graphics2D gfx=screen_image.createGraphics(); gfx.setPaint(color); gfx.setFont(new Font("Courier",Font.BOLD,font_size)); for(int i=0;i assets=col.assets_from_page(page_id); //select asset in a random fashion int asset_idx=random_int(assets.size()); //selected asset VOD.Asset vod_asset=assets.elementAt(asset_idx); vod_asset.store(); String asset_id=vod_asset.id(); Asset asset=new Asset(asset_id); Asset.Info info=asset.get_info(); if (info!=null) { tst+="["+colname+"]\n"; tst+="- asset: "+asset_id+"\n"; int total=abi.max_page()*30; tst+=" * page id "+page_id+", page pos "+asset_idx+" (~"+total+" assets)"+"\n"; License license=asset.get_license(); if (license==null) { Shell.err_string="cannot get license for asset: "+asset.id(); return false; } tst+="- license request [OK]\n"; byte content_key[]=license.get_content_key(); byte digest_bytes[]=Crypto.SHA256(content_key); String digest=Utils.construct_hex_string(digest_bytes); String key=Utils.hex_value(content_key[0]&0xff,2); for(int j=1;jopen)\n"; String txt=""; txt+="collection: "+colname+"\n"; txt+="asset: "+asset_id+"\n"; txt+="time_desc: "+time_desc+"\n"; txt+="audio_desc: "+audio_desc+"\n"; txt+="video_desc: "+video_desc+"\n"; String mp4_path=FileCache.mp4_filename(asset_id); movie_screenshot(mp4_path,txt,screenshot_file); } Shell.out.println(tst); Utils.save_file("cp_content_security_check.txt",tst.getBytes()); } return true; } } }