Skip to content
Permalink
Browse files

Show item info on encrypted page

  • Loading branch information
Marlamin committed Mar 19, 2020
1 parent 883ee2d commit f1ed79f9961c2b95040f60f281d4727fcaed509b
Showing with 58 additions and 7 deletions.
  1. +6 −3 builds/scripts/updateGameData.php
  2. +52 −4 files/encrypted.php
@@ -34,13 +34,16 @@ function importDB2($name, $outdir, $fields){
}
}

importDB2("modelfiledata", $outdir, "(FileDataID)");
importDB2("texturefiledata", $outdir, "(FileDataID)");
importDB2("modelfiledata", $outdir, "(@FileDataID, @Flags, @LodCount, @ModelResourcesID) SET FileDataID = @FileDataID, ModelResourcesID = @ModelResourcesID");
importDB2("texturefiledata", $outdir, "(@FileDataID, @UsageType, @MaterialResourcesID) SET FileDataID = @FileDataID, MaterialResourcesID = @MaterialResourcesID");
importDB2("moviefiledata", $outdir, "(ID)");
importDB2("manifestmp3", $outdir, "(ID)");
importDB2("soundkitname", $outdir, "(id, name)");
importDB2("soundkitentry", $outdir, "(@id, @soundkitid, @filedataid) SET id=@filedataid, entry=@soundkitid");
importDB2("manifestinterfacedata", $outdir, "(filedataid, path, name)");
importDB2("creaturemodeldata", $outdir, "(@id, @geobox1, @geobox2, @geobox3, @geobox4, @geobox5, @geobox6, @flags, @filedataid, @bloodid, @footprinttextureid, @footprinttexturelength, @footprinttexturewidth, @footprintparticlescale, @foleymaterialid, @footstepcameraeffectid, @deaththudcameraeffectid, @soundid) SET id=@id, filedataid=@filedataid, soundid=@soundid");
importDB2("creaturesounddata", $outdir, "(ID, SoundExertionID, SoundExertionCriticalID, SoundInjuryID, SoundInjuryCriticalID, SoundInjuryCrushingBlowID, SoundDeathID, SoundStunID, SoundStandID, SoundFootstepID, SoundAggroID, SoundWingFlapID, SoundWingGlideID, SoundAlertID, SoundJumpStartID, SoundJumpEndID, SoundPetAttackID, SoundPetOrderID, SoundPetDismissID, LoopSoundID, BirthSoundID, SpellCastDirectedSoundID, SubmergeSoundID, SubmergedSoundID, WindupSoundID, WindupCriticalSoundID, ChargeSoundID, ChargeCriticalSoundID, BattleShoutSoundID, BattleShoutCriticalSoundID, TauntSoundID, CreatureSoundDataIDPet, FidgetDelaySecondsMin, FidgetDelaySecondsMax, CreatureImpactType, NPCSoundID, `SoundFidget[0]`, `SoundFidget[1]`, `SoundFidget[2]`, `SoundFidget[3]`, `SoundFidget[4]`, `CustomAttack[0]`, `CustomAttack[1]`, `CustomAttack[2]`, `CustomAttack[3]`)");
importDB2("creaturedisplayinfo", $outdir, "(@ID, @ModelID, @SoundID, @SizeClass, @CreatureModelScale, @CreatureModelAlpha, @BloodID, @ExtendedDisplayInfoID, @NPCSoundID, @ParticleColorID, @PortraitCreatureDisplayInfoID, @PortraitTextureFileDataID, @ObjectEffectPackageID, @AnimReplacementSetID, @Flags, @StateSpellVisualKitID, @PlayerOverrideScale, @PetInstanceScale, @UnarmedWeaponType, @MountPoofSpellVisualKitID, @DissolveEffectID, @Gender, @DissolveOutEffectID, @CreatureModelMinLod, @TextureVariationFileDataID0, @TextureVariationFileDataID1, @TextureVariationFileDataID2) SET ID=@ID, ModelID=@ModelID, PortraitTextureFileDataID=@PortraitTextureFileDataID, `TextureVariationFileDataID[0]`=@TextureVariationFileDataID0, `TextureVariationFileDataID[1]` = @TextureVariationFileDataID1, `TextureVariationFileDataID[2]` = @TextureVariationFileDataID2");
importDB2("creaturedisplayinfo", $outdir, "(@ID, @ModelID, @SoundID, @SizeClass, @CreatureModelScale, @CreatureModelAlpha, @BloodID, @ExtendedDisplayInfoID, @NPCSoundID, @ParticleColorID, @PortraitCreatureDisplayInfoID, @PortraitTextureFileDataID, @ObjectEffectPackageID, @AnimReplacementSetID, @Flags, @StateSpellVisualKitID, @PlayerOverrideScale, @PetInstanceScale, @UnarmedWeaponType, @MountPoofSpellVisualKitID, @DissolveEffectID, @Gender, @DissolveOutEffectID, @CreatureModelMinLod, @TextureVariationFileDataID0, @TextureVariationFileDataID1, @TextureVariationFileDataID2) SET ID=@ID, ModelID=@ModelID, PortraitTextureFileDataID=@PortraitTextureFileDataID, `TextureVariationFileDataID[0]`=@TextureVariationFileDataID0, `TextureVariationFileDataID[1]` = @TextureVariationFileDataID1, `TextureVariationFileDataID[2]` = @TextureVariationFileDataID2");
importDB2("itemdisplayinfo", $outdir, "(@ID, @ItemVisual, @ParticleColorID, @ItemRangedDisplayInfoID, @OverrideSwooshSoundKitID, @SheatheTransformMatrixID, @StateSpellVisualKitID, @SheathedSpellVisualKitID, @UnsheathedSpellVisualKitID, @Flags, @ModelResourcesID0, @ModelResourcesID1, @ModelMaterialResourcesID0, @ModelMaterialResourcesID1) SET ID = @ID, ModelResourcesID0 = @ModelResourcesID0, ModelResourcesID1 = @ModelResourcesID1, ModelMaterialResourcesID0 = @ModelMaterialResourcesID0, ModelMaterialResourcesID1 = @ModelMaterialResourcesID1");
importDB2("componentmodelfiledata", $outdir, "(ID, GenderIndex, ClassID, RaceID, PositionIndex)");
importDB2("chrraces", $outdir, "(ClientPrefix, ClientFileString, Name_lang, Name_female_lang, Name_lowercase_lang, Name_female_lowercase_lang, ID)");
@@ -37,16 +37,42 @@
</div>
</div>
</div>
<div class="modal" id="fkModal" tabindex="-1" role="dialog" aria-labelledby="fkModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="fkModalLabel">Foreign key lookup</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body" id="fkModalContent">
<i class="fa fa-refresh fa-spin" style="font-size:24px"></i>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<script src="/files/js/files.js?v=<?=filemtime("/var/www/wow.tools/files/js/files.js")?>" crossorigin="anonymous"></script>
<?php
echo "<div class='container-fluid'>";

