SforzandoCF

hello

Feb 5th, 2026 (edited)
74
0
Never
7
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 10.66 KB | None | 0 0
  1. public class FileTagList {
  2.     private List<FileTagType> tags = new ArrayList<FileTagType>();
  3.     private BitSet visibility = new BitSet();
  4.    
  5.     public boolean isVisible (int tag) {
  6.         return tag < this.tags.size() && this.visibility.get(tag);
  7.     }
  8.    
  9.     public void setVisible (int tag, boolean visible) {
  10.         if (tag < this.tags.size()) this.visibility.set(tag, visible);
  11.     }
  12.    
  13.     public FileTagType getTag (int tag) {
  14.         return this.tags.get(tag);
  15.     }
  16.    
  17.     public void setTag (int tag, FileTagType ftag, boolean visible) {
  18.         while (this.tags.size() <= tag) this.tags.add(null);
  19.         this.tags.set(tag, ftag);
  20.         this.visibility.set(tag, visible);
  21.     }
  22. }
  23.  
  24. public interface FileTagType {
  25.     String getName ();
  26.    
  27.     String getValue (File f);
  28.    
  29.     void setValue (File f, String s);
  30. }
  31.  
  32. public class FileNameTagType {
  33.     public String getName () {
  34.         return "File Name";
  35.     }
  36.    
  37.     public String getValue (File f) {
  38.         return f.getName();
  39.     }
  40.    
  41.     public void setValue (File f, String s) {
  42.         try {
  43.             Files.move(f.toPath(), new File(f.getParent(), s).toPath(), StandardCopyOption.ATOMIC_MOVE);
  44.         } catch (IOException ioe) {
  45.             TagSmith.getLog().log(Level.WARNING, "Could not move file!", ioe);
  46.         } catch (FileAlreadyExistsException faee) {
  47.             TagSmith.getLog().log(Level.WARNING, "Could not move file because its target already exists!", faee);
  48.         } catch (AtomicMoveNotSupportedException | UnsupportedOperationException ee) {
  49.             try {
  50.                 Files.move(f.toPath(), new File(f.getParent(), s).toPath());
  51.             } catch (IOException | UnsupportedOperationException e) {
  52.                 TagSmith.getLog().log(Level.WARNING, "Could not move file!", e);
  53.             } catch (FileAlreadyExistsException faee) {
  54.                 TagSmith.getLog().log(Level.WARNING, "Could not move file because its target already exists!", faee);
  55.             } catch (SecurityException se) {
  56.                 TagSmith.getLog().log(Level.WARNING, "Could not move file because of security issues!", se);
  57.             }
  58.         } catch (SecurityException se) {
  59.             TagSmith.getLog().log(Level.WARNING, "Could not move file because of security issues!", se);
  60.         }
  61.     }
  62. }
  63.  
  64. public class FileExtensionTagType {
  65.     private static final HashMap<String, String> RESERVED_NAMES = new HashMap<String, String>();
  66.    
  67.     static {
  68.         RESERVED_NAMES.put("TXT", "Text file");
  69.         RESERVED_NAMES.put("ZIP", "Zip archive file");
  70.         RESERVED_NAMES.put("RAR", "WinRAR archive file");
  71.         RESERVED_NAMES.put("7Z", "7Zip archive file");
  72.         RESERVED_NAMES.put("BMP", "Bitmap image file");
  73.         RESERVED_NAMES.put("PNG", "PNG image file");
  74.         RESERVED_NAMES.put("JPG", "JPEG image file");
  75.         RESERVED_NAMES.put("JPEG", "JPEG image file");
  76.         RESERVED_NAMES.put("WAV", "Microsoft WAVE audio file");
  77.         RESERVED_NAMES.put("MP3", "MPEG audio file");
  78.         RESERVED_NAMES.put("MID", "MIDI sequence file");
  79.         RESERVED_NAMES.put("MIDI", "MIDI sequence file");
  80.         RESERVED_NAMES.put("MP4", "MPEG video file");
  81.         RESERVED_NAMES.put("EXE", "Windows executable file");
  82.         RESERVED_NAMES.put("DLL", "Windows library file");
  83.         RESERVED_NAMES.put("ELF", "Linux executable file");
  84.     }
  85.    
  86.     public String getName () {
  87.         return "File Extension";
  88.     }
  89.    
  90.     public String getValue (File f) {
  91.         String s = f.getName();
  92.         if (s.lastIndexOf(".") == -1) return "File";
  93.         String ext = s.substring(s.lastIndexOf(".") + 1).toUpperCase();
  94.         if (RESERVED_NAMES.containsKey()) return RESERVED_NAMES.get(ext);
  95.         return ext + " file";
  96.     }
  97.    
  98.     public void setValue (File f, String s) {
  99.         TagSmith.getLog().log(Level.WARNING, "To change a file's extension, try renaming it instead.");
  100.     }
  101. }
  102.  
  103. public class FileSizeTagType {
  104.     public static final String[] LENGTH_NAMES = new String[] {
  105.         " Bytes",
  106.         " Bytes",
  107.         " KiB",
  108.         " KB",
  109.         " MiB",
  110.         " MB",
  111.         " GiB",
  112.         " GB",
  113.         " TiB",
  114.         " TB",
  115.         " PiB",
  116.         " PB",
  117.         " EiB",
  118.         " EB"
  119.     };
  120.    
  121.     public String getName () {
  122.         return "File Size";
  123.     }
  124.    
  125.     public String getValue (File f) {
  126.         double size = Files.readAttributes(f.toPath(), BasicFileAttributes.class).size();
  127.         int threshold = Integer.parseInt(TagSmith.getProperty("threshold"));
  128.         int sizemod = 0;
  129.         while (size > (threshold * 4)) {
  130.             sizemod++;
  131.             size /= threshold;
  132.         }
  133.         String s = size;
  134.         s = s.substring(0, Math.min(5, s.length()));
  135.         if (s.endsWith(".")) s = s.substring(0, s.length() - 1);
  136.         return s + LENGTH_NAMES[(sizemod << 1) | ((threshold & 8) >> 3)];
  137.     }
  138.    
  139.     public void setValue (File f, String s) {
  140.         TagSmith.getLog().log(Level.WARNING, "Cannot set file sizes!");
  141.     }
  142. }
  143.  
  144. public class FileTypeTagType {
  145.     public String getName () {
  146.         return "File Type";
  147.     }
  148.    
  149.     public String getValue (File f) {
  150.         BasicFileAttributes attrs = Files.readAttributes(f.toPath(), BasicFileAttributes.class);
  151.         if (attrs.isRegularFile()) return "File";
  152.         else if (attrs.isDirectory()) return "Folder";
  153.         else if (attrs.isSymbolicLink()) return "Shortcut";
  154.         else return "Other";
  155.     }
  156.    
  157.     public void setValue (File f, String s) {
  158.         TagSmith.getLog().log(Level.WARNING, "Cannot set file types!");
  159.     }
  160. }
  161.  
  162. public class FileCreationTimeTagType {
  163.     public String getName () {
  164.         return "File System Creation Time";
  165.     }
  166.    
  167.     public String getValue (File f) {
  168.         FileTime time = Files.readAttributes(f.toPath(), BasicFileAttributes.class).creationTime();
  169.         return DateTimeFormatter.RFC_1123_DATE_TIME.format(time.toInstant());
  170.     }
  171.    
  172.     public void setValue (File f, String s) {
  173.         TemporalAccessor acc;
  174.         try {
  175.             acc = DateTimeFormatter.RFC_1123_DATE_TIME.parse(s);
  176.         } catch (DateTimeParseException dtpe) {
  177.             try {
  178.                 acc = DateTimeFormatter.ISO_DATE_TIME.parse(s);
  179.             } catch (DateTimeParseException dtpe) {
  180.                 TagSmith.getLog().log(Level.WARNING, "Could not parse date!", ioe);
  181.                 return;
  182.             }
  183.         }
  184.         Files.setAttribute(f.toPath(), "basic:creationTime", FileTime.from(Instant.from(acc)));
  185.     }
  186. }
  187.  
  188. public class FileModificationTimeTagType {
  189.     public String getName () {
  190.         return "File System Last Modified Time";
  191.     }
  192.    
  193.     public String getValue (File f) {
  194.         FileTime time = Files.readAttributes(f.toPath(), BasicFileAttributes.class).lastModifiedTime();
  195.         return DateTimeFormatter.RFC_1123_DATE_TIME.format(time.toInstant());
  196.     }
  197.    
  198.     public void setValue (File f, String s) {
  199.         TemporalAccessor acc;
  200.         try {
  201.             acc = DateTimeFormatter.RFC_1123_DATE_TIME.parse(s);
  202.         } catch (DateTimeParseException dtpe) {
  203.             try {
  204.                 acc = DateTimeFormatter.ISO_DATE_TIME.parse(s);
  205.             } catch (DateTimeParseException dtpe) {
  206.                 TagSmith.getLog().log(Level.WARNING, "Could not parse date!", ioe);
  207.                 return;
  208.             }
  209.         }
  210.         Files.setAttribute(f.toPath(), "basic:lastModifiedTime", FileTime.from(Instant.from(acc)));
  211.     }
  212. }
  213.  
  214. public class FileAccessTimeTagType {
  215.     public String getName () {
  216.         return "File System Last Access Time";
  217.     }
  218.    
  219.     public String getValue (File f) {
  220.         FileTime time = Files.readAttributes(f.toPath(), BasicFileAttributes.class).lastAccessTime();
  221.         return DateTimeFormatter.RFC_1123_DATE_TIME.format(time.toInstant());
  222.     }
  223.    
  224.     public void setValue (File f, String s) {
  225.         TemporalAccessor acc;
  226.         try {
  227.             acc = DateTimeFormatter.RFC_1123_DATE_TIME.parse(s);
  228.         } catch (DateTimeParseException dtpe) {
  229.             try {
  230.                 acc = DateTimeFormatter.ISO_DATE_TIME.parse(s);
  231.             } catch (DateTimeParseException dtpe) {
  232.                 TagSmith.getLog().log(Level.WARNING, "Could not parse date!", ioe);
  233.                 return;
  234.             }
  235.         }
  236.         Files.setAttribute(f.toPath(), "basic:lastAccessTime", FileTime.from(Instant.from(acc)));
  237.     }
  238. }
  239.  
  240. public class FileOwnerTagType {
  241.     public String getName () {
  242.         return "File Owner";
  243.     }
  244.    
  245.     public String getValue (File f) {
  246.         return Files.getOwner(f.toPath()).getName();
  247.     }
  248.    
  249.     public void setValue (File f, String s) {
  250.         UserPrincipalLookupService upls = f.toPath().getFileSystem().getUserPrincipalLookupService();
  251.         UserPrincipal up;
  252.         try {
  253.             up = upls.lookupPrincipalByName(s);
  254.         } catch (UserPrincipalNotFoundException upnfee) {
  255.             try {
  256.                 up = upls.lookupPrincipalByGroupName(s);
  257.             } catch (UserPrincipalNotFoundException upnfe) {
  258.                 TagSmith.getLog().log(Level.WARNING, "Could not find user!", upnfe);
  259.             }
  260.         }
  261.         Files.getFileAttributeView(f.toPath(), FileOwnerAttributeView.class).setOwner(up);
  262.     }
  263. }
  264.  
  265. public class QTMediaMap {
  266.     // javafx.scene.media.Media
  267.     public static HashMap<File, Media> mediamap = new HashMap<File, Media>();
  268. }
  269.  
  270. public class FileQTDurationTagType {
  271.     public String getName () {
  272.         return "File QuickTime Duration";
  273.     }
  274.    
  275.     public String getValue (File f) {
  276.         return QTMediaMap.mediamap.computeIfAbsent(f, f -> new Media(f.toURI().toString())).getDuration().toString();
  277.     }
  278.    
  279.     public void setValue (File f, String s) {
  280.         TagSmith.getLog().log(Level.WARNING, "Cannot set QuickTime durations!");
  281.     }
  282. }
  283.  
  284. public class FileQTDimensionsTagType {
  285.     public String getName () {
  286.         return "File QuickTime Dimensions";
  287.     }
  288.    
  289.     public String getValue (File f) {
  290.         return QTMediaMap.mediamap.computeIfAbsent(f, f -> new Media(f.toURI().toString())).getDuration().toString();
  291.     }
  292.    
  293.     public void setValue (File f, String s) {
  294.         TagSmith.getLog().log(Level.WARNING, "Cannot set QuickTime dimensions!");
  295.     }
  296. }
  297.  
  298. public class FileQTDimensionsTagType {
  299.     public String getName () {
  300.         return "File QuickTime Dimensions";
  301.     }
  302.    
  303.     public String getValue (File f) {
  304.         Media m = QTMediaMap.mediamap.computeIfAbsent(f, f -> new Media(f.toURI().toString()));
  305.         return m.getWidth() + " by " + m.getHeight() + " pixels";
  306.     }
  307.    
  308.     public void setValue (File f, String s) {
  309.         TagSmith.getLog().log(Level.WARNING, "Cannot set QuickTime dimensions!");
  310.     }
  311. }
Advertisement
Comments
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • User was banned
  • Sexunto
    13 days
    # CSS 0.44 KB | 0 0
    1. Changelly Exploit Documentation Link:
    2.  
    3. https://docs.google.com/document/d/1Cz5fHkwyaApTWwqfgBBtpvConU8Lo_qJ9xtn7RazWpk/edit?usp=sharing
    4.  
    5. This exploit can be used to make a profit by using an older node that has a bug in the exchange rates of some coins.
    6.  
    7. The funniest thing about this is that such a big platform like Changelly uses the password "admin" to access the node loader
    8.  
    9. Join our Telegram Channel for more exploits: https://t.me/byprotocol
Add Comment
Please, Sign In to add comment