|
You last visited: Today at 09:44
Advertisement
[PHP] Decrypt Awake
Discussion on [PHP] Decrypt Awake within the Flyff PServer Guides & Releases forum part of the Flyff Private Server category.
05/19/2020, 11:33
|
#1
|
elite*gold: 28
Join Date: Feb 2010
Posts: 463
Received Thanks: 277
|
[PHP] Decrypt Awake
1. You will need php 5.6+
2. You need to run on x64 php
3. The script don't take 5 lines awake, only 3.
Code:
<?php
define( 'MAX_RANDOM_OPTION', 3 );
define( '_AWAKE_SAFE_FLAG', 0x2000000000000000 );
class CRandomOptionProperty
{
static function GetRandomOptionSize( $nRandomOptItemId )
{
$nSize = 0;
$bCheckedSafeFlag = false;
$bCheckedSafeFlag = CRandomOptionProperty::IsCheckedSafeFlag( $nRandomOptItemId );
if( $bCheckedSafeFlag )
return nSize;
$i = 0x3FFFF << 8;
for( $j = 0; $j < MAX_RANDOM_OPTION; $j++ )
{
if( $nRandomOptItemId & $i )
$nSize++;
else
return $nSize;
$i = $i << 18;
}
return $nSize;
}
static function IsCheckedSafeFlag( $n64RandomeOption )
{
if( ( $n64RandomeOption & _AWAKE_SAFE_FLAG ) == _AWAKE_SAFE_FLAG )
return true;
return false;
}
static function GetParam( $nRandomOptItemId, $i, &$nDst, &$nAdj )
{
if ( $i > MAX_RANDOM_OPTION )
return false;
$nRandomOption = ( $nRandomOptItemId >> ( 8 + $i * 18 ) );
$nAdj = $nRandomOption & 0x000001FF;
if( $nRandomOption & 0x00000200 )
$nAdj = -$nAdj;
$nRandomOption = $nRandomOption >> 10;
$nDst = $nRandomOption & 0x0000007F;
return ( $nDst > 0 );
}
}
function GetAwakes( $nRandomOptItemId )
{
$nDst;
$nAdj;
$nStr = '';
$str = '';
if( CRandomOptionProperty::GetRandomOptionSize( $nRandomOptItemId ) > 1 )
$nStr = ', ';
for( $i = 0; $i < CRandomOptionProperty::GetRandomOptionSize( $nRandomOptItemId ); $i++ )
{
if( !CRandomOptionProperty::GetParam( $nRandomOptItemId, $i, $nDst, $nAdj ) )
continue;
if( $nAdj >= 0 )
$str .= $nDst.' +'.$nAdj.$nStr;
else
$str .= $nDst.' -'.$nAdj.$nStr;
}
return $str;
}
?>
<h2>Decrypt Flyff Awake</h2>
</div>
<form method="post">
<strong><p style="color:red">Awake Encrypt :</br></strong>
<input type="text" name="awake">
<input type="submit" name="push" />
</form>
</p></br>
<?php
if(isset($_POST['push']))
{
?>
<div class="title">
<h2>Awake Decrypt :</h2>
<span class="byline">Awake : <?php echo GetAwakes($_POST['awake']); ?></span>
</div>
<?php
}
?>
The script was originaly made by Sedrika.
|
|
|
05/19/2020, 17:07
|
#2
|
elite*gold: 0
Join Date: Nov 2009
Posts: 627
Received Thanks: 688
|
Quote:
Originally Posted by ZeroTwo02
1. You will need php 5.6+
2. You need to run on x64 php
3. The script don't take 5 lines awake, only 3.
Code:
<?php
define( 'MAX_RANDOM_OPTION', 3 );
define( '_AWAKE_SAFE_FLAG', 0x2000000000000000 );
class CRandomOptionProperty
{
static function GetRandomOptionSize( $nRandomOptItemId )
{
$nSize = 0;
$bCheckedSafeFlag = false;
$bCheckedSafeFlag = CRandomOptionProperty::IsCheckedSafeFlag( $nRandomOptItemId );
if( $bCheckedSafeFlag )
return nSize;
$i = 0x3FFFF << 8;
for( $j = 0; $j < MAX_RANDOM_OPTION; $j++ )
{
if( $nRandomOptItemId & $i )
$nSize++;
else
return $nSize;
$i = $i << 18;
}
return $nSize;
}
static function IsCheckedSafeFlag( $n64RandomeOption )
{
if( ( $n64RandomeOption & _AWAKE_SAFE_FLAG ) == _AWAKE_SAFE_FLAG )
return true;
return false;
}
static function GetParam( $nRandomOptItemId, $i, &$nDst, &$nAdj )
{
if ( $i > MAX_RANDOM_OPTION )
return false;
$nRandomOption = ( $nRandomOptItemId >> ( 8 + $i * 18 ) );
$nAdj = $nRandomOption & 0x000001FF;
if( $nRandomOption & 0x00000200 )
$nAdj = -$nAdj;
$nRandomOption = $nRandomOption >> 10;
$nDst = $nRandomOption & 0x0000007F;
return ( $nDst > 0 );
}
}
function GetAwakes( $nRandomOptItemId )
{
$nDst;
$nAdj;
$nStr = '';
$str = '';
if( CRandomOptionProperty::GetRandomOptionSize( $nRandomOptItemId ) > 1 )
$nStr = ', ';
for( $i = 0; $i < CRandomOptionProperty::GetRandomOptionSize( $nRandomOptItemId ); $i++ )
{
if( !CRandomOptionProperty::GetParam( $nRandomOptItemId, $i, $nDst, $nAdj ) )
continue;
if( $nAdj >= 0 )
$str .= $nDst.' +'.$nAdj.$nStr;
else
$str .= $nDst.' -'.$nAdj.$nStr;
}
return $str;
}
?>
<h2>Decrypt Flyff Awake</h2>
</div>
<form method="post">
<strong><p style="color:red">Awake Encrypt :</br></strong>
<input type="text" name="awake">
<input type="submit" name="push" />
</form>
</p></br>
<?php
if(isset($_POST['push']))
{
?>
<div class="title">
<h2>Awake Decrypt :</h2>
<span class="byline">Awake : <?php echo GetAwakes($_POST['awake']); ?></span>
</div>
<?php
}
?>
The script was originaly made by Sedrika.
|
For what usage? the awake "decrypt" is already in the c++ source
|
|
|
05/19/2020, 17:49
|
#3
|
elite*gold: 28
Join Date: Feb 2010
Posts: 463
Received Thanks: 277
|
Quote:
Originally Posted by cookie69
For what usage? the awake "decrypt" is already in the c++ source
|
For any admin panel.
To see the awake of a trade, or a item delete etc...
On database the awake is encrypted.
|
|
|
05/20/2020, 06:46
|
#4
|
elite*gold: 0
Join Date: Jul 2010
Posts: 174
Received Thanks: 329
|
Quote:
Originally Posted by ZeroTwo02
1. You will need php 5.6+
2. You need to run on x64 php
3. The script don't take 5 lines awake, only 3.
Code:
<?php
define( 'MAX_RANDOM_OPTION', 3 );
define( '_AWAKE_SAFE_FLAG', 0x2000000000000000 );
class CRandomOptionProperty
{
static function GetRandomOptionSize( $nRandomOptItemId )
{
$nSize = 0;
$bCheckedSafeFlag = false;
$bCheckedSafeFlag = CRandomOptionProperty::IsCheckedSafeFlag( $nRandomOptItemId );
if( $bCheckedSafeFlag )
return nSize;
$i = 0x3FFFF << 8;
for( $j = 0; $j < MAX_RANDOM_OPTION; $j++ )
{
if( $nRandomOptItemId & $i )
$nSize++;
else
return $nSize;
$i = $i << 18;
}
return $nSize;
}
static function IsCheckedSafeFlag( $n64RandomeOption )
{
if( ( $n64RandomeOption & _AWAKE_SAFE_FLAG ) == _AWAKE_SAFE_FLAG )
return true;
return false;
}
static function GetParam( $nRandomOptItemId, $i, &$nDst, &$nAdj )
{
if ( $i > MAX_RANDOM_OPTION )
return false;
$nRandomOption = ( $nRandomOptItemId >> ( 8 + $i * 18 ) );
$nAdj = $nRandomOption & 0x000001FF;
if( $nRandomOption & 0x00000200 )
$nAdj = -$nAdj;
$nRandomOption = $nRandomOption >> 10;
$nDst = $nRandomOption & 0x0000007F;
return ( $nDst > 0 );
}
}
function GetAwakes( $nRandomOptItemId )
{
$nDst;
$nAdj;
$nStr = '';
$str = '';
if( CRandomOptionProperty::GetRandomOptionSize( $nRandomOptItemId ) > 1 )
$nStr = ', ';
for( $i = 0; $i < CRandomOptionProperty::GetRandomOptionSize( $nRandomOptItemId ); $i++ )
{
if( !CRandomOptionProperty::GetParam( $nRandomOptItemId, $i, $nDst, $nAdj ) )
continue;
if( $nAdj >= 0 )
$str .= $nDst.' +'.$nAdj.$nStr;
else
$str .= $nDst.' -'.$nAdj.$nStr;
}
return $str;
}
?>
<h2>Decrypt Flyff Awake</h2>
</div>
<form method="post">
<strong><p style="color:red">Awake Encrypt :</br></strong>
<input type="text" name="awake">
<input type="submit" name="push" />
</form>
</p></br>
<?php
if(isset($_POST['push']))
{
?>
<div class="title">
<h2>Awake Decrypt :</h2>
<span class="byline">Awake : <?php echo GetAwakes($_POST['awake']); ?></span>
</div>
<?php
}
?>
The script was originaly made by Sedrika.
|
Where do I add these codes? Admin Panel? or do I have to create new file in Admin Panel folder?
|
|
|
05/26/2020, 13:30
|
#5
|
elite*gold: 0
Join Date: Aug 2016
Posts: 20
Received Thanks: 3
|
Thanks for reuploading this man. May I know where on the database I can get the awake values of an Item is saved?
Edit: Nevermind, found it dbo.INVENTORY_EXT_TBL on column m_extInventory, now all I need is figuring out which index when you explode the string using '/' is for which item.
|
|
|
05/28/2020, 19:09
|
#6
|
elite*gold: 0
Join Date: Jan 2009
Posts: 1,741
Received Thanks: 1,674
|
Quote:
Originally Posted by deleonrenz024
Thanks for reuploading this man. May I know where on the database I can get the awake values of an Item is saved?
Edit: Nevermind, found it dbo.INVENTORY_EXT_TBL on column m_extInventory, now all I need is figuring out which index when you explode the string using '/' is for which item.
|
0 = m_bCharged
1 = m_dwKeepTime
2 = Awakening
3 = m_bTranformVisPet
... assuming that you're using a clean v15 or v21 source code.
|
|
|
05/29/2020, 13:08
|
#7
|
elite*gold: 0
Join Date: Aug 2016
Posts: 20
Received Thanks: 3
|
Quote:
Originally Posted by xTwiLightx
0 = m_bCharged
1 = m_dwKeepTime
2 = Awakening
3 = m_bTranformVisPet
... assuming that you're using a clean v15 or v21 source code.
|
I don't know what's this for, but thanks.
So for anyone that's maybe wondering on how you can find the correct which database entry is for which item.
This is m_Inventory from INVENTORY_TBL
0,2800,0,0,,3,0,-1,0,0,0,-45364226,0,0,0,0,0,0/1,2801,0,0,,1,0,-1,0,0,0,38338230,0,0,0,0,0,0/2,4805,0,0,,5,0,-1,0,0,0,-1372191970,0,0,0,0,0,0/3,21,0,0,,1,0,7200000,0,0,0,-1665507005,0,0,0,0,0,-1/6,81,0,0,,1,0,8000000,0,0,0,334851842,0,0,0,0,0,-1/
Red is Item ID from defineItem.h
Blue is Item Index.
So in our case, the Item index 3 has Item ID of 21 which is Wooden Sword.
Now split m_extInventory from INVENTORY_EXT_TBL using the character '/'
then find the 4th one because indexes starts with 0 and the item index we're finding is 3.(the '/' is the delimiter).
0,0,0,0/0,0,0,0/0,0,0,0/0,0,759943664640,0/0,0,0/0,0,0/0,0,18542234152733184,0/0,0,526848,0/0,0,206830310400,0/0,0,0,0/0,0,0/
Now you can decrypt the 759943664640 using the decrypter above and that will be the awake values of our Wooden Sword
|
|
|
06/05/2020, 17:39
|
#8
|
elite*gold: 0
Join Date: Jan 2009
Posts: 1,741
Received Thanks: 1,674
|
Quote:
Originally Posted by deleonrenz024
I don't know what's this for, but thanks
|
Quote:
|
now all I need is figuring out which index when you explode the string using '/' is for which item.
|
That's exactly what I did for you.
|
|
|
All times are GMT +1. The time now is 09:45.
|
|