AnonSec Shell
Server IP : 185.86.78.101  /  Your IP : 216.73.216.213
Web Server : Apache
System : Linux 675867-vds-valikoshka1996.gmhost.pp.ua 5.4.0-150-generic #167-Ubuntu SMP Mon May 15 17:35:05 UTC 2023 x86_64
User : www ( 1000)
PHP Version : 7.4.33
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /www/server/mysql/mysql-test/include/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /www/server/mysql/mysql-test/include/get_frm_info.inc
perl;
  use strict;
  my $path = "$ENV{'PATH_TO_TABLE'}";
  if ($path eq "") { die "No path given!"; }
  my @found_files = glob($path . "*.MYD");
  if ($#found_files >= 0) {
    print "found " . (1 + $#found_files) . " *.MYD file(s)\n";
  }
  @found_files = glob($path . "*.ibd");
  if ($#found_files >= 0) {
    print "found " . (1 + $#found_files) . " *.ibd file(s)\n";
  }
  if (-e $path . ".par") {
    print ".par file exists\n";
  }
  my $frm_file = $path . ".frm";
  if (not -e $frm_file) {
    die $frm_file . " does not file exists!";
  }
  open(FH, "<", $frm_file) or die "Failed to open '$frm_file'";
  binmode FH;
  my $bin_val;
  seek(FH, 0x33, 0) or die "Failed to seek";
  my $res= read FH, $bin_val, 4;
  die "Failed to read bin_val! res: $res" unless ($res == 4);
  my $frm_ver = unpack("V", $bin_val);
  if ($frm_ver >= 50708) {
    print ".frm created by version >= 5.7.8\n";
  } else {
    print ".frm created by version: $frm_ver\n";
  }
  seek(FH, 3, 0) or die "Failed to seek";
  my $res= read FH, $bin_val, 1;
  die "Failed to read bin_val! res: $res" unless ($res == 1);
  print "DB_TYPE (byte 3): " . unpack("C", $bin_val) . "\n";
  seek(FH, 61, 0) or die "Failed to seek";
  $res= read FH, $bin_val, 1;
  die "Failed to read bin_val! res: $res" unless ($res == 1);
  print "DEFAULT_PART_DB_TYPE (byte 61): " . unpack("C", $bin_val) . "\n";
  # Also check the engine name
  seek(FH, 55, 0) or die "Failed to seek";
  $res= read FH, $bin_val, 4;
  my $length = unpack("V", $bin_val);
  if ($length != 0)
  {
    # see from table.cc (reading .frm file)
    seek(FH, 6, 0) or die "Failed to seek";
    $res= read FH, $bin_val, 2;
    my $record_offset= unpack("v", $bin_val);
    seek(FH, 14, 0) or die "Failed to seek";
    $res= read FH, $bin_val, 2;
    my $tmp = unpack("v", $bin_val);
    if ($tmp == 0xffff)
    {
      seek(FH, 47, 0) or die "Failed to seek";
      $res= read FH, $bin_val, 4;
      $tmp= unpack("V", $bin_val);
    }
    $record_offset+= $tmp;
    seek(FH, 16, 0) or die "Failed to seek";
    $res= read FH, $bin_val, 2;
    $tmp = unpack("v", $bin_val);
    $record_offset+= $tmp;
    # connect string length + string
    seek(FH, $record_offset, 0) or die "Failed to seek";
    $res= read FH, $bin_val, 2;
    die "Failed to read bin_val! res: $res" unless ($res == 2);
    $length= unpack("v", $bin_val);
    seek(FH, $record_offset + 2 + $length, 0) or die "Failed to seek";
    $res= read FH, $bin_val, 2;
    die "Failed to read bin_val! res: $res" unless ($res == 2);
    $length= unpack("v", $bin_val);
    $res= read FH, $bin_val, $length;
    die "Failed to read bin_val! res: $res" unless ($res == $length);
    print "DB_TYPE string: '" . $bin_val . "'\n";
  }
  close(FH);
EOF

Anon7 - 2022
AnonSec Team