function fdidModal($fdid){
return "<a style='padding-top: 0px; padding-bottom: 0px; cursor: pointer; border-bottom: 1px dotted;'' data-toggle='modal' data-target='#moreInfoModal' onclick='fillModal(".$fdid.")'>".$fdid."</a>";
}

$encryptedfileq = $pdo->prepare("SELECT * FROM wow_rootfiles WHERE id IN (SELECT filedataid FROM wow_encrypted WHERE keyname = ?)");

$raceMap = $pdo->query("SELECT ID, ClientFileString FROM wowdata.chrraces")->fetchAll(PDO::FETCH_KEY_PAIR);
$cmdq = $pdo->prepare("SELECT * FROM wowdata.creaturemodeldata WHERE filedataid IN (SELECT filedataid FROM wow_encrypted WHERE keyname = ?)");
$idiq = $pdo->prepare("SELECT ID FROM wowdata.itemdisplayinfo WHERE ModelResourcesID0 IN (SELECT ModelResourcesID FROM wowdata.modelfiledata WHERE FileDataID = ?)");
$cmfq = $pdo->prepare("SELECT * FROM wowdata.componentmodelfiledata WHERE ID IN (SELECT filedataid FROM wow_encrypted WHERE keyname = ?)");
$csdq = $pdo->prepare("SELECT * FROM wowdata.creaturesounddata WHERE ID = ?");
$contenthashMatchQ = $pdo->prepare("SELECT filedataid, contenthash FROM wow_rootfiles_chashes WHERE contenthash IN (SELECT contenthash FROM wow_rootfiles_chashes WHERE filedataid IN (SELECT filedataid FROM wow_encrypted WHERE wow_encrypted.keyname = ?)) AND filedataid NOT IN (SELECT filedataid FROM wow_encrypted)
");
foreach($pdo->query("SELECT * FROM wow_tactkey WHERE id > 120 ORDER BY id DESC") as $tactkey){
foreach($pdo->query("SELECT * FROM wow_tactkey WHERE id > 232 ORDER BY id DESC") as $tactkey){

$encryptedfileq->execute([$tactkey['keyname']]);
$filesforkey = $encryptedfileq->fetchAll(PDO::FETCH_ASSOC);
@@ -93,7 +119,7 @@
if(count($cmds) > 0){
echo "<tr><td>Creatures</td><td><table class='table table-sm table-striped'>";
foreach($cmds as $cmd){
echo "<tr><td>FileDataID " . $cmd['filedataid']."</td><td>&nbsp;</td></tr>";
echo "<tr><td>FileDataID " . fdidModal($cmd['filedataid'])."</td><td>&nbsp;</td></tr>";
echo "<tr><td>CreatureModelData " . $cmd['id']."</td><td>&nbsp;</td></tr>";
echo "<tr><td>CreatureSoundData " . $cmd['soundid']."</td><td>&nbsp;</td></tr>";
$csdq->execute([$cmd['soundid']]);
@@ -119,6 +145,29 @@
echo "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>";
}
echo "</table>";
}else{
$cmfq->execute([$tactkey['keyname']]);
$cmfs = $cmfq->fetchAll();
if(count($cmfs) > 0){
echo "<tr><td>Items</td><td><table class='table table-sm table-striped'>";
foreach($cmfs as $cmf){
if(array_key_exists($cmf['RaceID'], $raceMap)){
$raceName = $raceMap[$cmf['RaceID']];
}else{
$raceName = "Unknown";
}

$idiq->execute([$cmf['ID']]);
$idis = $idiq->fetchAll(PDO::FETCH_COLUMN);
if(count($idis) > 0){
$idi = "ItemDisplayInfoID(s) " . implode(", ", $idis);
}else{
$idi = "";
}
echo "<tr><td>FileDataID " . fdidModal($cmf['ID'])."</td><td>GenderIndex " . $cmf['GenderIndex']."</td><td>RaceID ".$cmf['RaceID']." (".$raceName.")</td><td>PositionIndex ".$cmf['PositionIndex']."</td><td>".$idi."</td></tr>";
}
echo "</table>";
}
}
}

@@ -142,8 +191,7 @@
echo "</table>";
echo "<hr>";
}
echo "<p>Older keys than key ID 120 are hidden for performance reasons.</p>";
echo "<p>Older keys than key ID 232 are hidden for performance reasons.</p>";
echo "</div>";
?>
<script src="/files/js/files.js?v=<?=filemtime("/var/www/wow.tools/files/js/files.js")?>" crossorigin="anonymous"></script>
<?php require_once("../inc/footer.php"); ?>

0 comments on commit f1ed79f

Please sign in to comment.
You can’t perform that action at this time.