diff --git a/.travis.yml b/.travis.yml index ada8108a37..76201d94c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,4 +8,6 @@ jdk: - openjdk8 - openjdk11 install: true -script: ./travis/build.sh \ No newline at end of file +script: ./travis/build.sh +before_install: +- chmod +x ./travis/build.sh \ No newline at end of file diff --git a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java b/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java index c93edf3611..dc8922535e 100644 --- a/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java +++ b/cache/src/main/java/net/runelite/cache/item/ItemSpriteFactory.java @@ -38,19 +38,19 @@ import net.runelite.cache.models.VertexNormal; public class ItemSpriteFactory { public static final BufferedImage createSprite(ItemProvider itemProvider, ModelProvider modelProvider, - SpriteProvider spriteProvider, TextureProvider textureProvider, - int itemId, int quantity, int border, int shadowColor, - boolean noted) throws IOException + SpriteProvider spriteProvider, TextureProvider textureProvider, + int itemId, int quantity, int border, int shadowColor, + boolean noted) throws IOException { - SpritePixels spritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - itemId, quantity, border, shadowColor, noted); + Sprite spritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, + itemId, quantity, border, shadowColor, noted); return spritePixels == null ? null : spritePixels.toBufferedImage(); } - private static final SpritePixels createSpritePixels(ItemProvider itemProvider, ModelProvider modelProvider, - SpriteProvider spriteProvider, TextureProvider textureProvider, - int itemId, int quantity, int border, int shadowColor, - boolean noted) throws IOException + private static final Sprite createSpritePixels(ItemProvider itemProvider, ModelProvider modelProvider, + SpriteProvider spriteProvider, TextureProvider textureProvider, + int itemId, int quantity, int border, int shadowColor, + boolean noted) throws IOException { ItemDefinition item = itemProvider.provide(itemId); @@ -83,11 +83,11 @@ public class ItemSpriteFactory return null; } - SpritePixels auxSpritePixels = null; + Sprite auxSpritePixels = null; if (item.notedTemplate != -1) { auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - item.notedID, 10, 1, 0, true); + item.notedID, 10, 1, 0, true); if (auxSpritePixels == null) { return null; @@ -96,7 +96,7 @@ public class ItemSpriteFactory else if (item.boughtTemplateId != -1) { auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - item.boughtId, quantity, border, shadowColor, false); + item.boughtId, quantity, border, shadowColor, false); if (auxSpritePixels == null) { return null; @@ -105,7 +105,7 @@ public class ItemSpriteFactory else if (item.placeholderTemplateId != -1) { auxSpritePixels = createSpritePixels(itemProvider, modelProvider, spriteProvider, textureProvider, - item.placeholderId, quantity, 0, 0, false); + item.placeholderId, quantity, 0, 0, false); if (auxSpritePixels == null) { return null; @@ -114,7 +114,7 @@ public class ItemSpriteFactory RSTextureProvider rsTextureProvider = new RSTextureProvider(textureProvider, spriteProvider); - SpritePixels spritePixels = new SpritePixels(36, 32); + Sprite spritePixels = new Sprite(36, 32); Graphics3D graphics = new Graphics3D(rsTextureProvider); graphics.setBrightness(0.6d); graphics.setRasterBuffer(spritePixels.pixels, 36, 32); @@ -142,12 +142,12 @@ public class ItemSpriteFactory itemModel.calculateBoundsCylinder(); itemModel.rotateAndProject(graphics, 0, - item.yan2d, - item.zan2d, - item.xan2d, - item.xOffset2d, - itemModel.modelHeight / 2 + var17 + item.yOffset2d, - var18 + item.yOffset2d); + item.yan2d, + item.zan2d, + item.xan2d, + item.xOffset2d, + itemModel.modelHeight / 2 + var17 + item.yOffset2d, + var18 + item.yOffset2d); if (item.boughtTemplateId != -1) { auxSpritePixels.drawAtOn(graphics, 0, 0); @@ -175,8 +175,8 @@ public class ItemSpriteFactory } graphics.setRasterBuffer(graphics.graphicsPixels, - graphics.graphicsPixelsWidth, - graphics.graphicsPixelsHeight); + graphics.graphicsPixelsWidth, + graphics.graphicsPixelsHeight); graphics.setRasterClipping(); graphics.rasterGouraudLowRes = true; diff --git a/cache/src/main/java/net/runelite/cache/item/SpritePixels.java b/cache/src/main/java/net/runelite/cache/item/SpritePixels.java index 02079847f7..ed8be85a18 100644 --- a/cache/src/main/java/net/runelite/cache/item/SpritePixels.java +++ b/cache/src/main/java/net/runelite/cache/item/SpritePixels.java @@ -26,7 +26,7 @@ package net.runelite.cache.item; import java.awt.image.BufferedImage; -class SpritePixels +class Sprite { public int[] pixels; public int width; @@ -34,7 +34,7 @@ class SpritePixels public int offsetX; int offsetY; - public SpritePixels(int[] var1, int var2, int var3) + public Sprite(int[] var1, int var2, int var3) { this.pixels = var1; this.width = var2; @@ -43,7 +43,7 @@ class SpritePixels this.offsetX = 0; } - public SpritePixels(int var1, int var2) + public Sprite(int var1, int var2) { this(new int[var2 * var1], var1, var2); } diff --git a/cache/src/main/resources/djb2.properties b/cache/src/main/resources/djb2.properties index 4d635ffaae..87c3bb8a6c 100644 --- a/cache/src/main/resources/djb2.properties +++ b/cache/src/main/resources/djb2.properties @@ -1,1403 +1,1403 @@ -#Wed Nov 29 15:08:06 PST 2017 --1863637185=miscgraphics,4 --1863637184=miscgraphics,5 --1863637187=miscgraphics,2 --1863637186=miscgraphics,3 --1863637181=miscgraphics,8 --1863637180=miscgraphics,9 --440204630=alls fairy in love n war --1863637183=miscgraphics,6 --1253085654=scorpia_dances --1863637182=miscgraphics,7 -1356196826=backvmid3 --751102526=high seas -1356196825=backvmid2 --1863637189=miscgraphics,0 -549358875=camelot --1863637188=miscgraphics,1 --1619800378=emotes_locked,19 --1619800379=emotes_locked,18 -792536868=understanding -1356196824=backvmid1 --1773559904=title_mute --342013218=p11_full -1523653533=pirates of peril -696768774=harmony --1701556831=magicoff2,27 -281586976=orb_icon,3 -286265996=ready for battle --1701556832=magicoff2,26 -281586977=orb_icon,4 --645977478=scape scared --1701556833=magicoff2,25 -281586978=orb_icon,5 --1701556834=magicoff2,24 --1701556830=magicoff2,28 --1052794696=dance of death --1619800383=emotes_locked,14 --1619800384=emotes_locked,13 --1619800385=emotes_locked,12 --1556842207=sl_flags --1619800386=emotes_locked,11 -1614826739=mapletree --1619800387=emotes_locked,10 --1701556835=magicoff2,23 --1701556836=magicoff2,22 -1363656441=serenade --1701556837=magicoff2,21 -3089326=door --1701556838=magicoff2,20 --1619800380=emotes_locked,17 --1619800381=emotes_locked,16 --1619800382=emotes_locked,15 --1037172987=tomorrow -825974316=melodrama -281586973=orb_icon,0 -281586974=orb_icon,1 -281586975=orb_icon,2 --1701556864=magicoff2,15 --1701556865=magicoff2,14 --1701556866=magicoff2,13 -1509400204=sarcophagus --1701556867=magicoff2,12 --1701556860=magicoff2,19 --1701556861=magicoff2,18 --1701556862=magicoff2,17 -1868377358=lower_depths --1701556863=magicoff2,16 -1086036315=reggae2 --1220755677=hermit --1544597765=sl_stars --1619800350=emotes_locked,26 --1619800351=emotes_locked,25 --1636062434=tex_brown --1619800352=emotes_locked,24 --1619800353=emotes_locked,23 --2122174648=back to life --1619800354=emotes_locked,22 --1701556868=magicoff2,11 --1619800355=emotes_locked,21 --1701556869=magicoff2,10 --1619800356=emotes_locked,20 -1619539773=side_icons,7 -1121239524=scape wild -368271413=diango's little helpers -1619539772=side_icons,6 -1619539775=side_icons,9 -1619539774=side_icons,8 --1938172321=miscgraphics2,0 -1619539771=side_icons,5 -1619539770=side_icons,4 --926977577=the enchanter -1202794514=doorways -1343649581=schools out --1097177625=q8_full -756012174=wornicons,4 -756012173=wornicons,3 -756012176=wornicons,6 -756012175=wornicons,5 -756012170=wornicons,0 -827249681=ogre the top -756012172=wornicons,2 -756012171=wornicons,1 --1741764817=poles apart -756012178=wornicons,8 --1938172320=miscgraphics2,1 -756012177=wornicons,7 --43136286=the last shanty -756012179=wornicons,9 -837131331=mapback --1938172313=miscgraphics2,8 -907740319=the depths --1938172312=miscgraphics2,9 --2099722614=cave of beasts --1938172317=miscgraphics2,4 --1938172316=miscgraphics2,5 --1938172315=miscgraphics2,6 --1938172314=miscgraphics2,7 -1619539769=side_icons,3 --1367483767=cavern --1938172319=miscgraphics2,2 -50474489=treestump --1938172318=miscgraphics2,3 -1619539766=side_icons,0 -1619539768=side_icons,2 -1619539767=side_icons,1 --607416954=prayeron,11 -1837251043=melzars maze --607416953=prayeron,12 -1318893900=have an ice day --607416952=prayeron,13 --1701556800=magicoff2,37 --607416951=prayeron,14 --1701556801=magicoff2,36 --56804840=woodland --607416950=prayeron,15 -1120636327=scape cave -358884868=button_red --1701556806=magicoff2,31 --1701556807=magicoff2,30 --1701556802=magicoff2,35 --1701556803=magicoff2,34 --1701556804=magicoff2,33 --1858265682=monster melee --1701556805=magicoff2,32 --649484675=land of the dwarves --1789903512=golden touch -1328851780=close_buttons,6 -1080306793=shayzien_march --1339126929=damage -4820960=monkey sadness --1951786153=bone dance -1328851781=close_buttons,7 -939546513=forlorn_homestead --1019905269=shadowland --607416955=prayeron,10 --2048535896=pheasant peasant --1025233830=monkey madness -1121125956=scape soft --1562452687=etcetera -1969878996=emotes,47 -1969878994=emotes,45 --1228279872=ge_icons,3 -1969878995=emotes,46 --1228279871=ge_icons,4 -1969878992=emotes,43 --1228279870=ge_icons,5 -1969878993=emotes,44 -1959803992=invback -399048409=mage arena -1969878990=emotes,41 --47057524=lasting -1969878991=emotes,42 --1228279875=ge_icons,0 --1228279874=ge_icons,1 --1228279873=ge_icons,2 --1860080918=inspiration -1997757502=redstone2 -1997757503=redstone3 --1060046352=tribal2 -1997757501=redstone1 --1701556829=magicoff2,29 -1890607210=magicon2,37 -1890607211=magicon2,38 -1890607212=magicon2,39 --1408684838=ascent --848436598=fishing --119984250=combaticons2,17 --119984251=combaticons2,16 -1769177816=jungle island --119984252=combaticons2,15 --119984253=combaticons2,14 --119984254=combaticons2,13 --119984255=combaticons2,12 --119984256=combaticons2,11 --119984257=combaticons2,10 -1890607205=magicon2,32 -1890607206=magicon2,33 -1890607207=magicon2,34 -1890607208=magicon2,35 -135141185=zeah_combat -1890607209=magicon2,36 --180851958=norse code -112903447=water -922007495=talking forest --672706748=miracle dance --1110089645=lament --1237461365=grotto -1890607203=magicon2,30 -1890607204=magicon2,31 --1073910849=mirror --988841056=still night --1857025509=sunburn --468596910=easter jig -796868952=major miner --1066798491=trawler -1640556978=wonderous --1624274920=emperor -740093634=find my way -1890607238=magicon2,44 -1890607239=magicon2,45 -3559837=tick --1839713245=sideicons -1029455878=hells bells -1890607234=magicon2,40 -1890607235=magicon2,41 -1890607236=magicon2,42 -1890607237=magicon2,43 -1503566841=forbidden --895763669=spooky --276138668=ham attack -500433071=combaticons,5 --1021014225=catch me if you can -500433070=combaticons,4 -500433073=combaticons,7 -500433072=combaticons,6 -500433075=combaticons,9 -1533565119=mind over matter -500433074=combaticons,8 -2025958358=emotes_locked,4 -500433066=combaticons,0 -2025958357=emotes_locked,3 -862821975=far away --1228392498=artistry -2025958356=emotes_locked,2 -500433068=combaticons,2 -2025958355=emotes_locked,1 -500433067=combaticons,1 -1085444827=refresh -500433069=combaticons,3 -2025958359=emotes_locked,5 -1427043851=on the up -2025958354=emotes_locked,0 -1316697938=whistle -347955347=venture -1959211608=mapfunction,77 -1959211609=mapfunction,78 -881850881=the chosen -1959211601=mapfunction,70 -1959211602=mapfunction,71 -584643951=lost soul -582140282=rising damp -1959211603=mapfunction,72 -1740872686=soulfall -1959211604=mapfunction,73 -1959211605=mapfunction,74 --119984248=combaticons2,19 -1959211606=mapfunction,75 --119984249=combaticons2,18 -1609255038=slither and thither -82917947=sarim's vermin -1959211607=mapfunction,76 -1728911401=natural --1189743137=duel arena -108698078=roof2 -214634021=head to head -2025958361=emotes_locked,7 --448773288=isle of everywhere -2025958360=emotes_locked,6 --1869996941=titlebox --338347745=showdown --2075972251=long ago -2025958363=emotes_locked,9 -2025958362=emotes_locked,8 --1487589606=7th realm --1253087691=garden --2133902017=zeah_farming --492926285=impetuous -3314014=lair -907815588=the desert --1960860275=barbarianism -1890607241=magicon2,47 -1890607242=magicon2,48 -1890607243=magicon2,49 --919642451=jungle bells -795515487=underground -561438836=fountain --1418827919=illusive --634763748=fruits de mer -1890607240=magicon2,46 -1694458038=large_button -1393517697=bandit camp -1959211632=mapfunction,80 -1884773718=magicoff2,2 -1884773719=magicoff2,3 -1884773716=magicoff2,0 -2121900771=backtop1 -1884773717=magicoff2,1 --103077377=gnomeball --1947119982=blistering barnacles -828650857=autumn voyage -92909147=alone -1691516951=undead dungeon -122265833=expecting --1320617626=dunjun -1959211633=mapfunction,81 -1959211634=mapfunction,82 -1959211635=mapfunction,83 -1959211636=mapfunction,84 -1959211637=mapfunction,85 -777534707=army of darkness -1959211638=mapfunction,86 -1959211639=mapfunction,87 -1884773721=magicoff2,5 -1884773722=magicoff2,6 -1884773720=magicoff2,4 -1959211640=mapfunction,88 -1959211641=mapfunction,89 --327707013=anywhere -1884773725=magicoff2,9 -1884773723=magicoff2,7 -1884773724=magicoff2,8 -1116844876=incantation --728886272=temple of light -685934899=in the clink --1237289460=grumpy -1945133711=inferno -466902883=strange place --418223472=phasmatys -817472004=zombiism -106578554=zeah_book,0 -106578555=zeah_book,1 -1509070203=eagle peak --485932799=expedition -1171923143=emotes,8 --675357975=attack1 -1171923144=emotes,9 -1959211610=mapfunction,79 --675357974=attack2 --675357973=attack3 --675357972=attack4 --675357971=attack5 -40246002=masquerade --675357970=attack6 --734206983=arrival --1980407601=sea shanty xmas -284435223=pharoah's tomb --148552909=down below -1171923141=emotes,6 -1171923142=emotes,7 -1171923140=emotes,5 --1077789440=mellow --710537653=kingdom -1171923138=emotes,3 -1171923139=emotes,4 -1171923136=emotes,1 --2098286081=venture2 -1171923137=emotes,2 -1171923135=emotes,0 --1094248165=sigmunds showdown --271106892=rat a tat tat -3288564=keys --143163121=ham fisted --900633031=medieval -944208821=life's a beach\! --1228279453=riverside --1666444059=combaticons,10 -825919125=options_icons,24 -825919126=options_icons,25 -1179379180=the trade parade --1666444057=combaticons,12 -825919123=options_icons,22 --1666444058=combaticons,11 -825919124=options_icons,23 -825919121=options_icons,20 -1884768169=magicoff,32 -825919122=options_icons,21 -1884768167=magicoff,30 -1884768168=magicoff,31 -1318818808=chainmail -582031337=intrepid -783525419=beetle juice -432605856=untouchable --969918857=neverland -79789174=narnode's theme --705938181=zealot -117588=web --1666444051=combaticons,18 --1666444052=combaticons,17 -1687654733=troubled --1666444050=combaticons,19 --1666444055=combaticons,14 -825919129=options_icons,28 --1666444056=combaticons,13 --1666444053=combaticons,16 -825919127=options_icons,26 --1666444054=combaticons,15 -825919128=options_icons,27 -1320694328=magical journey -364185053=roll the bones --1254483584=jungly1 -981183822=right on track --1254483583=jungly2 --1254483582=jungly3 -3075958=dark --2038936746=deep down -1512143976=everlasting fire --1392319985=beyond -46273615=tale of keldagrim --651951461=goblin game -3522941=save -104084791=mossy -1250935993=the monsters below -794539501=garden of summer -1814277765=elven mist -2110556093=the golem --1475251658=where eagles lair -1884768143=magicoff,27 -1884768144=magicoff,28 -1884768141=magicoff,25 -1529837717=bubble and squeak -1884768142=magicoff,26 --1679325940=technology -1884768145=magicoff,29 --826562194=troubled_waters -1884768140=magicoff,24 --1359348243=painting1 -1267356434=the power of tears --1359348242=painting2 --860755690=jungle hunt -1884768138=magicoff,22 --1197347961=magic magic magic -1884768139=magicoff,23 -1134405764=hypnotized -1959211539=mapfunction,50 -1381363755=my arms journey --1644401602=complication -1959211540=mapfunction,51 -1959211541=mapfunction,52 -1884768136=magicoff,20 -1959211542=mapfunction,53 -2111304827=warning_icons,0 -1884768137=magicoff,21 --440187560=zogre dance -1959211543=mapfunction,54 -2111304828=warning_icons,1 --2002535437=corridors of power -825919130=options_icons,29 -580384095=jungle troubles -1301622585=slice of station -1959211544=mapfunction,55 -2111304829=warning_icons,2 --1294172031=escape --1309477156=expanse --1526067851=alternative root -2124773424=dynasty -1743765602=leftarrow --1482676188=romancing the crone --1891851953=island of the trolls -736457293=small_button_pressed --1106172890=letter -986170990=dreamstate -1959211545=mapfunction,56 -1959211546=mapfunction,57 -1765722413=spirits of elid -1959211547=mapfunction,58 -1959211548=mapfunction,59 --2075333010=lonesome -3314400=lava -1355033875=worldmap_icon,1 -1814357716=knightmare -1690742645=nox_irae -94935104=cross --1249495153=frogland --1642689926=athletes foot -107944162=quest -1355033874=worldmap_icon,0 --2130741313=joy of the hunt --28982081=labyrinth -250959119=marooned --1522984472=altar_ego -1326424637=the lost melody --1779111734=arabique --398925062=sea shanty2 -1884768110=magicoff,15 -1884768111=magicoff,16 -1817249074=woe of the wyvern -1884768114=magicoff,19 -1884768112=magicoff,17 --1624760229=emotion -1884768113=magicoff,18 --353951458=attention -279431252=garden of autumn -422652266=small_button -1884768107=magicoff,12 -1884768108=magicoff,13 -375695247=the far side -1884768105=magicoff,10 -1884768106=magicoff,11 --528864109=crystal sword -1884768109=magicoff,14 -1959211570=mapfunction,60 --158141423=prayeron,7 --158141424=prayeron,6 -1959211571=mapfunction,61 --158141421=prayeron,9 -1959211572=mapfunction,62 --158141422=prayeron,8 -1959211573=mapfunction,63 -1959211574=mapfunction,64 -688840255=piscarilius_sigil -1959211575=mapfunction,65 -1959211576=mapfunction,66 -1170407052=headicons_prayer -1959211577=mapfunction,67 --324496873=soundscape --1418445703=tex_red -1961540869=wornicons,10 --1028580907=that_sullen_hall -397136995=elfpainting --2092714094=haunted mine -1959211578=mapfunction,68 -1959211579=mapfunction,69 --158141429=prayeron,1 --158141427=prayeron,3 --140492390=bunny_sugar_rush --158141428=prayeron,2 --158141425=prayeron,5 -1827366203=righteousness --649601274=darkness_in_the_depths --158141426=prayeron,4 -1961540870=wornicons,11 --158141430=prayeron,0 -910299584=principality --734028978=arrow,1 --734028979=arrow,0 -790067275=garden of spring -35762567=workshop --1095396929=competition -96463963=egypt --1154441378=jollyr --1685231711=cave background --2078908549=time out --1172405897=wildwood --170561624=spookyjungle -2110231453=mod_icons -2061491048=shining --1063411723=tremble -94627585=chest --520702427=ice melody -1346720899=backleft1 --607416919=prayeron,25 --607416918=prayeron,26 -900197712=staticons,6 --607416917=prayeron,27 -900197713=staticons,7 --607416916=prayeron,28 -900197710=staticons,4 --607416915=prayeron,29 -900197711=staticons,5 -957931606=courage -900197714=staticons,8 -900197715=staticons,9 --720253066=the other side --1655721374=prayeroff,31 --607416921=prayeron,23 --1655721375=prayeroff,30 --607416920=prayeron,24 --710515142=the mad mole --1350228392=stratosphere --1666438445=combaticons2,3 --1666438446=combaticons2,2 --1666438443=combaticons2,5 --1666438444=combaticons2,4 --1106570438=legion --1666438441=combaticons2,7 --1666438442=combaticons2,6 -1398587265=flute salad --1666438440=combaticons2,8 -837223705=mapedge -900197709=staticons,3 --243680393=peng_emotes,7 -900197707=staticons,1 -378300078=everlasting -900197708=staticons,2 --944748869=witching --243680396=peng_emotes,4 --1335336992=logo_deadman_mode --1368714737=small_button_blue --795140435=wander --243680397=peng_emotes,3 --243680394=peng_emotes,6 --1666438447=combaticons2,1 --243680395=peng_emotes,5 --1666438448=combaticons2,0 --243680398=peng_emotes,2 --243680399=peng_emotes,1 --607416924=prayeron,20 -900197706=staticons,0 --607416923=prayeron,21 --607416922=prayeron,22 -3016376=bark --89244313=romper chomper -346288985=dorgeshun deep -1585002399=magicon,21 --1725263140=chef surprize -1585002398=magicon,20 --993528987=making waves --628963539=ham and seek --1666438439=combaticons2,9 --333224315=baroque --1236252722=prime time -280241284=waking dream --564582358=distant land -115411843=castlewars -1513246078=al kharid --1377700863=unknown land -1264132816=miles away -1185785872=barbassault_icons,3 -1185785873=barbassault_icons,4 --1655721397=prayeroff,29 --1655721398=prayeroff,28 -1185785874=barbassault_icons,5 --1655721399=prayeroff,27 -1185785875=barbassault_icons,6 -1711341885=fight or flight -1185785870=barbassault_icons,1 -1185785871=barbassault_icons,2 -3530505=sire --309570839=pick_and_shovel -647234089=distillery hilarity --127408236=gnome_village_party -1337378554=backbase2 -109757537=stars -1337378553=backbase1 -109757538=start -819884325=wilderness3 -1328851775=close_buttons,1 -658759958=side_background -1328851774=close_buttons,0 --782211141=wonder -1328851777=close_buttons,3 --1995718284=wall_white -819884324=wilderness2 -1328851776=close_buttons,2 -1328851779=close_buttons,5 --943885542=scape hunter -1328851778=close_buttons,4 -1185785869=barbassault_icons,0 --607416949=prayeron,16 --607416948=prayeron,17 --1779684630=rune essence --607416947=prayeron,18 --607416946=prayeron,19 -1119460311=bandos battalion --967559823=creature cruelty --1904094243=zeah_fishing --1913214770=wilderness -460367020=village -825919161=options_icons,39 -1585002375=magicon,18 -94839810=coins -1585002376=magicon,19 -825919160=options_icons,38 --1282090556=faerie --521895311=the adventurer -788399136=tree spirits --1902858744=beneath_the_stronghold --356730043=pirates of penance -1185785876=barbassault_icons,7 -825919158=options_icons,36 -825919159=options_icons,37 -825919156=options_icons,34 --1455241861=victory is mine -825919157=options_icons,35 --1333874720=side_icons,17 -825919154=options_icons,32 -825919155=options_icons,33 -825919152=options_icons,30 -825919153=options_icons,31 -1437805631=chatback --1623296531=ground scape -685190118=in the brine -1366257555=nightfall -110327241=theme --1333874725=side_icons,12 --1333874726=side_icons,11 --1333874727=side_icons,10 --1333874721=side_icons,16 --1333874722=side_icons,15 --1124681475=darkly_altared --8976533=throne of the demon --1333874723=side_icons,14 --1333874724=side_icons,13 --1989106719=assault and battery -1958759012=greatness -1057075019=b12_full -1143353537=chain of command --51091830=desert voyage --1073927447=mirage --91048728=number_button -3165239=gaol --1380919269=breeze -445640248=rugged_terrain -106079=key --655784411=overlay_multiway --1025835715=backright2 --1025835716=backright1 -1120933843=scape main -3225350=iban --956253112=title fight --123912401=la mort -1585002367=magicon,10 --2128736428=startgame -1585002368=magicon,11 --925031874=royale -1585002369=magicon,12 -1585002370=magicon,13 -1585002373=magicon,16 -1585002374=magicon,17 --1307116191=superstition -1585002371=magicon,14 -1585002372=magicon,15 --587569902=path of peril -3392903=null --1601127242=inadequacy -2136330800=staticons2,0 -2136330801=staticons2,1 -344336468=grip of the talon -2136330804=staticons2,4 -2136330805=staticons2,5 -2136330802=staticons2,2 -2136330803=staticons2,3 -1960215130=barking mad --43712789=scape original -621171714=cellar song -1585002461=magicon,41 -1585002462=magicon,42 -1585002460=magicon,40 -111485446=upass -2136330808=staticons2,8 -694847251=in the manor -2136330809=staticons2,9 -2136330806=staticons2,6 -2136330807=staticons2,7 --1385847955=rightarrow -1343200077=the slayer -1585002465=magicon,45 -1585002466=magicon,46 -1585002463=magicon,43 -1585002464=magicon,44 -1585002469=magicon,49 --95571520=volcanic vikings -1585002467=magicon,47 -1585002468=magicon,48 --1032629963=shipwrecked -93330745=aztec --881372797=tabs,1 -1377351472=oriental -121641580=headicons_hint --881372798=tabs,0 -1585002438=magicon,39 --1661605940=elfwood --607416893=prayeron,30 --822106577=jungle island xmas --607416892=prayeron,31 -332368736=mad eadgar -1585002432=magicon,33 --143368781=side_background_right -1585002433=magicon,34 --1081494434=malady -1585002430=magicon,31 -1585002431=magicon,32 -1585002436=magicon,37 -1585002437=magicon,38 -1585002434=magicon,35 -1585002435=magicon,36 --1938171360=miscgraphics3,0 --1059680853=trinity -781557721=dies_irae --1938171359=miscgraphics3,1 -497375231=stillness --1938171358=miscgraphics3,2 --1938171357=miscgraphics3,3 --960709976=dogs of war -2129339089=magicon,1 -2129339088=magicon,0 -755433248=headicons_pk -108392383=regal --213632750=waterfall --1367706280=canvas -73828649=settlement -848123561=into the abyss -478781900=last stand -1339486127=the shadow --1055503808=roc and roll -837204902=mapdots -950484242=compass --1082154559=fanfare -747848680=nether_realm -788224888=dead quiet -1532279978=monarch waltz --149029727=side_background_left1 -812947089=fanfare2 --149029726=side_background_left2 -1006643748=high spirits --2136059388=starlight -2122572442=the tower --1998869913=spooky2 -1411067174=gnome village2 --2065077267=wild side -812947090=fanfare3 -1585002429=magicon,30 -1294629755=on the wing -2097127567=monkey badness --2032107216=sojourn -1020264019=pest control -3237038=info -1473393027=fe fi fo fum --1686202291=upper_depths -3540994=stop -1742080803=darkwood -740392969=little cave of horrors --158379532=prayerglow --691855347=in between --200702983=the noble rodent -1652745754=forgotten --1895307673=hitmark,3 --1895307674=hitmark,2 --1895307675=hitmark,1 --1895307676=hitmark,0 --1895307670=hitmark,6 --1895307671=hitmark,5 --1895307672=hitmark,4 -1968917071=bone dry --850506182=trawler minor -197029040=mapscene --808772318=in the pits --1165315580=looking back --1763090403=scape_ape --1938177931=miscgraphics,11 --1938177932=miscgraphics,10 -1936130561=thrall_of_the_serpent -1258863383=yesteryear -1994744000=slice of silent movie --1691854169=dead can dance -1585002407=magicon,29 -1585002405=magicon,27 -1585002406=magicon,28 -271319484=frostbite --499867199=meridian -1585002400=magicon,22 --1938177930=miscgraphics,12 --84626226=mudskipper melody -1585002403=magicon,25 -1585002404=magicon,26 -3641802=wall -1585002401=magicon,23 -1585002402=magicon,24 --606457701=wolf mountain -1276599785=button_brown -1969878899=emotes,13 -1969878897=emotes,11 -1969878898=emotes,12 -1969878896=emotes,10 --1938177928=miscgraphics,14 --907669678=brew hoo hoo --1938177929=miscgraphics,13 -72999866=subterranea -619237947=the galleon --1764950404=scape sad -295831445=heart and mind -908430134=dangerous road -738888631=tradebacking --174800339=verdana_11pt_regular -686705631=lightwalk --601591436=side_background_bottom --1479412376=the navigator --359173459=zamorak zoo -744536246=null and void --1701556798=magicoff2,39 --1701556799=magicoff2,38 --1396384012=bamboo --200388662=lighthouse -133626717=suspicious --810515425=voyage -3061973=crag -1802291895=big chords --1661619479=elfwall -113315621=wood2 -1813041183=steelborder2,0 -429244831=slug a bug ball -1813041184=steelborder2,1 --1658386264=shining_spirit -738909086=chamber -526264239=verdana_13pt_regular --877351859=temple -2142215577=the mollusc menace -1124498189=warpath --2136649922=no way out --339706871=grimly_fiendish -547534551=wrath and ruin -544229147=lore and order -3327206=load -1610073470=lovakengj_sigil --419218284=long way home --662489856=food for thought -1306461568=stagnant --1662171955=elfdoor --1043985601=meddling kids -947464074=titlebutton --1309055712=exposed --1487348923=ambient jungle --1829469821=lament of meiyerditch -233203434=leftarrow_small --1216167350=dangerous -114464611=railings --1106574323=legend --1701556767=magicoff2,49 --999707515=time to mine --1701556768=magicoff2,48 -2129339097=magicon,9 -2129339096=magicon,8 -1959211510=mapfunction,42 -2129339095=magicon,7 -1959211511=mapfunction,43 -2129339094=magicon,6 -2129339093=magicon,5 -2129339092=magicon,4 -2129339091=magicon,3 -2129339090=magicon,2 -3522472=saga --1701556769=magicoff2,47 --544722449=rellekka -1033441676=tribal background -1915718129=the desolate isle -1890607150=magicon2,19 -1787618597=stranded -1717999087=forgettable melody -1959211512=mapfunction,44 --243680400=peng_emotes,0 -1959211513=mapfunction,45 -1959211514=mapfunction,46 -1959211515=mapfunction,47 -1959211516=mapfunction,48 -1959211517=mapfunction,49 -1705947058=the cellar dwellers -1216634785=landlubber -1884768198=magicoff,40 --1588113323=the rogues den -1884768199=magicoff,41 --905842564=serene --607599698=prayeroff,2 --607599699=prayeroff,1 -1890607142=magicon2,11 -1389384362=monkey trouble -1890607143=magicon2,12 -1890607144=magicon2,13 -1890607145=magicon2,14 -1890607146=magicon2,15 -1890607147=magicon2,16 -1890607148=magicon2,17 -1966766798=mausoleum -1890607149=magicon2,18 -1808345541=armadyl alliance -290391725=options_slider,7 -1890607141=magicon2,10 -290391722=options_slider,4 --607599696=prayeroff,4 -290391721=options_slider,3 --607599697=prayeroff,3 -290391724=options_slider,6 --607599694=prayeroff,6 -290391723=options_slider,5 --607599695=prayeroff,5 --607599692=prayeroff,8 --607599693=prayeroff,7 -290391720=options_slider,2 --607599691=prayeroff,9 -1334775925=chat_background --1779127378=arabian2 --1779127377=arabian3 -528722471=island life -1890607175=magicon2,23 -1890607176=magicon2,24 -949634504=mouse trap -1890607177=magicon2,25 -1890607178=magicon2,26 -1890607179=magicon2,27 -3327403=logo -290391719=options_slider,1 -1092249049=storm brew -290391718=options_slider,0 -404357804=everywhere -1890607172=magicon2,20 -1890607173=magicon2,21 -951530772=contest -1890607174=magicon2,22 --1701556776=magicoff2,40 -1884768176=magicoff,39 --395250469=corporal punishment -1749113330=newbie melody -1884768174=magicoff,37 -1884768175=magicoff,38 --1701556772=magicoff2,44 --1701556773=magicoff2,43 --1701556774=magicoff2,42 --1701556775=magicoff2,41 --858121616=tzhaar -1884768172=magicoff,35 -1884768173=magicoff,36 -666772244=combat_shield -1884768170=magicoff,33 -1884768171=magicoff,34 -1959211509=mapfunction,41 -1639695510=mapmarker --1661748240=friends_icons --552301350=knightly --1918044851=mastermindless --1701556770=magicoff2,46 --1701556771=magicoff2,45 -201526300=corporealbeast -1959211508=mapfunction,40 -105001967=nomad --70910145=clickcross,3 --1737914947=mapfunction,5 -1801745440=staticons2,11 --70910146=clickcross,2 --865479038=tribal --1737914946=mapfunction,6 -1801745441=staticons2,12 --70910147=clickcross,1 --1737914945=mapfunction,7 -1801745442=staticons2,13 --70910148=clickcross,0 --1737914944=mapfunction,8 -1801745443=staticons2,14 --1737914943=mapfunction,9 -1801745444=staticons2,15 -1801745445=staticons2,16 -1801745446=staticons2,17 --1877545169=land down under -93921962=books --1737914949=mapfunction,3 --1737914948=mapfunction,4 --1655721428=prayeroff,19 --2136884405=title.jpg --1655721429=prayeroff,18 -1584819628=magicoff,6 -1584819629=magicoff,7 -437480876=voodoo cult -1584819624=magicoff,2 -1584819625=magicoff,3 -1584819626=magicoff,4 --1737914952=mapfunction,0 -1584819627=magicoff,5 --1737914951=mapfunction,1 -124995564=harmony2 -1584819622=magicoff,0 -1801745439=staticons2,10 -1584819623=magicoff,1 -346263512=dorgeshun city --1665011705=down and out -1890607180=magicon2,28 -1890607181=magicon2,29 -1417471781=titlescroll -1959211446=mapfunction,20 -1956141536=options_radio_buttons,0 -736568812=ballad of enchantment --1737914950=mapfunction,2 -1959211447=mapfunction,21 -1959211448=mapfunction,22 -1959211449=mapfunction,23 --1890130256=morytania --70910141=clickcross,7 --70910142=clickcross,6 -1956141539=options_radio_buttons,3 --70910143=clickcross,5 -1956141538=options_radio_buttons,2 -284766976=splendour --70910144=clickcross,4 -1956141537=options_radio_buttons,1 -196677638=the quizmaster -530068296=overture --1123094568=sl_button --700552779=hosidius_sigil --614076819=sad meadow -1956141543=options_radio_buttons,7 -1956141542=options_radio_buttons,6 -1956141541=options_radio_buttons,5 -1956141540=options_radio_buttons,4 -1584819631=magicoff,9 -1846633612=gnome village --2128560371=sl_back -1969878905=emotes,19 -306819362=crystal castle -1584819630=magicoff,8 -1969878903=emotes,17 -303737220=options_icons,7 -1969878904=emotes,18 -1969878901=emotes,15 --78220817=devils_may_care -1969878902=emotes,16 --40521666=dimension x -1969878900=emotes,14 -673424924=the lunar isle -789609582=brimstail's scales -303737222=options_icons,9 -303737221=options_icons,8 -1959211415=mapfunction,10 -3059343=coil -1959211416=mapfunction,11 -1959211417=mapfunction,12 --1256560486=last_man_standing -1959211418=mapfunction,13 -336238005=rightarrow_small -1959211419=mapfunction,14 --677662361=forever --1655721430=prayeroff,17 --1655721431=prayeroff,16 --1655721432=prayeroff,15 -1959211420=mapfunction,15 -1959211663=mapfunction,90 -1959211421=mapfunction,16 -1959211422=mapfunction,17 -1959211423=mapfunction,18 -303737217=options_icons,4 -303737216=options_icons,3 -303737215=options_icons,2 --1665005042=funny bunnies -303737214=options_icons,1 -303737219=options_icons,6 -303737218=options_icons,5 -303737213=options_icons,0 -95997798=we are the fairies -2001751835=desert heat -1959211424=mapfunction,19 --1655721437=prayeroff,10 -687938017=clanwars --1776024210=desolate_mage --650944128=strength of saradomin --1655721433=prayeroff,14 -1160873524=aye car rum ba --1655721434=prayeroff,13 --1655721435=prayeroff,12 --1081314499=marble --1655721436=prayeroff,11 -1097075475=reset,0 -1959211477=mapfunction,30 --693313916=warriors guild -3506388=roof -1959211478=mapfunction,31 -1097075476=reset,1 --2134967800=dagannoth dawn --985763247=planks -1959211479=mapfunction,32 -1999746381=fenkenstrain's refrain -898010371=garden of winter -359174830=rat hunt -1959211482=mapfunction,35 -686441581=lightness -1959211483=mapfunction,36 -1959211484=mapfunction,37 -1959211485=mapfunction,38 -1959211486=mapfunction,39 -2023201035=dwarf theme -1959211480=mapfunction,33 -1959211481=mapfunction,34 --1065532022=combatboxes,1 --1065532021=combatboxes,2 --1065532020=combatboxes,3 -1867160429=old_tiles -394756979=scape santa -25205919=elfroof2 --663428071=dangerous way --1065532023=combatboxes,0 -1959211450=mapfunction,24 --895939599=spirit -1959211451=mapfunction,25 -1959211452=mapfunction,26 -1959211453=mapfunction,27 -1959211454=mapfunction,28 -1959211455=mapfunction,29 --275310687=undercurrent -212205923=goblin village --303898981=faithless --1381531001=tomb raider -260940912=marzipan -1343267530=backhmid1 -1343267531=backhmid2 -1097468315=horizon --1655721404=prayeroff,22 -623451622=kourend_the_magnificent --1655721405=prayeroff,21 --1655721406=prayeroff,20 --1655721400=prayeroff,26 --313384067=p12_full --1655721401=prayeroff,25 --1655721402=prayeroff,24 --1655721403=prayeroff,23 -95848451=dream -1966781751=maws_jaws_claws --995428255=parade -95734525=method of madness --1308064877=hitmarks -1030045177=mutant medley -1333034828=blackmark -851641665=davy jones locker -417793574=scrollbar -1346720900=backleft2 -1884768206=magicoff,48 -1884768207=magicoff,49 -1801140808=fangs for the memory -1884768204=magicoff,46 -1345432055=pinball wizard -1884768205=magicoff,47 --783693496=dance of the undead -1274780903=chompy hunt -465278529=the lost tribe --1666437481=combaticons3,6 -2032696205=cabin fever --1666437480=combaticons3,7 -1825640471=borderland -415928477=zeah_mining -1884768202=magicoff,44 --607599700=prayeroff,0 -1884768203=magicoff,45 -1884768200=magicoff,42 -1884768201=magicoff,43 --1666437487=combaticons3,0 --1666437486=combaticons3,1 -813726263=crystal cave -1235442953=pathways -518814479=lullaby --1666437483=combaticons3,4 -1585007985=magicon2,7 --1666437482=combaticons3,5 -1585007986=magicon2,8 --1666437485=combaticons3,2 -1585007987=magicon2,9 --1666437484=combaticons3,3 -104080482=moody -1969878967=emotes,39 --665666447=work work work -1364992651=evil bobs island -1969878965=emotes,37 -1227328817=verdana_15pt_regular -1969878966=emotes,38 -1969878963=emotes,35 -1581724013=monkey business -1969878964=emotes,36 --74307138=miscellania -1969878961=emotes,33 -1969878962=emotes,34 -1969878960=emotes,32 -1131171307=wayward --1154558416=sl_arrows -529929957=overpass -1258058669=huffman --694094064=adventure -1171698653=orb_xp,1 -1171698652=orb_xp,0 -1171698655=orb_xp,3 -1171698654=orb_xp,2 -1802171733=arceuus_sigil -221109227=tears of guthix --1661754893=elfroof --1666437478=combaticons3,9 -1124565314=warrior -1969878958=emotes,30 -1969878959=emotes,31 --934797897=reggae -2110260221=the genie --1666437479=combaticons3,8 -104257585=mummy --1923924724=sworddecor,0 -2136325196=staticons,17 --1332194002=background -2136164423=homescape --1923924721=sworddecor,3 -2136325194=staticons,15 --1923924722=sworddecor,2 --873564465=tiptoe -2136325195=staticons,16 --1923924723=sworddecor,1 -123560953=espionage -2136325192=staticons,13 -2136325193=staticons,14 -1038911415=gnome king -2136325190=staticons,11 -2136325191=staticons,12 -1854274741=karamja jam -1969878989=emotes,40 --1242708793=glyphs -563269755=the terrible tower -1650323088=twilight --12868552=sea shanty -289742397=book of spells -1880989696=dragontooth island -2136325189=staticons,10 -110873=pen --454421102=out of the deep -825919099=options_icons,19 -825919097=options_icons,17 -825919098=options_icons,18 --1349119470=cursed -1585007978=magicon2,0 -825919095=options_icons,15 -1585007979=magicon2,1 -825919096=options_icons,16 -825919093=options_icons,13 -825919094=options_icons,14 -825919091=options_icons,11 -825919092=options_icons,12 --895977880=sphinx --874529881=city of the dead -825919090=options_icons,10 -1585007981=magicon2,3 -1585007982=magicon2,4 -1585007983=magicon2,5 --1618729246=body parts -1585007984=magicon2,6 -1585007980=magicon2,2 -1086075866=shayzien_sigil -2103661451=jester minute --911346307=steelborder,2 --1809781334=button_brown_big --911346306=steelborder,3 --816227352=vision --911346309=steelborder,0 -109407595=shine --911346308=steelborder,1 --119954464=combaticons3,12 --119954465=combaticons3,11 --1846853118=armageddon --119954462=combaticons3,14 --119954463=combaticons3,13 --119954460=combaticons3,16 --908183966=scarab --119954461=combaticons3,15 --282886672=home sweet home -103666243=march -1969878929=emotes,22 -1643875326=fire and brimstone -1969878927=emotes,20 --119954466=combaticons3,10 -1969878928=emotes,21 --839455633=close quarters -941457503=way of the enchanter --1453405761=mor-ul-rek --415134015=have a blast --1658514874=floating free -1213477442=chickened out --1619800349=emotes_locked,27 --599680631=fear and loathing --1081041422=insect queen --1268786147=forest --119954459=combaticons3,17 --119954457=combaticons3,19 --119954458=combaticons3,18 --850395529=trouble brewing --1773920521=cave of the goblins --771284962=claustrophobia -1310729739=bankbuttons,2 -1306691868=upcoming -1465443077=over to nardah -1310729744=bankbuttons,7 -1310729743=bankbuttons,6 -1310729742=bankbuttons,5 -1234827707=deep wildy --90350772=xenophobe --750127868=arabian -1310729741=bankbuttons,4 -1310729740=bankbuttons,3 -1041911129=waterlogged -108875897=runes -1447063382=barb wire --378865792=magic dance -285466503=overlay_duel -1814287296=zeah_magic -1976894499=down to earth -1969878936=emotes,29 -1969878934=emotes,27 --1567437308=deadlands -1969878935=emotes,28 -1310729738=bankbuttons,1 -1969878932=emotes,25 --957019274=too many cooks -1310729737=bankbuttons,0 -2092627105=silence -1969878933=emotes,26 -1969878930=emotes,23 -1969878931=emotes,24 --901674570=well of voyage +#Wed Nov 29 15:08:06 PST 2017 +-1863637185=miscgraphics,4 +-1863637184=miscgraphics,5 +-1863637187=miscgraphics,2 +-1863637186=miscgraphics,3 +-1863637181=miscgraphics,8 +-1863637180=miscgraphics,9 +-440204630=alls fairy in love n war +-1863637183=miscgraphics,6 +-1253085654=scorpia_dances +-1863637182=miscgraphics,7 +1356196826=backvmid3 +-751102526=high seas +1356196825=backvmid2 +-1863637189=miscgraphics,0 +549358875=camelot +-1863637188=miscgraphics,1 +-1619800378=emotes_locked,19 +-1619800379=emotes_locked,18 +792536868=understanding +1356196824=backvmid1 +-1773559904=title_mute +-342013218=p11_full +1523653533=pirates of peril +696768774=harmony +-1701556831=magicoff2,27 +281586976=orb_icon,3 +286265996=ready for battle +-1701556832=magicoff2,26 +281586977=orb_icon,4 +-645977478=scape scared +-1701556833=magicoff2,25 +281586978=orb_icon,5 +-1701556834=magicoff2,24 +-1701556830=magicoff2,28 +-1052794696=dance of death +-1619800383=emotes_locked,14 +-1619800384=emotes_locked,13 +-1619800385=emotes_locked,12 +-1556842207=sl_flags +-1619800386=emotes_locked,11 +1614826739=mapletree +-1619800387=emotes_locked,10 +-1701556835=magicoff2,23 +-1701556836=magicoff2,22 +1363656441=serenade +-1701556837=magicoff2,21 +3089326=door +-1701556838=magicoff2,20 +-1619800380=emotes_locked,17 +-1619800381=emotes_locked,16 +-1619800382=emotes_locked,15 +-1037172987=tomorrow +825974316=melodrama +281586973=orb_icon,0 +281586974=orb_icon,1 +281586975=orb_icon,2 +-1701556864=magicoff2,15 +-1701556865=magicoff2,14 +-1701556866=magicoff2,13 +1509400204=sarcophagus +-1701556867=magicoff2,12 +-1701556860=magicoff2,19 +-1701556861=magicoff2,18 +-1701556862=magicoff2,17 +1868377358=lower_depths +-1701556863=magicoff2,16 +1086036315=reggae2 +-1220755677=hermit +-1544597765=sl_stars +-1619800350=emotes_locked,26 +-1619800351=emotes_locked,25 +-1636062434=tex_brown +-1619800352=emotes_locked,24 +-1619800353=emotes_locked,23 +-2122174648=back to life +-1619800354=emotes_locked,22 +-1701556868=magicoff2,11 +-1619800355=emotes_locked,21 +-1701556869=magicoff2,10 +-1619800356=emotes_locked,20 +1619539773=side_icons,7 +1121239524=scape wild +368271413=diango's little helpers +1619539772=side_icons,6 +1619539775=side_icons,9 +1619539774=side_icons,8 +-1938172321=miscgraphics2,0 +1619539771=side_icons,5 +1619539770=side_icons,4 +-926977577=the enchanter +1202794514=doorways +1343649581=schools out +-1097177625=q8_full +756012174=wornicons,4 +756012173=wornicons,3 +756012176=wornicons,6 +756012175=wornicons,5 +756012170=wornicons,0 +827249681=ogre the top +756012172=wornicons,2 +756012171=wornicons,1 +-1741764817=poles apart +756012178=wornicons,8 +-1938172320=miscgraphics2,1 +756012177=wornicons,7 +-43136286=the last shanty +756012179=wornicons,9 +837131331=mapback +-1938172313=miscgraphics2,8 +907740319=the depths +-1938172312=miscgraphics2,9 +-2099722614=cave of beasts +-1938172317=miscgraphics2,4 +-1938172316=miscgraphics2,5 +-1938172315=miscgraphics2,6 +-1938172314=miscgraphics2,7 +1619539769=side_icons,3 +-1367483767=cavern +-1938172319=miscgraphics2,2 +50474489=treestump +-1938172318=miscgraphics2,3 +1619539766=side_icons,0 +1619539768=side_icons,2 +1619539767=side_icons,1 +-607416954=prayeron,11 +1837251043=melzars maze +-607416953=prayeron,12 +1318893900=have an ice day +-607416952=prayeron,13 +-1701556800=magicoff2,37 +-607416951=prayeron,14 +-1701556801=magicoff2,36 +-56804840=woodland +-607416950=prayeron,15 +1120636327=scape cave +358884868=button_red +-1701556806=magicoff2,31 +-1701556807=magicoff2,30 +-1701556802=magicoff2,35 +-1701556803=magicoff2,34 +-1701556804=magicoff2,33 +-1858265682=monster melee +-1701556805=magicoff2,32 +-649484675=land of the dwarves +-1789903512=golden touch +1328851780=close_buttons,6 +1080306793=shayzien_march +-1339126929=damage +4820960=monkey sadness +-1951786153=bone dance +1328851781=close_buttons,7 +939546513=forlorn_homestead +-1019905269=shadowland +-607416955=prayeron,10 +-2048535896=pheasant peasant +-1025233830=monkey madness +1121125956=scape soft +-1562452687=etcetera +1969878996=emotes,47 +1969878994=emotes,45 +-1228279872=ge_icons,3 +1969878995=emotes,46 +-1228279871=ge_icons,4 +1969878992=emotes,43 +-1228279870=ge_icons,5 +1969878993=emotes,44 +1959803992=invback +399048409=mage arena +1969878990=emotes,41 +-47057524=lasting +1969878991=emotes,42 +-1228279875=ge_icons,0 +-1228279874=ge_icons,1 +-1228279873=ge_icons,2 +-1860080918=inspiration +1997757502=redstone2 +1997757503=redstone3 +-1060046352=tribal2 +1997757501=redstone1 +-1701556829=magicoff2,29 +1890607210=magicon2,37 +1890607211=magicon2,38 +1890607212=magicon2,39 +-1408684838=ascent +-848436598=fishing +-119984250=combaticons2,17 +-119984251=combaticons2,16 +1769177816=jungle island +-119984252=combaticons2,15 +-119984253=combaticons2,14 +-119984254=combaticons2,13 +-119984255=combaticons2,12 +-119984256=combaticons2,11 +-119984257=combaticons2,10 +1890607205=magicon2,32 +1890607206=magicon2,33 +1890607207=magicon2,34 +1890607208=magicon2,35 +135141185=zeah_combat +1890607209=magicon2,36 +-180851958=norse code +112903447=water +922007495=talking forest +-672706748=miracle dance +-1110089645=lament +-1237461365=grotto +1890607203=magicon2,30 +1890607204=magicon2,31 +-1073910849=mirror +-988841056=still night +-1857025509=sunburn +-468596910=easter jig +796868952=major miner +-1066798491=trawler +1640556978=wonderous +-1624274920=emperor +740093634=find my way +1890607238=magicon2,44 +1890607239=magicon2,45 +3559837=tick +-1839713245=sideicons +1029455878=hells bells +1890607234=magicon2,40 +1890607235=magicon2,41 +1890607236=magicon2,42 +1890607237=magicon2,43 +1503566841=forbidden +-895763669=spooky +-276138668=ham attack +500433071=combaticons,5 +-1021014225=catch me if you can +500433070=combaticons,4 +500433073=combaticons,7 +500433072=combaticons,6 +500433075=combaticons,9 +1533565119=mind over matter +500433074=combaticons,8 +2025958358=emotes_locked,4 +500433066=combaticons,0 +2025958357=emotes_locked,3 +862821975=far away +-1228392498=artistry +2025958356=emotes_locked,2 +500433068=combaticons,2 +2025958355=emotes_locked,1 +500433067=combaticons,1 +1085444827=refresh +500433069=combaticons,3 +2025958359=emotes_locked,5 +1427043851=on the up +2025958354=emotes_locked,0 +1316697938=whistle +347955347=venture +1959211608=mapfunction,77 +1959211609=mapfunction,78 +881850881=the chosen +1959211601=mapfunction,70 +1959211602=mapfunction,71 +584643951=lost soul +582140282=rising damp +1959211603=mapfunction,72 +1740872686=soulfall +1959211604=mapfunction,73 +1959211605=mapfunction,74 +-119984248=combaticons2,19 +1959211606=mapfunction,75 +-119984249=combaticons2,18 +1609255038=slither and thither +82917947=sarim's vermin +1959211607=mapfunction,76 +1728911401=natural +-1189743137=duel arena +108698078=roof2 +214634021=head to head +2025958361=emotes_locked,7 +-448773288=isle of everywhere +2025958360=emotes_locked,6 +-1869996941=titlebox +-338347745=showdown +-2075972251=long ago +2025958363=emotes_locked,9 +2025958362=emotes_locked,8 +-1487589606=7th realm +-1253087691=garden +-2133902017=zeah_farming +-492926285=impetuous +3314014=lair +907815588=the desert +-1960860275=barbarianism +1890607241=magicon2,47 +1890607242=magicon2,48 +1890607243=magicon2,49 +-919642451=jungle bells +795515487=underground +561438836=fountain +-1418827919=illusive +-634763748=fruits de mer +1890607240=magicon2,46 +1694458038=large_button +1393517697=bandit camp +1959211632=mapfunction,80 +1884773718=magicoff2,2 +1884773719=magicoff2,3 +1884773716=magicoff2,0 +2121900771=backtop1 +1884773717=magicoff2,1 +-103077377=gnomeball +-1947119982=blistering barnacles +828650857=autumn voyage +92909147=alone +1691516951=undead dungeon +122265833=expecting +-1320617626=dunjun +1959211633=mapfunction,81 +1959211634=mapfunction,82 +1959211635=mapfunction,83 +1959211636=mapfunction,84 +1959211637=mapfunction,85 +777534707=army of darkness +1959211638=mapfunction,86 +1959211639=mapfunction,87 +1884773721=magicoff2,5 +1884773722=magicoff2,6 +1884773720=magicoff2,4 +1959211640=mapfunction,88 +1959211641=mapfunction,89 +-327707013=anywhere +1884773725=magicoff2,9 +1884773723=magicoff2,7 +1884773724=magicoff2,8 +1116844876=incantation +-728886272=temple of light +685934899=in the clink +-1237289460=grumpy +1945133711=inferno +466902883=strange place +-418223472=phasmatys +817472004=zombiism +106578554=zeah_book,0 +106578555=zeah_book,1 +1509070203=eagle peak +-485932799=expedition +1171923143=emotes,8 +-675357975=attack1 +1171923144=emotes,9 +1959211610=mapfunction,79 +-675357974=attack2 +-675357973=attack3 +-675357972=attack4 +-675357971=attack5 +40246002=masquerade +-675357970=attack6 +-734206983=arrival +-1980407601=sea shanty xmas +284435223=pharoah's tomb +-148552909=down below +1171923141=emotes,6 +1171923142=emotes,7 +1171923140=emotes,5 +-1077789440=mellow +-710537653=kingdom +1171923138=emotes,3 +1171923139=emotes,4 +1171923136=emotes,1 +-2098286081=venture2 +1171923137=emotes,2 +1171923135=emotes,0 +-1094248165=sigmunds showdown +-271106892=rat a tat tat +3288564=keys +-143163121=ham fisted +-900633031=medieval +944208821=life's a beach\! +-1228279453=riverside +-1666444059=combaticons,10 +825919125=options_icons,24 +825919126=options_icons,25 +1179379180=the trade parade +-1666444057=combaticons,12 +825919123=options_icons,22 +-1666444058=combaticons,11 +825919124=options_icons,23 +825919121=options_icons,20 +1884768169=magicoff,32 +825919122=options_icons,21 +1884768167=magicoff,30 +1884768168=magicoff,31 +1318818808=chainmail +582031337=intrepid +783525419=beetle juice +432605856=untouchable +-969918857=neverland +79789174=narnode's theme +-705938181=zealot +117588=web +-1666444051=combaticons,18 +-1666444052=combaticons,17 +1687654733=troubled +-1666444050=combaticons,19 +-1666444055=combaticons,14 +825919129=options_icons,28 +-1666444056=combaticons,13 +-1666444053=combaticons,16 +825919127=options_icons,26 +-1666444054=combaticons,15 +825919128=options_icons,27 +1320694328=magical journey +364185053=roll the bones +-1254483584=jungly1 +981183822=right on track +-1254483583=jungly2 +-1254483582=jungly3 +3075958=dark +-2038936746=deep down +1512143976=everlasting fire +-1392319985=beyond +46273615=tale of keldagrim +-651951461=goblin game +3522941=save +104084791=mossy +1250935993=the monsters below +794539501=garden of summer +1814277765=elven mist +2110556093=the golem +-1475251658=where eagles lair +1884768143=magicoff,27 +1884768144=magicoff,28 +1884768141=magicoff,25 +1529837717=bubble and squeak +1884768142=magicoff,26 +-1679325940=technology +1884768145=magicoff,29 +-826562194=troubled_waters +1884768140=magicoff,24 +-1359348243=painting1 +1267356434=the power of tears +-1359348242=painting2 +-860755690=jungle hunt +1884768138=magicoff,22 +-1197347961=magic magic magic +1884768139=magicoff,23 +1134405764=hypnotized +1959211539=mapfunction,50 +1381363755=my arms journey +-1644401602=complication +1959211540=mapfunction,51 +1959211541=mapfunction,52 +1884768136=magicoff,20 +1959211542=mapfunction,53 +2111304827=warning_icons,0 +1884768137=magicoff,21 +-440187560=zogre dance +1959211543=mapfunction,54 +2111304828=warning_icons,1 +-2002535437=corridors of power +825919130=options_icons,29 +580384095=jungle troubles +1301622585=slice of station +1959211544=mapfunction,55 +2111304829=warning_icons,2 +-1294172031=escape +-1309477156=expanse +-1526067851=alternative root +2124773424=dynasty +1743765602=leftarrow +-1482676188=romancing the crone +-1891851953=island of the trolls +736457293=small_button_pressed +-1106172890=letter +986170990=dreamstate +1959211545=mapfunction,56 +1959211546=mapfunction,57 +1765722413=spirits of elid +1959211547=mapfunction,58 +1959211548=mapfunction,59 +-2075333010=lonesome +3314400=lava +1355033875=worldmap_icon,1 +1814357716=knightmare +1690742645=nox_irae +94935104=cross +-1249495153=frogland +-1642689926=athletes foot +107944162=quest +1355033874=worldmap_icon,0 +-2130741313=joy of the hunt +-28982081=labyrinth +250959119=marooned +-1522984472=altar_ego +1326424637=the lost melody +-1779111734=arabique +-398925062=sea shanty2 +1884768110=magicoff,15 +1884768111=magicoff,16 +1817249074=woe of the wyvern +1884768114=magicoff,19 +1884768112=magicoff,17 +-1624760229=emotion +1884768113=magicoff,18 +-353951458=attention +279431252=garden of autumn +422652266=small_button +1884768107=magicoff,12 +1884768108=magicoff,13 +375695247=the far side +1884768105=magicoff,10 +1884768106=magicoff,11 +-528864109=crystal sword +1884768109=magicoff,14 +1959211570=mapfunction,60 +-158141423=prayeron,7 +-158141424=prayeron,6 +1959211571=mapfunction,61 +-158141421=prayeron,9 +1959211572=mapfunction,62 +-158141422=prayeron,8 +1959211573=mapfunction,63 +1959211574=mapfunction,64 +688840255=piscarilius_sigil +1959211575=mapfunction,65 +1959211576=mapfunction,66 +1170407052=headicons_prayer +1959211577=mapfunction,67 +-324496873=soundscape +-1418445703=tex_red +1961540869=wornicons,10 +-1028580907=that_sullen_hall +397136995=elfpainting +-2092714094=haunted mine +1959211578=mapfunction,68 +1959211579=mapfunction,69 +-158141429=prayeron,1 +-158141427=prayeron,3 +-140492390=bunny_sugar_rush +-158141428=prayeron,2 +-158141425=prayeron,5 +1827366203=righteousness +-649601274=darkness_in_the_depths +-158141426=prayeron,4 +1961540870=wornicons,11 +-158141430=prayeron,0 +910299584=principality +-734028978=arrow,1 +-734028979=arrow,0 +790067275=garden of spring +35762567=workshop +-1095396929=competition +96463963=egypt +-1154441378=jollyr +-1685231711=cave background +-2078908549=time out +-1172405897=wildwood +-170561624=spookyjungle +2110231453=mod_icons +2061491048=shining +-1063411723=tremble +94627585=chest +-520702427=ice melody +1346720899=backleft1 +-607416919=prayeron,25 +-607416918=prayeron,26 +900197712=staticons,6 +-607416917=prayeron,27 +900197713=staticons,7 +-607416916=prayeron,28 +900197710=staticons,4 +-607416915=prayeron,29 +900197711=staticons,5 +957931606=courage +900197714=staticons,8 +900197715=staticons,9 +-720253066=the other side +-1655721374=prayeroff,31 +-607416921=prayeron,23 +-1655721375=prayeroff,30 +-607416920=prayeron,24 +-710515142=the mad mole +-1350228392=stratosphere +-1666438445=combaticons2,3 +-1666438446=combaticons2,2 +-1666438443=combaticons2,5 +-1666438444=combaticons2,4 +-1106570438=legion +-1666438441=combaticons2,7 +-1666438442=combaticons2,6 +1398587265=flute salad +-1666438440=combaticons2,8 +837223705=mapedge +900197709=staticons,3 +-243680393=peng_emotes,7 +900197707=staticons,1 +378300078=everlasting +900197708=staticons,2 +-944748869=witching +-243680396=peng_emotes,4 +-1335336992=logo_deadman_mode +-1368714737=small_button_blue +-795140435=wander +-243680397=peng_emotes,3 +-243680394=peng_emotes,6 +-1666438447=combaticons2,1 +-243680395=peng_emotes,5 +-1666438448=combaticons2,0 +-243680398=peng_emotes,2 +-243680399=peng_emotes,1 +-607416924=prayeron,20 +900197706=staticons,0 +-607416923=prayeron,21 +-607416922=prayeron,22 +3016376=bark +-89244313=romper chomper +346288985=dorgeshun deep +1585002399=magicon,21 +-1725263140=chef surprize +1585002398=magicon,20 +-993528987=making waves +-628963539=ham and seek +-1666438439=combaticons2,9 +-333224315=baroque +-1236252722=prime time +280241284=waking dream +-564582358=distant land +115411843=castlewars +1513246078=al kharid +-1377700863=unknown land +1264132816=miles away +1185785872=barbassault_icons,3 +1185785873=barbassault_icons,4 +-1655721397=prayeroff,29 +-1655721398=prayeroff,28 +1185785874=barbassault_icons,5 +-1655721399=prayeroff,27 +1185785875=barbassault_icons,6 +1711341885=fight or flight +1185785870=barbassault_icons,1 +1185785871=barbassault_icons,2 +3530505=sire +-309570839=pick_and_shovel +647234089=distillery hilarity +-127408236=gnome_village_party +1337378554=backbase2 +109757537=stars +1337378553=backbase1 +109757538=start +819884325=wilderness3 +1328851775=close_buttons,1 +658759958=side_background +1328851774=close_buttons,0 +-782211141=wonder +1328851777=close_buttons,3 +-1995718284=wall_white +819884324=wilderness2 +1328851776=close_buttons,2 +1328851779=close_buttons,5 +-943885542=scape hunter +1328851778=close_buttons,4 +1185785869=barbassault_icons,0 +-607416949=prayeron,16 +-607416948=prayeron,17 +-1779684630=rune essence +-607416947=prayeron,18 +-607416946=prayeron,19 +1119460311=bandos battalion +-967559823=creature cruelty +-1904094243=zeah_fishing +-1913214770=wilderness +460367020=village +825919161=options_icons,39 +1585002375=magicon,18 +94839810=coins +1585002376=magicon,19 +825919160=options_icons,38 +-1282090556=faerie +-521895311=the adventurer +788399136=tree spirits +-1902858744=beneath_the_stronghold +-356730043=pirates of penance +1185785876=barbassault_icons,7 +825919158=options_icons,36 +825919159=options_icons,37 +825919156=options_icons,34 +-1455241861=victory is mine +825919157=options_icons,35 +-1333874720=side_icons,17 +825919154=options_icons,32 +825919155=options_icons,33 +825919152=options_icons,30 +825919153=options_icons,31 +1437805631=chatback +-1623296531=ground scape +685190118=in the brine +1366257555=nightfall +110327241=theme +-1333874725=side_icons,12 +-1333874726=side_icons,11 +-1333874727=side_icons,10 +-1333874721=side_icons,16 +-1333874722=side_icons,15 +-1124681475=darkly_altared +-8976533=throne of the demon +-1333874723=side_icons,14 +-1333874724=side_icons,13 +-1989106719=assault and battery +1958759012=greatness +1057075019=b12_full +1143353537=chain of command +-51091830=desert voyage +-1073927447=mirage +-91048728=number_button +3165239=gaol +-1380919269=breeze +445640248=rugged_terrain +106079=key +-655784411=overlay_multiway +-1025835715=backright2 +-1025835716=backright1 +1120933843=scape main +3225350=iban +-956253112=title fight +-123912401=la mort +1585002367=magicon,10 +-2128736428=startgame +1585002368=magicon,11 +-925031874=royale +1585002369=magicon,12 +1585002370=magicon,13 +1585002373=magicon,16 +1585002374=magicon,17 +-1307116191=superstition +1585002371=magicon,14 +1585002372=magicon,15 +-587569902=path of peril +3392903=null +-1601127242=inadequacy +2136330800=staticons2,0 +2136330801=staticons2,1 +344336468=grip of the talon +2136330804=staticons2,4 +2136330805=staticons2,5 +2136330802=staticons2,2 +2136330803=staticons2,3 +1960215130=barking mad +-43712789=scape original +621171714=cellar song +1585002461=magicon,41 +1585002462=magicon,42 +1585002460=magicon,40 +111485446=upass +2136330808=staticons2,8 +694847251=in the manor +2136330809=staticons2,9 +2136330806=staticons2,6 +2136330807=staticons2,7 +-1385847955=rightarrow +1343200077=the slayer +1585002465=magicon,45 +1585002466=magicon,46 +1585002463=magicon,43 +1585002464=magicon,44 +1585002469=magicon,49 +-95571520=volcanic vikings +1585002467=magicon,47 +1585002468=magicon,48 +-1032629963=shipwrecked +93330745=aztec +-881372797=tabs,1 +1377351472=oriental +121641580=headicons_hint +-881372798=tabs,0 +1585002438=magicon,39 +-1661605940=elfwood +-607416893=prayeron,30 +-822106577=jungle island xmas +-607416892=prayeron,31 +332368736=mad eadgar +1585002432=magicon,33 +-143368781=side_background_right +1585002433=magicon,34 +-1081494434=malady +1585002430=magicon,31 +1585002431=magicon,32 +1585002436=magicon,37 +1585002437=magicon,38 +1585002434=magicon,35 +1585002435=magicon,36 +-1938171360=miscgraphics3,0 +-1059680853=trinity +781557721=dies_irae +-1938171359=miscgraphics3,1 +497375231=stillness +-1938171358=miscgraphics3,2 +-1938171357=miscgraphics3,3 +-960709976=dogs of war +2129339089=magicon,1 +2129339088=magicon,0 +755433248=headicons_pk +108392383=regal +-213632750=waterfall +-1367706280=canvas +73828649=settlement +848123561=into the abyss +478781900=last stand +1339486127=the shadow +-1055503808=roc and roll +837204902=mapdots +950484242=compass +-1082154559=fanfare +747848680=nether_realm +788224888=dead quiet +1532279978=monarch waltz +-149029727=side_background_left1 +812947089=fanfare2 +-149029726=side_background_left2 +1006643748=high spirits +-2136059388=starlight +2122572442=the tower +-1998869913=spooky2 +1411067174=gnome village2 +-2065077267=wild side +812947090=fanfare3 +1585002429=magicon,30 +1294629755=on the wing +2097127567=monkey badness +-2032107216=sojourn +1020264019=pest control +3237038=info +1473393027=fe fi fo fum +-1686202291=upper_depths +3540994=stop +1742080803=darkwood +740392969=little cave of horrors +-158379532=prayerglow +-691855347=in between +-200702983=the noble rodent +1652745754=forgotten +-1895307673=hitmark,3 +-1895307674=hitmark,2 +-1895307675=hitmark,1 +-1895307676=hitmark,0 +-1895307670=hitmark,6 +-1895307671=hitmark,5 +-1895307672=hitmark,4 +1968917071=bone dry +-850506182=trawler minor +197029040=mapscene +-808772318=in the pits +-1165315580=looking back +-1763090403=scape_ape +-1938177931=miscgraphics,11 +-1938177932=miscgraphics,10 +1936130561=thrall_of_the_serpent +1258863383=yesteryear +1994744000=slice of silent movie +-1691854169=dead can dance +1585002407=magicon,29 +1585002405=magicon,27 +1585002406=magicon,28 +271319484=frostbite +-499867199=meridian +1585002400=magicon,22 +-1938177930=miscgraphics,12 +-84626226=mudskipper melody +1585002403=magicon,25 +1585002404=magicon,26 +3641802=wall +1585002401=magicon,23 +1585002402=magicon,24 +-606457701=wolf mountain +1276599785=button_brown +1969878899=emotes,13 +1969878897=emotes,11 +1969878898=emotes,12 +1969878896=emotes,10 +-1938177928=miscgraphics,14 +-907669678=brew hoo hoo +-1938177929=miscgraphics,13 +72999866=subterranea +619237947=the galleon +-1764950404=scape sad +295831445=heart and mind +908430134=dangerous road +738888631=tradebacking +-174800339=verdana_11pt_regular +686705631=lightwalk +-601591436=side_background_bottom +-1479412376=the navigator +-359173459=zamorak zoo +744536246=null and void +-1701556798=magicoff2,39 +-1701556799=magicoff2,38 +-1396384012=bamboo +-200388662=lighthouse +133626717=suspicious +-810515425=voyage +3061973=crag +1802291895=big chords +-1661619479=elfwall +113315621=wood2 +1813041183=steelborder2,0 +429244831=slug a bug ball +1813041184=steelborder2,1 +-1658386264=shining_spirit +738909086=chamber +526264239=verdana_13pt_regular +-877351859=temple +2142215577=the mollusc menace +1124498189=warpath +-2136649922=no way out +-339706871=grimly_fiendish +547534551=wrath and ruin +544229147=lore and order +3327206=load +1610073470=lovakengj_sigil +-419218284=long way home +-662489856=food for thought +1306461568=stagnant +-1662171955=elfdoor +-1043985601=meddling kids +947464074=titlebutton +-1309055712=exposed +-1487348923=ambient jungle +-1829469821=lament of meiyerditch +233203434=leftarrow_small +-1216167350=dangerous +114464611=railings +-1106574323=legend +-1701556767=magicoff2,49 +-999707515=time to mine +-1701556768=magicoff2,48 +2129339097=magicon,9 +2129339096=magicon,8 +1959211510=mapfunction,42 +2129339095=magicon,7 +1959211511=mapfunction,43 +2129339094=magicon,6 +2129339093=magicon,5 +2129339092=magicon,4 +2129339091=magicon,3 +2129339090=magicon,2 +3522472=saga +-1701556769=magicoff2,47 +-544722449=rellekka +1033441676=tribal background +1915718129=the desolate isle +1890607150=magicon2,19 +1787618597=stranded +1717999087=forgettable melody +1959211512=mapfunction,44 +-243680400=peng_emotes,0 +1959211513=mapfunction,45 +1959211514=mapfunction,46 +1959211515=mapfunction,47 +1959211516=mapfunction,48 +1959211517=mapfunction,49 +1705947058=the cellar dwellers +1216634785=landlubber +1884768198=magicoff,40 +-1588113323=the rogues den +1884768199=magicoff,41 +-905842564=serene +-607599698=prayeroff,2 +-607599699=prayeroff,1 +1890607142=magicon2,11 +1389384362=monkey trouble +1890607143=magicon2,12 +1890607144=magicon2,13 +1890607145=magicon2,14 +1890607146=magicon2,15 +1890607147=magicon2,16 +1890607148=magicon2,17 +1966766798=mausoleum +1890607149=magicon2,18 +1808345541=armadyl alliance +290391725=options_slider,7 +1890607141=magicon2,10 +290391722=options_slider,4 +-607599696=prayeroff,4 +290391721=options_slider,3 +-607599697=prayeroff,3 +290391724=options_slider,6 +-607599694=prayeroff,6 +290391723=options_slider,5 +-607599695=prayeroff,5 +-607599692=prayeroff,8 +-607599693=prayeroff,7 +290391720=options_slider,2 +-607599691=prayeroff,9 +1334775925=chat_background +-1779127378=arabian2 +-1779127377=arabian3 +528722471=island life +1890607175=magicon2,23 +1890607176=magicon2,24 +949634504=mouse trap +1890607177=magicon2,25 +1890607178=magicon2,26 +1890607179=magicon2,27 +3327403=logo +290391719=options_slider,1 +1092249049=storm brew +290391718=options_slider,0 +404357804=everywhere +1890607172=magicon2,20 +1890607173=magicon2,21 +951530772=contest +1890607174=magicon2,22 +-1701556776=magicoff2,40 +1884768176=magicoff,39 +-395250469=corporal punishment +1749113330=newbie melody +1884768174=magicoff,37 +1884768175=magicoff,38 +-1701556772=magicoff2,44 +-1701556773=magicoff2,43 +-1701556774=magicoff2,42 +-1701556775=magicoff2,41 +-858121616=tzhaar +1884768172=magicoff,35 +1884768173=magicoff,36 +666772244=combat_shield +1884768170=magicoff,33 +1884768171=magicoff,34 +1959211509=mapfunction,41 +1639695510=mapmarker +-1661748240=friends_icons +-552301350=knightly +-1918044851=mastermindless +-1701556770=magicoff2,46 +-1701556771=magicoff2,45 +201526300=corporealbeast +1959211508=mapfunction,40 +105001967=nomad +-70910145=clickcross,3 +-1737914947=mapfunction,5 +1801745440=staticons2,11 +-70910146=clickcross,2 +-865479038=tribal +-1737914946=mapfunction,6 +1801745441=staticons2,12 +-70910147=clickcross,1 +-1737914945=mapfunction,7 +1801745442=staticons2,13 +-70910148=clickcross,0 +-1737914944=mapfunction,8 +1801745443=staticons2,14 +-1737914943=mapfunction,9 +1801745444=staticons2,15 +1801745445=staticons2,16 +1801745446=staticons2,17 +-1877545169=land down under +93921962=books +-1737914949=mapfunction,3 +-1737914948=mapfunction,4 +-1655721428=prayeroff,19 +-2136884405=title.jpg +-1655721429=prayeroff,18 +1584819628=magicoff,6 +1584819629=magicoff,7 +437480876=voodoo cult +1584819624=magicoff,2 +1584819625=magicoff,3 +1584819626=magicoff,4 +-1737914952=mapfunction,0 +1584819627=magicoff,5 +-1737914951=mapfunction,1 +124995564=harmony2 +1584819622=magicoff,0 +1801745439=staticons2,10 +1584819623=magicoff,1 +346263512=dorgeshun city +-1665011705=down and out +1890607180=magicon2,28 +1890607181=magicon2,29 +1417471781=titlescroll +1959211446=mapfunction,20 +1956141536=options_radio_buttons,0 +736568812=ballad of enchantment +-1737914950=mapfunction,2 +1959211447=mapfunction,21 +1959211448=mapfunction,22 +1959211449=mapfunction,23 +-1890130256=morytania +-70910141=clickcross,7 +-70910142=clickcross,6 +1956141539=options_radio_buttons,3 +-70910143=clickcross,5 +1956141538=options_radio_buttons,2 +284766976=splendour +-70910144=clickcross,4 +1956141537=options_radio_buttons,1 +196677638=the quizmaster +530068296=overture +-1123094568=sl_button +-700552779=hosidius_sigil +-614076819=sad meadow +1956141543=options_radio_buttons,7 +1956141542=options_radio_buttons,6 +1956141541=options_radio_buttons,5 +1956141540=options_radio_buttons,4 +1584819631=magicoff,9 +1846633612=gnome village +-2128560371=sl_back +1969878905=emotes,19 +306819362=crystal castle +1584819630=magicoff,8 +1969878903=emotes,17 +303737220=options_icons,7 +1969878904=emotes,18 +1969878901=emotes,15 +-78220817=devils_may_care +1969878902=emotes,16 +-40521666=dimension x +1969878900=emotes,14 +673424924=the lunar isle +789609582=brimstail's scales +303737222=options_icons,9 +303737221=options_icons,8 +1959211415=mapfunction,10 +3059343=coil +1959211416=mapfunction,11 +1959211417=mapfunction,12 +-1256560486=last_man_standing +1959211418=mapfunction,13 +336238005=rightarrow_small +1959211419=mapfunction,14 +-677662361=forever +-1655721430=prayeroff,17 +-1655721431=prayeroff,16 +-1655721432=prayeroff,15 +1959211420=mapfunction,15 +1959211663=mapfunction,90 +1959211421=mapfunction,16 +1959211422=mapfunction,17 +1959211423=mapfunction,18 +303737217=options_icons,4 +303737216=options_icons,3 +303737215=options_icons,2 +-1665005042=funny bunnies +303737214=options_icons,1 +303737219=options_icons,6 +303737218=options_icons,5 +303737213=options_icons,0 +95997798=we are the fairies +2001751835=desert heat +1959211424=mapfunction,19 +-1655721437=prayeroff,10 +687938017=clanwars +-1776024210=desolate_mage +-650944128=strength of saradomin +-1655721433=prayeroff,14 +1160873524=aye car rum ba +-1655721434=prayeroff,13 +-1655721435=prayeroff,12 +-1081314499=marble +-1655721436=prayeroff,11 +1097075475=reset,0 +1959211477=mapfunction,30 +-693313916=warriors guild +3506388=roof +1959211478=mapfunction,31 +1097075476=reset,1 +-2134967800=dagannoth dawn +-985763247=planks +1959211479=mapfunction,32 +1999746381=fenkenstrain's refrain +898010371=garden of winter +359174830=rat hunt +1959211482=mapfunction,35 +686441581=lightness +1959211483=mapfunction,36 +1959211484=mapfunction,37 +1959211485=mapfunction,38 +1959211486=mapfunction,39 +2023201035=dwarf theme +1959211480=mapfunction,33 +1959211481=mapfunction,34 +-1065532022=combatboxes,1 +-1065532021=combatboxes,2 +-1065532020=combatboxes,3 +1867160429=old_tiles +394756979=scape santa +25205919=elfroof2 +-663428071=dangerous way +-1065532023=combatboxes,0 +1959211450=mapfunction,24 +-895939599=spirit +1959211451=mapfunction,25 +1959211452=mapfunction,26 +1959211453=mapfunction,27 +1959211454=mapfunction,28 +1959211455=mapfunction,29 +-275310687=undercurrent +212205923=goblin village +-303898981=faithless +-1381531001=tomb raider +260940912=marzipan +1343267530=backhmid1 +1343267531=backhmid2 +1097468315=horizon +-1655721404=prayeroff,22 +623451622=kourend_the_magnificent +-1655721405=prayeroff,21 +-1655721406=prayeroff,20 +-1655721400=prayeroff,26 +-313384067=p12_full +-1655721401=prayeroff,25 +-1655721402=prayeroff,24 +-1655721403=prayeroff,23 +95848451=dream +1966781751=maws_jaws_claws +-995428255=parade +95734525=method of madness +-1308064877=hitmarks +1030045177=mutant medley +1333034828=blackmark +851641665=davy jones locker +417793574=scrollbar +1346720900=backleft2 +1884768206=magicoff,48 +1884768207=magicoff,49 +1801140808=fangs for the memory +1884768204=magicoff,46 +1345432055=pinball wizard +1884768205=magicoff,47 +-783693496=dance of the undead +1274780903=chompy hunt +465278529=the lost tribe +-1666437481=combaticons3,6 +2032696205=cabin fever +-1666437480=combaticons3,7 +1825640471=borderland +415928477=zeah_mining +1884768202=magicoff,44 +-607599700=prayeroff,0 +1884768203=magicoff,45 +1884768200=magicoff,42 +1884768201=magicoff,43 +-1666437487=combaticons3,0 +-1666437486=combaticons3,1 +813726263=crystal cave +1235442953=pathways +518814479=lullaby +-1666437483=combaticons3,4 +1585007985=magicon2,7 +-1666437482=combaticons3,5 +1585007986=magicon2,8 +-1666437485=combaticons3,2 +1585007987=magicon2,9 +-1666437484=combaticons3,3 +104080482=moody +1969878967=emotes,39 +-665666447=work work work +1364992651=evil bobs island +1969878965=emotes,37 +1227328817=verdana_15pt_regular +1969878966=emotes,38 +1969878963=emotes,35 +1581724013=monkey business +1969878964=emotes,36 +-74307138=miscellania +1969878961=emotes,33 +1969878962=emotes,34 +1969878960=emotes,32 +1131171307=wayward +-1154558416=sl_arrows +529929957=overpass +1258058669=huffman +-694094064=adventure +1171698653=orb_xp,1 +1171698652=orb_xp,0 +1171698655=orb_xp,3 +1171698654=orb_xp,2 +1802171733=arceuus_sigil +221109227=tears of guthix +-1661754893=elfroof +-1666437478=combaticons3,9 +1124565314=warrior +1969878958=emotes,30 +1969878959=emotes,31 +-934797897=reggae +2110260221=the genie +-1666437479=combaticons3,8 +104257585=mummy +-1923924724=sworddecor,0 +2136325196=staticons,17 +-1332194002=background +2136164423=homescape +-1923924721=sworddecor,3 +2136325194=staticons,15 +-1923924722=sworddecor,2 +-873564465=tiptoe +2136325195=staticons,16 +-1923924723=sworddecor,1 +123560953=espionage +2136325192=staticons,13 +2136325193=staticons,14 +1038911415=gnome king +2136325190=staticons,11 +2136325191=staticons,12 +1854274741=karamja jam +1969878989=emotes,40 +-1242708793=glyphs +563269755=the terrible tower +1650323088=twilight +-12868552=sea shanty +289742397=book of spells +1880989696=dragontooth island +2136325189=staticons,10 +110873=pen +-454421102=out of the deep +825919099=options_icons,19 +825919097=options_icons,17 +825919098=options_icons,18 +-1349119470=cursed +1585007978=magicon2,0 +825919095=options_icons,15 +1585007979=magicon2,1 +825919096=options_icons,16 +825919093=options_icons,13 +825919094=options_icons,14 +825919091=options_icons,11 +825919092=options_icons,12 +-895977880=sphinx +-874529881=city of the dead +825919090=options_icons,10 +1585007981=magicon2,3 +1585007982=magicon2,4 +1585007983=magicon2,5 +-1618729246=body parts +1585007984=magicon2,6 +1585007980=magicon2,2 +1086075866=shayzien_sigil +2103661451=jester minute +-911346307=steelborder,2 +-1809781334=button_brown_big +-911346306=steelborder,3 +-816227352=vision +-911346309=steelborder,0 +109407595=shine +-911346308=steelborder,1 +-119954464=combaticons3,12 +-119954465=combaticons3,11 +-1846853118=armageddon +-119954462=combaticons3,14 +-119954463=combaticons3,13 +-119954460=combaticons3,16 +-908183966=scarab +-119954461=combaticons3,15 +-282886672=home sweet home +103666243=march +1969878929=emotes,22 +1643875326=fire and brimstone +1969878927=emotes,20 +-119954466=combaticons3,10 +1969878928=emotes,21 +-839455633=close quarters +941457503=way of the enchanter +-1453405761=mor-ul-rek +-415134015=have a blast +-1658514874=floating free +1213477442=chickened out +-1619800349=emotes_locked,27 +-599680631=fear and loathing +-1081041422=insect queen +-1268786147=forest +-119954459=combaticons3,17 +-119954457=combaticons3,19 +-119954458=combaticons3,18 +-850395529=trouble brewing +-1773920521=cave of the goblins +-771284962=claustrophobia +1310729739=bankbuttons,2 +1306691868=upcoming +1465443077=over to nardah +1310729744=bankbuttons,7 +1310729743=bankbuttons,6 +1310729742=bankbuttons,5 +1234827707=deep wildy +-90350772=xenophobe +-750127868=arabian +1310729741=bankbuttons,4 +1310729740=bankbuttons,3 +1041911129=waterlogged +108875897=runes +1447063382=barb wire +-378865792=magic dance +285466503=overlay_duel +1814287296=zeah_magic +1976894499=down to earth +1969878936=emotes,29 +1969878934=emotes,27 +-1567437308=deadlands +1969878935=emotes,28 +1310729738=bankbuttons,1 +1969878932=emotes,25 +-957019274=too many cooks +1310729737=bankbuttons,0 +2092627105=silence +1969878933=emotes,26 +1969878930=emotes,23 +1969878931=emotes,24 +-901674570=well of voyage diff --git a/cache/src/test/java/net/runelite/cache/definitions/savers/InterfaceSaverTest.java b/cache/src/test/java/net/runelite/cache/definitions/savers/InterfaceSaverTest.java index 6d95f445a9..e1955a6f79 100644 --- a/cache/src/test/java/net/runelite/cache/definitions/savers/InterfaceSaverTest.java +++ b/cache/src/test/java/net/runelite/cache/definitions/savers/InterfaceSaverTest.java @@ -1,65 +1,65 @@ -/* - * Copyright (c) 2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.cache.definitions.savers; - -import java.io.File; -import net.runelite.cache.IndexType; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.definitions.InterfaceDefinition; -import net.runelite.cache.definitions.loaders.InterfaceLoader; -import net.runelite.cache.fs.Archive; -import net.runelite.cache.fs.ArchiveFiles; -import net.runelite.cache.fs.FSFile; -import net.runelite.cache.fs.Index; -import net.runelite.cache.fs.Storage; -import net.runelite.cache.fs.Store; -import static org.junit.Assert.assertArrayEquals; -import org.junit.Test; - -public class InterfaceSaverTest -{ - @Test - public void testSave() throws Exception - { - File base = StoreLocation.LOCATION; - try (Store store = new Store(base)) - { - store.load(); - - Storage storage = store.getStorage(); - Index index = store.getIndex(IndexType.INTERFACES); - Archive archive = index.getArchive(31); - byte[] archiveData = storage.loadArchive(archive); - ArchiveFiles files = archive.getFiles(archiveData); - FSFile file = files.findFile(76); - byte[] contents = file.getContents(); - - InterfaceDefinition def = new InterfaceLoader().load(0, contents); - byte[] b = new InterfaceSaver().save(def); - assertArrayEquals(contents, b); - } - } - -} +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.definitions.savers; + +import java.io.File; +import net.runelite.cache.IndexType; +import net.runelite.cache.StoreLocation; +import net.runelite.cache.definitions.InterfaceDefinition; +import net.runelite.cache.definitions.loaders.InterfaceLoader; +import net.runelite.cache.fs.Archive; +import net.runelite.cache.fs.ArchiveFiles; +import net.runelite.cache.fs.FSFile; +import net.runelite.cache.fs.Index; +import net.runelite.cache.fs.Storage; +import net.runelite.cache.fs.Store; +import static org.junit.Assert.assertArrayEquals; +import org.junit.Test; + +public class InterfaceSaverTest +{ + @Test + public void testSave() throws Exception + { + File base = StoreLocation.LOCATION; + try (Store store = new Store(base)) + { + store.load(); + + Storage storage = store.getStorage(); + Index index = store.getIndex(IndexType.INTERFACES); + Archive archive = index.getArchive(31); + byte[] archiveData = storage.loadArchive(archive); + ArchiveFiles files = archive.getFiles(archiveData); + FSFile file = files.findFile(76); + byte[] contents = file.getContents(); + + InterfaceDefinition def = new InterfaceLoader().load(0, contents); + byte[] b = new InterfaceSaver().save(def); + assertArrayEquals(contents, b); + } + } + +} diff --git a/cache/src/test/java/net/runelite/cache/definitions/savers/ScriptSaverTest.java b/cache/src/test/java/net/runelite/cache/definitions/savers/ScriptSaverTest.java index a2b55676bd..4d429632ca 100644 --- a/cache/src/test/java/net/runelite/cache/definitions/savers/ScriptSaverTest.java +++ b/cache/src/test/java/net/runelite/cache/definitions/savers/ScriptSaverTest.java @@ -1,66 +1,66 @@ -/* - * Copyright (c) 2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.cache.definitions.savers; - -import java.io.IOException; -import net.runelite.cache.definitions.ScriptDefinition; -import net.runelite.cache.definitions.loaders.ScriptLoader; -import net.runelite.cache.script.Instructions; -import net.runelite.cache.script.assembler.Assembler; -import static org.junit.Assert.assertEquals; -import org.junit.Test; - -/** - * - * @author Adam - */ -public class ScriptSaverTest -{ - private static final String SCRIPT_RESOURCE = "/net/runelite/cache/script/assembler/91.rs2asm"; - private static final String SCRIPT_RESOURCE_UNICODE = "/net/runelite/cache/script/assembler/Unicode.rs2asm"; - - @Test - public void testSave() throws IOException - { - Instructions instructions = new Instructions(); - instructions.init(); - ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE)); - byte[] saved = new ScriptSaver().save(script); - ScriptDefinition loadedScripot = new ScriptLoader().load(91, saved); - assertEquals(script, loadedScripot); - } - - @Test - public void testSaveUnicode() throws IOException - { - Instructions instructions = new Instructions(); - instructions.init(); - ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE_UNICODE)); - byte[] saved = new ScriptSaver().save(script); - ScriptDefinition loadedScripot = new ScriptLoader().load(1001, saved); - assertEquals(script, loadedScripot); - } - -} +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.definitions.savers; + +import java.io.IOException; +import net.runelite.cache.definitions.ScriptDefinition; +import net.runelite.cache.definitions.loaders.ScriptLoader; +import net.runelite.cache.script.Instructions; +import net.runelite.cache.script.assembler.Assembler; +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +/** + * + * @author Adam + */ +public class ScriptSaverTest +{ + private static final String SCRIPT_RESOURCE = "/net/runelite/cache/script/assembler/91.rs2asm"; + private static final String SCRIPT_RESOURCE_UNICODE = "/net/runelite/cache/script/assembler/Unicode.rs2asm"; + + @Test + public void testSave() throws IOException + { + Instructions instructions = new Instructions(); + instructions.init(); + ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE)); + byte[] saved = new ScriptSaver().save(script); + ScriptDefinition loadedScripot = new ScriptLoader().load(91, saved); + assertEquals(script, loadedScripot); + } + + @Test + public void testSaveUnicode() throws IOException + { + Instructions instructions = new Instructions(); + instructions.init(); + ScriptDefinition script = new Assembler(instructions).assemble(getClass().getResourceAsStream(SCRIPT_RESOURCE_UNICODE)); + byte[] saved = new ScriptSaver().save(script); + ScriptDefinition loadedScripot = new ScriptLoader().load(1001, saved); + assertEquals(script, loadedScripot); + } + +} diff --git a/cache/src/test/java/net/runelite/cache/fs/ContainerTest.java b/cache/src/test/java/net/runelite/cache/fs/ContainerTest.java index 1aca0df4ba..113385909b 100644 --- a/cache/src/test/java/net/runelite/cache/fs/ContainerTest.java +++ b/cache/src/test/java/net/runelite/cache/fs/ContainerTest.java @@ -1,55 +1,55 @@ -/* - * Copyright (c) 2016-2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.cache.fs; - -import java.io.IOException; -import java.util.Random; -import static net.runelite.cache.fs.jagex.CompressionType.GZ; -import static org.junit.Assert.assertArrayEquals; -import org.junit.Test; - -public class ContainerTest -{ - - @Test - public void testCompress() throws IOException - { - int[] keys = new int[] - { - 4, 8, 15, 16 - }; - Random random = new Random(42L); - byte[] data = new byte[1024]; - random.nextBytes(data); - - Container container = new Container(GZ, -1); - container.compress(data, keys); - byte[] compressedData = container.data; - - container = Container.decompress(compressedData, keys); - assertArrayEquals(data, container.data); - } - -} +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.fs; + +import java.io.IOException; +import java.util.Random; +import static net.runelite.cache.fs.jagex.CompressionType.GZ; +import static org.junit.Assert.assertArrayEquals; +import org.junit.Test; + +public class ContainerTest +{ + + @Test + public void testCompress() throws IOException + { + int[] keys = new int[] + { + 4, 8, 15, 16 + }; + Random random = new Random(42L); + byte[] data = new byte[1024]; + random.nextBytes(data); + + Container container = new Container(GZ, -1); + container.compress(data, keys); + byte[] compressedData = container.data; + + container = Container.decompress(compressedData, keys); + assertArrayEquals(data, container.data); + } + +} diff --git a/cache/src/test/java/net/runelite/cache/fs/jagex/DiskStorageTest.java b/cache/src/test/java/net/runelite/cache/fs/jagex/DiskStorageTest.java index 6d6035a61e..240b7c67d7 100644 --- a/cache/src/test/java/net/runelite/cache/fs/jagex/DiskStorageTest.java +++ b/cache/src/test/java/net/runelite/cache/fs/jagex/DiskStorageTest.java @@ -1,102 +1,102 @@ -/* - * Copyright (c) 2016-2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.cache.fs.jagex; - -import java.io.File; -import net.runelite.cache.StoreLocation; -import net.runelite.cache.fs.Archive; -import net.runelite.cache.fs.Container; -import net.runelite.cache.fs.Index; -import net.runelite.cache.fs.Store; -import net.runelite.cache.index.FileData; -import org.junit.Test; -import static org.junit.Assert.*; -import org.junit.Rule; -import org.junit.rules.TemporaryFolder; - -public class DiskStorageTest -{ - @Rule - public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); - - @Test - public void testSaveArchive() throws Exception - { - File file = folder.newFolder(); - DiskStorage storage = new DiskStorage(file); - Archive archive; - Archive archive2; - try (Store store = new Store(storage)) - { - Index index = store.addIndex(0); - archive = index.addArchive(0); - archive2 = index.addArchive(1); - - FileData[] fileData = new FileData[1]; - archive.setFileData(fileData); - fileData[0] = new FileData(); - - FileData[] fileData2 = new FileData[1]; - archive2.setFileData(fileData2); - fileData2[0] = new FileData(); - - byte[] data = "test".getBytes(); - Container container = new Container(archive.getCompression(), -1); - container.compress(data, null); - byte[] compressedData = container.data; - storage.saveArchive(archive, compressedData); - - container = new Container(archive.getCompression(), 42); - container.compress(data, null); - compressedData = container.data; - archive2.setRevision(42); - storage.saveArchive(archive2, compressedData); - - store.save(); - } - - storage = new DiskStorage(file); - try (Store store = new Store(storage)) - { - store.load(); - Index index = store.findIndex(0); - Archive archive2_1 = index.getArchive(0); - Archive archive2_2 = index.getArchive(1); - - byte[] comprsesedData = storage.loadArchive(archive2_1); - byte[] data = archive2_1.decompress(comprsesedData); - assertArrayEquals("test".getBytes(), data); - assertEquals(archive.getCrc(), archive2_1.getCrc()); - assertEquals(archive.getRevision(), archive2_1.getRevision()); - - comprsesedData = storage.loadArchive(archive2_2); - data = archive2_2.decompress(comprsesedData); - assertArrayEquals("test".getBytes(), data); - assertEquals(archive2.getCrc(), archive2_2.getCrc()); - assertEquals(archive2.getRevision(), archive2_2.getRevision()); - } - } - -} +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.fs.jagex; + +import java.io.File; +import net.runelite.cache.StoreLocation; +import net.runelite.cache.fs.Archive; +import net.runelite.cache.fs.Container; +import net.runelite.cache.fs.Index; +import net.runelite.cache.fs.Store; +import net.runelite.cache.index.FileData; +import org.junit.Test; +import static org.junit.Assert.*; +import org.junit.Rule; +import org.junit.rules.TemporaryFolder; + +public class DiskStorageTest +{ + @Rule + public TemporaryFolder folder = StoreLocation.getTemporaryFolder(); + + @Test + public void testSaveArchive() throws Exception + { + File file = folder.newFolder(); + DiskStorage storage = new DiskStorage(file); + Archive archive; + Archive archive2; + try (Store store = new Store(storage)) + { + Index index = store.addIndex(0); + archive = index.addArchive(0); + archive2 = index.addArchive(1); + + FileData[] fileData = new FileData[1]; + archive.setFileData(fileData); + fileData[0] = new FileData(); + + FileData[] fileData2 = new FileData[1]; + archive2.setFileData(fileData2); + fileData2[0] = new FileData(); + + byte[] data = "test".getBytes(); + Container container = new Container(archive.getCompression(), -1); + container.compress(data, null); + byte[] compressedData = container.data; + storage.saveArchive(archive, compressedData); + + container = new Container(archive.getCompression(), 42); + container.compress(data, null); + compressedData = container.data; + archive2.setRevision(42); + storage.saveArchive(archive2, compressedData); + + store.save(); + } + + storage = new DiskStorage(file); + try (Store store = new Store(storage)) + { + store.load(); + Index index = store.findIndex(0); + Archive archive2_1 = index.getArchive(0); + Archive archive2_2 = index.getArchive(1); + + byte[] comprsesedData = storage.loadArchive(archive2_1); + byte[] data = archive2_1.decompress(comprsesedData); + assertArrayEquals("test".getBytes(), data); + assertEquals(archive.getCrc(), archive2_1.getCrc()); + assertEquals(archive.getRevision(), archive2_1.getRevision()); + + comprsesedData = storage.loadArchive(archive2_2); + data = archive2_2.decompress(comprsesedData); + assertArrayEquals("test".getBytes(), data); + assertEquals(archive2.getCrc(), archive2_2.getCrc()); + assertEquals(archive2.getRevision(), archive2_2.getRevision()); + } + } + +} diff --git a/cache/src/test/java/net/runelite/cache/io/OutputStreamTest.java b/cache/src/test/java/net/runelite/cache/io/OutputStreamTest.java index 42bbc238bb..8fd46d9137 100644 --- a/cache/src/test/java/net/runelite/cache/io/OutputStreamTest.java +++ b/cache/src/test/java/net/runelite/cache/io/OutputStreamTest.java @@ -1,59 +1,59 @@ -/* - * Copyright (c) 2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.cache.io; - -import static org.junit.Assert.assertEquals; -import org.junit.Test; - -public class OutputStreamTest -{ - @Test - public void testWriteBigSmart() - { - OutputStream os = new OutputStream(); - os.writeBigSmart(42); - os.writeBigSmart(70000); - os.writeBigSmart(65535); - - InputStream is = new InputStream(os.getArray()); - assertEquals(42, is.readBigSmart()); - assertEquals(70000, is.readBigSmart()); - assertEquals(65535, is.readBigSmart()); - } - - @Test - public void testWriteString() - { - char[] c = new char[]{32, 160}; - String str = new String(c, 0, c.length); - - OutputStream os = new OutputStream(); - os.writeString(str); - - // 1 byte length + 32 + 160 - assertEquals(3, os.getOffset()); - } - -} +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.io; + +import static org.junit.Assert.assertEquals; +import org.junit.Test; + +public class OutputStreamTest +{ + @Test + public void testWriteBigSmart() + { + OutputStream os = new OutputStream(); + os.writeBigSmart(42); + os.writeBigSmart(70000); + os.writeBigSmart(65535); + + InputStream is = new InputStream(os.getArray()); + assertEquals(42, is.readBigSmart()); + assertEquals(70000, is.readBigSmart()); + assertEquals(65535, is.readBigSmart()); + } + + @Test + public void testWriteString() + { + char[] c = new char[]{32, 160}; + String str = new String(c, 0, c.length); + + OutputStream os = new OutputStream(); + os.writeString(str); + + // 1 byte length + 32 + 160 + assertEquals(3, os.getOffset()); + } + +} diff --git a/cache/src/test/java/net/runelite/cache/util/Djb2Test.java b/cache/src/test/java/net/runelite/cache/util/Djb2Test.java index 5c3933b69d..49fb44df11 100644 --- a/cache/src/test/java/net/runelite/cache/util/Djb2Test.java +++ b/cache/src/test/java/net/runelite/cache/util/Djb2Test.java @@ -1,40 +1,40 @@ -/* - * Copyright (c) 2017, Adam - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -package net.runelite.cache.util; - -import org.junit.Test; -import static org.junit.Assert.*; - -public class Djb2Test -{ - - @Test - public void testHash() - { - int hash = Djb2.hash("l49_52"); - assertEquals(-1153204821, hash); - } - -} +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.cache.util; + +import org.junit.Test; +import static org.junit.Assert.*; + +public class Djb2Test +{ + + @Test + public void testHash() + { + int hash = Djb2.hash("l49_52"); + assertEquals(-1153204821, hash); + } + +} diff --git a/deobfuscator/pom.xml b/deobfuscator/pom.xml new file mode 100644 index 0000000000..af5e2792b4 --- /dev/null +++ b/deobfuscator/pom.xml @@ -0,0 +1,173 @@ + + + + 4.0.0 + + + net.runelite + runelite-parent + 1.5.27-SNAPSHOT + + + deobfuscator + Deobfuscator + + + + net.runelite + runelite-api + ${project.version} + + + net.runelite.rs + runescape-api + ${project.version} + + + net.runelite + fernflower + 20171017 + + + + com.google.guava + guava + 27.1-jre + + + org.slf4j + slf4j-api + + + org.slf4j + slf4j-simple + 1.7.12 + + + com.google.code.gson + gson + 2.8.5 + + + org.ow2.asm + asm-debug-all + 5.2 + + + + net.runelite.rs + rs-client + ${project.version} + test + + + net.runelite.rs + vanilla + ${rs.version} + test + + + junit + junit + 4.12 + test + + + org.mockito + mockito-all + 1.10.19 + test + + + + + + + src/main/resources + true + + + + + src/test/resources + true + + + + + org.apache.maven.plugins + maven-dependency-plugin + 2.3 + + + generate-sources + + + properties + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 2.16 + + true + -Xmx2048m + + + + maven-assembly-plugin + + + jar-with-dependencies + + + + + make-assembly + package + + single + + + + + + org.apache.maven.plugins + maven-jar-plugin + + + + test-jar + + + + + + + diff --git a/deobfuscator/src/main/java/net/runelite/asm/ClassFile.java b/deobfuscator/src/main/java/net/runelite/asm/ClassFile.java new file mode 100644 index 0000000000..dcbbd91bac --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/ClassFile.java @@ -0,0 +1,420 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm; + +import java.util.ArrayList; +import java.util.List; +import net.runelite.asm.attributes.Annotations; +import net.runelite.asm.attributes.annotation.Annotation; +import net.runelite.asm.pool.Class; +import net.runelite.asm.signature.Signature; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.MethodVisitor; +import org.objectweb.asm.Opcodes; + +public class ClassFile +{ + private ClassGroup group; + + private ClassFile parent; // super class + private final List children = new ArrayList<>(); // classes which inherit from this + + private int version; + private int access; + private Class name; + private Class super_class; + private String source; + private final Interfaces interfaces; + private final List fields = new ArrayList<>(); + private final List methods = new ArrayList<>(); + private final Annotations annotations; + + public ClassFile(ClassGroup group) + { + this.group = group; + + interfaces = new Interfaces(this); + annotations = new Annotations(); + } + + public ClassFile() + { + this(null); + } + + @Override + public String toString() + { + return "ClassFile{" + "name=" + name + '}'; + } + + public int getVersion() + { + return version; + } + + public void setVersion(int version) + { + this.version = version; + } + + public int getAccess() + { + return access; + } + + public void setAccess(int access) + { + this.access = access; + } + + public void accept(ClassVisitor visitor) + { + String[] ints = interfaces.getInterfaces().stream().map(i -> i.getName()).toArray(String[]::new); + + visitor.visit(version, access, name.getName(), null, super_class.getName(), ints); + visitor.visitSource(source, null); + + for (Annotation annotation : annotations.getAnnotations()) + { + AnnotationVisitor av = visitor.visitAnnotation(annotation.getType().toString(), true); + annotation.accept(av); + } + + for (Field field : fields) + { + FieldVisitor fv = visitor.visitField(field.getAccessFlags(), field.getName(), field.getType().toString(), null, field.getValue()); + field.accept(fv); + } + + for (Method method : methods) + { + String[] exceptions = method.getExceptions().getExceptions().stream().map(cl -> cl.getName()).toArray(String[]::new); + if (exceptions.length == 0) + { + exceptions = null; + } + + MethodVisitor mv = visitor.visitMethod(method.getAccessFlags(), method.getName(), method.getDescriptor().toString(), null, exceptions); + method.accept(mv); + } + + visitor.visitEnd(); + } + + public ClassGroup getGroup() + { + return group; + } + + public void setGroup(ClassGroup group) + { + this.group = group; + } + + public Interfaces getInterfaces() + { + return interfaces; + } + + public List getFields() + { + return fields; + } + + public void addField(Field field) + { + fields.add(field); + } + + public void removeField(Field field) + { + fields.remove(field); + } + + public List getMethods() + { + return methods; + } + + public void addMethod(Method method) + { + methods.add(method); + } + + public void removeMethod(Method method) + { + methods.remove(method); + } + + public Annotations getAnnotations() + { + return annotations; + } + + public String getName() + { + return name.getName(); + } + + public void setName(String name) + { + // Must be removed from the class group map first + assert group == null || this.name == null || group.findClass(this.name.getName()) == null; + + this.name = new Class(name); + } + + public String getClassName() + { + String n = getName(); + int i = n.lastIndexOf('/'); + return n.substring(i + 1); + } + + public String getSuperName() + { + return super_class.getName(); + } + + public void setSuperName(String name) + { + super_class = new Class(name); + } + + public String getSource() + { + return source; + } + + public void setSource(String source) + { + this.source = source; + } + + public Class getParentClass() + { + return this.super_class; + } + + public void setParentClass(Class c) + { + super_class = c; + } + + public ClassFile getParent() + { + return parent; + } + + public List getChildren() + { + return children; + } + + public Field findField(String name, Type type) + { + for (Field f : fields) + { + if (f.getName().equals(name) && f.getType().equals(type)) + { + return f; + } + } + return null; + } + + public Field findField(String name) + { + for (Field f : fields) + { + if (f.getName().equals(name)) + { + return f; + } + } + return null; + } + + public Class getPoolClass() + { + return name; + } + + public Field findFieldDeep(String name, Type type) + { + Field f = findField(name, type); + if (f != null) + { + return f; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findFieldDeep(name, type); + } + + return null; + } + + public Method findMethod(String name, Signature type) + { + for (Method m : methods) + { + if (m.getName().equals(name) && m.getDescriptor().equals(type)) + { + return m; + } + } + return null; + } + + public Method findMethod(String name) + { + for (Method m : methods) + { + if (m.getName().equals(name)) + { + return m; + } + } + return null; + } + + public Method findMethodDeep(String name, Signature type) + { + Method m = findMethod(name, type); + if (m != null) + { + return m; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findMethodDeep(name, type); + } + + return null; + } + + public Method findMethodDeepStatic(String name, Signature type) + { + Method m = findMethod(name, type); + if (m != null && m.isStatic()) + { + return m; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findMethodDeepStatic(name, type); + } + + return null; + } + + public Method findMethodDeep(String name) + { + Method m = findMethod(name); + if (m != null) + { + return m; + } + + ClassFile parent = getParent(); + if (parent != null) + { + return parent.findMethodDeep(name); + } + + return null; + } + + public void clearClassGraph() + { + parent = null; + children.clear(); + } + + public void buildClassGraph() + { + ClassFile other = group.findClass(super_class.getName()); + if (other != null) + { + this.parent = other; + parent.children.add(this); + } + + for (ClassFile i : interfaces.getMyInterfaces()) + { + i.children.add(this); + } + } + + public boolean instanceOf(ClassFile other) + { + return this == other || interfaces.instanceOf(other) || (getParent() != null && getParent().instanceOf(other)); + } + + public boolean isAbstract() + { + return (this.access & Opcodes.ACC_ABSTRACT) != 0; + } + + public boolean isFinal() + { + return (this.access & Opcodes.ACC_FINAL) != 0; + } + + public boolean isInterface() + { + return (this.access & Opcodes.ACC_INTERFACE) != 0; + } + + public boolean isEnum() + { + return (this.access & Opcodes.ACC_ENUM) != 0; + } + + public void setEnum() + { + this.access |= Opcodes.ACC_ENUM; + } + + public void clearFinal() + { + this.access &= ~Opcodes.ACC_FINAL; + } + + public void clearAbstract() + { + this.access &= ~Opcodes.ACC_ABSTRACT; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java b/deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java new file mode 100644 index 0000000000..2c6ba531a5 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/ClassGroup.java @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.runelite.asm.attributes.Code; + +public class ClassGroup +{ + private final List classes = new ArrayList<>(); // to keep order + private final Map classMap = new HashMap<>(); + + public void addClass(ClassFile cf) + { + assert cf.getGroup() == this || cf.getGroup() == null; + cf.setGroup(this); + + classes.add(cf); + classMap.put(cf.getName(), cf); + } + + public void removeClass(ClassFile cf) + { + classes.remove(cf); + classMap.remove(cf.getName()); + } + + public void renameClass(ClassFile cf, String newName) + { + assert classes.contains(cf); + assert classMap.get(cf.getName()) == cf; + + classMap.remove(cf.getName()); + cf.setName(newName); + classMap.put(cf.getName(), cf); + } + + public List getClasses() + { + return Collections.unmodifiableList(classes); + } + + public ClassFile findClass(String name) + { + return classMap.get(name); + } + + public void initialize() + { + buildClassGraph(); + lookup(); + } + + public void buildClassGraph() + { + for (ClassFile c : classes) + { + c.clearClassGraph(); + } + + for (ClassFile c : classes) + { + c.buildClassGraph(); + } + } + + public void lookup() + { + for (ClassFile cf : this.getClasses()) + { + for (Method m : cf.getMethods()) + { + Code code = m.getCode(); + + if (code == null) + { + continue; + } + + code.getInstructions().lookup(); + } + } + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/Field.java b/deobfuscator/src/main/java/net/runelite/asm/Field.java new file mode 100644 index 0000000000..8d70053adb --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Field.java @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm; + +import net.runelite.asm.attributes.Annotations; +import net.runelite.asm.attributes.annotation.Annotation; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; + +import static org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static org.objectweb.asm.Opcodes.ACC_PROTECTED; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; + +public class Field +{ + public static final int ACCESS_MODIFIERS = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED; + + private final ClassFile classFile; + + private int accessFlags; + private String name; + private Type type; + private Object value; // ConstantValue + private final Annotations annotations; + + public Field(ClassFile classFile, String name, Type type) + { + this.classFile = classFile; + this.name = name; + this.type = type; + + annotations = new Annotations(); + } + + public void accept(FieldVisitor visitor) + { + for (Annotation annotation : annotations.getAnnotations()) + { + AnnotationVisitor av = visitor.visitAnnotation(annotation.getType().toString(), true); + annotation.accept(av); + } + + visitor.visitEnd(); + } + + public ClassFile getClassFile() + { + return classFile; + } + + public int getAccessFlags() + { + return accessFlags; + } + + public void setAccessFlags(int accessFlags) + { + this.accessFlags = accessFlags; + } + + public boolean isPublic() + { + return (accessFlags & Opcodes.ACC_PUBLIC) != 0; + } + + public void setPublic() + { + accessFlags = (short) ((accessFlags & ~ACCESS_MODIFIERS) | ACC_PUBLIC); + } + + public boolean isStatic() + { + return (accessFlags & Opcodes.ACC_STATIC) != 0; + } + + public void setStatic() + { + accessFlags |= Opcodes.ACC_STATIC; + } + + public boolean isSynthetic() + { + return (accessFlags & Opcodes.ACC_SYNTHETIC) != 0; + } + + public void setEnum() + { + accessFlags |= Opcodes.ACC_ENUM; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Type getType() + { + return type; + } + + public void setType(Type type) + { + this.type = type; + } + + public Object getValue() + { + return value; + } + + public void setValue(Object value) + { + this.value = value; + } + + public Annotations getAnnotations() + { + return annotations; + } + + public net.runelite.asm.pool.Field getPoolField() + { + return new net.runelite.asm.pool.Field( + new net.runelite.asm.pool.Class(classFile.getName()), + this.getName(), + this.getType() + ); + } + + @Override + public String toString() + { + return (this.isStatic() ? "static " : "") + this.type + " " + classFile.getName() + "." + this.getName(); + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/Interfaces.java b/deobfuscator/src/main/java/net/runelite/asm/Interfaces.java new file mode 100644 index 0000000000..a372f9d68c --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Interfaces.java @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm; + +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Collectors; +import net.runelite.asm.pool.Class; + +public class Interfaces +{ + private final ClassFile classFile; + + private final List interfaces = new ArrayList<>(); + + Interfaces(ClassFile c) + { + classFile = c; + } + + public void addInterface(Class clazz) + { + if (!interfaces.contains(clazz)) + { + interfaces.add(clazz); + } + } + + public List getInterfaces() + { + return interfaces; + } + + public void clear() + { + interfaces.clear(); + } + + public List getMyInterfaces() + { + List l = new ArrayList<>(); + for (Class clazz : interfaces) + { + ClassFile iface = classFile.getGroup().findClass(clazz.getName()); + if (iface != null) + { + l.add(iface); + } + } + return l; + } + + public List getNonMyInterfaces() + { + return interfaces.stream().filter(clazz -> classFile.getGroup().findClass(clazz.getName()) == null).collect(Collectors.toList()); + } + + public boolean instanceOf(ClassFile cf) + { + for (Class clazz : interfaces) + { + ClassFile iface = classFile.getGroup().findClass(clazz.getName()); + if (iface.instanceOf(cf)) + { + return true; + } + } + return false; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/Method.java b/deobfuscator/src/main/java/net/runelite/asm/Method.java new file mode 100644 index 0000000000..bc2c8b305b --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Method.java @@ -0,0 +1,314 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm; + +import java.util.ArrayList; +import java.util.List; +import net.runelite.asm.attributes.Annotations; +import net.runelite.asm.attributes.Code; +import net.runelite.asm.attributes.Exceptions; +import net.runelite.asm.attributes.annotation.Annotation; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.attributes.code.LocalVariable; +import net.runelite.asm.attributes.code.Parameter; +import net.runelite.asm.attributes.code.instruction.types.LVTInstruction; +import net.runelite.asm.signature.Signature; +import org.objectweb.asm.AnnotationVisitor; +import org.objectweb.asm.Label; +import org.objectweb.asm.MethodVisitor; +import static org.objectweb.asm.Opcodes.ACC_FINAL; +import static org.objectweb.asm.Opcodes.ACC_NATIVE; +import static org.objectweb.asm.Opcodes.ACC_PRIVATE; +import static org.objectweb.asm.Opcodes.ACC_PROTECTED; +import static org.objectweb.asm.Opcodes.ACC_PUBLIC; +import static org.objectweb.asm.Opcodes.ACC_STATIC; +import static org.objectweb.asm.Opcodes.ACC_SYNCHRONIZED; + +public class Method +{ + public static final int ACCESS_MODIFIERS = ACC_PUBLIC | ACC_PRIVATE | ACC_PROTECTED; + + private final ClassFile classFile; + + private int accessFlags; + private String name; + private Signature arguments; + private Exceptions exceptions; + private Annotations annotations; + private List parameters; + private Code code; + + public Method(ClassFile classFile, String name, Signature signature) + { + this.classFile = classFile; + this.name = name; + this.arguments = signature; + exceptions = new Exceptions(); + annotations = new Annotations(); + parameters = new ArrayList<>(); + } + + public ClassFile getClassFile() + { + return classFile; + } + + @Override + public String toString() + { + return (this.isStatic() ? "static " : "") + classFile.getName() + "." + this.name + this.arguments; + } + + public void accept(MethodVisitor visitor) + { + //This is required to name unused parameters + for (Parameter p : parameters) + { + visitor.visitParameter(p.getName(), p.getAccess()); + } + + for (Annotation annotation : annotations.getAnnotations()) + { + AnnotationVisitor av = visitor.visitAnnotation(annotation.getType().toString(), true); + annotation.accept(av); + } + + if (code != null) + { + code.getInstructions().rebuildLabels(); + + visitor.visitCode(); + + net.runelite.asm.attributes.code.Exceptions exceptions = code.getExceptions(); + for (net.runelite.asm.attributes.code.Exception exception : exceptions.getExceptions()) + { + assert exception.getStart().getLabel() != null; + assert exception.getEnd().getLabel() != null; + assert exception.getHandler().getLabel() != null; + + int idxStart = code.getInstructions().getInstructions().indexOf(exception.getStart()); + int idxEnd = code.getInstructions().getInstructions().indexOf(exception.getEnd()); + + assert idxStart != -1; + assert idxEnd != -1; + assert code.getInstructions().getInstructions().contains(exception.getHandler()); + + assert idxEnd > idxStart; + + visitor.visitTryCatchBlock( + exception.getStart().getLabel(), + exception.getEnd().getLabel(), + exception.getHandler().getLabel(), + exception.getCatchType() != null ? exception.getCatchType().getName() : null + ); + } + + for (Instruction i : code.getInstructions().getInstructions()) + { + i.accept(visitor); + } + + //Find first and last label for this method + if (parameters.size() > 0) + { + Label startLabel = null; + Label endLabel = null; + for (Instruction i : code.getInstructions().getInstructions()) + { + if (i instanceof net.runelite.asm.attributes.code.Label) + { + if (startLabel == null) + { + startLabel = ((net.runelite.asm.attributes.code.Label) i).getLabel(); + } + endLabel = ((net.runelite.asm.attributes.code.Label) i).getLabel(); + } + } + + for (Parameter p : parameters) + { + LocalVariable lv = p.getLocalVariable(); + if (lv != null) + { + visitor.visitLocalVariable(lv.getName(), lv.getDesc(), lv.getSignature(), startLabel, endLabel, lv.getIndex()); + } + } + } + + visitor.visitMaxs(code.getMaxStack(), code.getMaxLocals()); + } + + visitor.visitEnd(); + } + + public int getAccessFlags() + { + return accessFlags; + } + + public void setAccessFlags(int accessFlags) + { + this.accessFlags = accessFlags; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Signature getDescriptor() + { + return arguments; + } + + public void setDescriptor(Signature signature) + { + this.arguments = signature; + } + + public boolean isNative() + { + return (accessFlags & ACC_NATIVE) != 0; + } + + public boolean isStatic() + { + return (accessFlags & ACC_STATIC) != 0; + } + + public void setStatic() + { + accessFlags |= ACC_STATIC; + } + + public boolean isSynchronized() + { + return (accessFlags & ACC_SYNCHRONIZED) != 0; + } + + public boolean isFinal() + { + return (accessFlags & ACC_FINAL) != 0; + } + + public void setFinal(boolean f) + { + if (f) + { + accessFlags |= ACC_FINAL; + } + else + { + accessFlags &= ~ACC_FINAL; + } + } + + public boolean isPrivate() + { + return (accessFlags & ACC_PRIVATE) != 0; + } + + public void setPrivate() + { + accessFlags = (short) ((accessFlags & ~ACCESS_MODIFIERS) | ACC_PRIVATE); + } + + public void setPublic() + { + accessFlags = (short) ((accessFlags & ~ACCESS_MODIFIERS) | ACC_PUBLIC); + } + + public Exceptions getExceptions() + { + return exceptions; + } + + public Code getCode() + { + return code; + } + + public void setCode(Code code) + { + this.code = code; + } + + public Annotations getAnnotations() + { + return annotations; + } + + @SuppressWarnings("unchecked") + public List findLVTInstructionsForVariable(int index) + { + List list = new ArrayList<>(); + + if (getCode() == null) + { + return null; + } + + for (Instruction ins : getCode().getInstructions().getInstructions()) + { + if (ins instanceof LVTInstruction) + { + LVTInstruction lv = (LVTInstruction) ins; + + if (lv.getVariableIndex() != index) + { + continue; + } + + list.add((T) ins); + } + } + + return list; + } + + public net.runelite.asm.pool.Method getPoolMethod() + { + return new net.runelite.asm.pool.Method( + new net.runelite.asm.pool.Class(classFile.getName()), + name, + arguments + ); + } + + public List getParameters() + { + return parameters; + } + + public void setParameters(List parameters) + { + this.parameters = parameters; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/Type.java b/deobfuscator/src/main/java/net/runelite/asm/Type.java new file mode 100644 index 0000000000..68ba6960d4 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/Type.java @@ -0,0 +1,228 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm; + +import net.runelite.asm.pool.Class; + +/** + * Created by Kyle Fricilone on 8/20/2017 + */ +public class Type +{ + + public static final Type VOID = new Type("V"); + public static final Type BOOLEAN = new Type("Z"); + public static final Type CHAR = new Type("C"); + public static final Type BYTE = new Type("B"); + public static final Type SHORT = new Type("S"); + public static final Type INT = new Type("I"); + public static final Type FLOAT = new Type("F"); + public static final Type LONG = new Type("J"); + public static final Type DOUBLE = new Type("D"); + public static final Type OBJECT = new Type("Ljava/lang/Object;"); + public static final Type STRING = new Type("Ljava/lang/String;"); + public static final Type THROWABLE = new Type("Ljava/lang/Throwable;"); + public static final Type EXCEPTION = new Type("Ljava/lang/Exception;"); + + private final String type; + + public Type(String type) + { + this.type = type; + } + + public boolean isPrimitive() + { + return this.equals(BOOLEAN) || this.equals(BYTE) || this.equals(SHORT) || this.equals(CHAR) || this.equals(INT) + || this.equals(VOID) || this.equals(LONG) || this.equals(FLOAT) || this.equals(DOUBLE); + } + + public boolean isObject() + { + return this.equals(OBJECT); + } + + public boolean isArray() + { + return getDimensions() > 0; + } + + public boolean isStackInt() + { + return this.equals(BOOLEAN) || this.equals(BYTE) || this.equals(SHORT) || this.equals(CHAR) || this.equals(INT); + } + + public int getSize() + { + if (this.equals(LONG) || this.equals(DOUBLE)) + { + return 2; + } + + if (this.equals(VOID)) + { + return 0; + } + + return 1; + } + + public int getDimensions() + { + return getDimensions(type); + } + + public Type getSubtype() + { + if (!type.startsWith("[")) + { + throw new IllegalStateException(type + " is not an array"); + } + return new Type(type.substring(1)); + } + + public String getInternalName() + { + String s = type; + while (s.startsWith("[")) + { + s = s.substring(1); + } + if (s.startsWith("L")) + { + return s.substring(1, s.length() - 1); + } + else + { + return s; + } + } + + @Override + public boolean equals(Object o) + { + if (!(o instanceof Type)) + { + return false; + } + + Type other = (Type) o; + return type.equals(other.type); + } + + @Override + public int hashCode() + { + return type.hashCode(); + } + + @Override + public String toString() + { + return type; + } + + public String toAsmString() + { + if (type.startsWith("L") && type.endsWith(";")) + { + return type.substring(1, type.length() - 1); + } + else + { + return type; + } + } + + public static Type fromAsmString(String str) + { + if (str.startsWith("[")) + { + // array type + return new Type(str); + } + else + { + // object type + return new Type("L" + str + ";"); + } + } + + private static int getDimensions(String type) + { + if (!type.startsWith("[")) + { + return 0; + } + + return (int) type.chars().filter(i -> i == '[').count(); + } + + public static Type getType(String type, int dims) + { + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < dims; i++) + { + builder.append('['); + } + return new Type(builder.append(type).toString()); + } + + public static Type getType(Object object) + { + Type type; + + if (object instanceof Double) + { + type = DOUBLE; + } + else if (object instanceof Float) + { + type = FLOAT; + } + else if (object instanceof Integer) + { + type = INT; + } + else if (object instanceof Long) + { + type = LONG; + } + else if (object instanceof String) + { + type = STRING; + } + else if (object instanceof Class) + { + type = new Type("L" + ((Class) object).getName() + ";"); + } + else + { + throw new IllegalArgumentException("Unexpected object type: " + object.getClass()); + } + + return type; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/Annotations.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/Annotations.java new file mode 100644 index 0000000000..b14d761c28 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/Annotations.java @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes; + +import java.util.ArrayList; +import java.util.List; + +import net.runelite.asm.Type; +import net.runelite.asm.attributes.annotation.Annotation; +import net.runelite.asm.attributes.annotation.Element; + +public class Annotations +{ + private final List annotations = new ArrayList<>(); + + public List getAnnotations() + { + return annotations; + } + + public void addAnnotation(Annotation annotation) + { + annotations.add(annotation); + } + + public void removeAnnotation(Annotation annotation) + { + annotations.remove(annotation); + } + + public void clearAnnotations() + { + annotations.clear(); + } + + public Annotation find(Type type) + { + for (Annotation a : annotations) + if (a.getType().equals(type)) + return a; + return null; + } + + public int size() + { + return annotations.size(); + } + + public Annotation addAnnotation(Type type, String name, Object value) + { + Annotation annotation = new Annotation(this); + annotation.setType(type); + addAnnotation(annotation); + + Element element = new Element(annotation); + element.setName(name); + element.setValue(value); + annotation.addElement(element); + + return annotation; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/Code.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/Code.java new file mode 100644 index 0000000000..2a3f08126c --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/Code.java @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes; + +import net.runelite.asm.Method; +import net.runelite.asm.attributes.code.Exceptions; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.attributes.code.Instructions; +import net.runelite.asm.attributes.code.instruction.types.LVTInstruction; +import net.runelite.asm.signature.Signature; + +public class Code +{ + private Method method; + private int maxStack; + private Instructions instructions; + private final Exceptions exceptions; + + public Code(Method method) + { + this.method = method; + + exceptions = new Exceptions(this); + instructions = new Instructions(this); + } + + public Method getMethod() + { + return method; + } + + public int getMaxStack() + { + return maxStack; + } + + public void setMaxStack(int maxStack) + { + this.maxStack = maxStack; + } + + private int getMaxLocalsFromSig() + { + Method m = getMethod(); + int num = m.isStatic() ? 0 : 1; + Signature sig = m.getDescriptor(); + for (int i = 0; i < sig.size(); ++i) + num += sig.getTypeOfArg(i).getSize(); + return num; + } + + /** + * calculates the size of the lvt required for this method + * @return + */ + public int getMaxLocals() + { + int max = -1; + + for (Instruction ins : instructions.getInstructions()) + { + if (ins instanceof LVTInstruction) + { + LVTInstruction lvt = (LVTInstruction) ins; + + int sizeRequired = lvt.getVariableIndex() + lvt.type().getSlots(); + if (sizeRequired > max) + { + max = sizeRequired; + } + } + } + + int fromSig = getMaxLocalsFromSig(); + if (fromSig > max) + max = fromSig; + + return max; + } + + public Exceptions getExceptions() + { + return exceptions; + } + + public Instructions getInstructions() + { + return instructions; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java new file mode 100644 index 0000000000..0b12c513fd --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/Exceptions.java @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes; + +import java.util.ArrayList; +import java.util.List; +import net.runelite.asm.ClassFile; +import net.runelite.asm.pool.Class; + +public class Exceptions +{ + private final List classes = new ArrayList<>(); + + public void addException(Class cl) + { + classes.add(cl); + } + + public List getExceptions() + { + return classes; + } + + public void renameClass(ClassFile cf, String name) + { + for (Class c : new ArrayList<>(classes)) + { + if (c.getName().equals(cf.getName())) + { + int idx = classes.indexOf(c); + classes.remove(idx); + classes.add(idx, new Class(name)); + } + } + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java new file mode 100644 index 0000000000..7c727eb788 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Annotation.java @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.annotation; + +import java.util.ArrayList; +import java.util.List; + +import net.runelite.asm.Type; +import net.runelite.asm.attributes.Annotations; +import org.objectweb.asm.AnnotationVisitor; + +public class Annotation +{ + private final Annotations annotations; + private Type type; + private final List elements = new ArrayList<>(); + + public Annotation(Annotations annotations) + { + this.annotations = annotations; + } + + public Annotations getAnnotations() + { + return annotations; + } + + public void setType(Type type) + { + this.type = type; + } + + public Type getType() + { + return type; + } + + public List getElements() + { + return elements; + } + + public Element getElement() + { + return elements.get(0); + } + + public void addElement(Element element) + { + elements.add(element); + } + + public void accept(AnnotationVisitor visitor) + { + for (Element element : elements) + visitor.visit(element.getName(), element.getValue()); + visitor.visitEnd(); + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Element.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Element.java new file mode 100644 index 0000000000..18fdfa33f4 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/annotation/Element.java @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.annotation; + +public class Element +{ + private final Annotation annotation; + private String name; + private Object value; + + public Element(Annotation annotation) + { + this.annotation = annotation; + } + + public Annotation getAnnotation() + { + return annotation; + } + + public String getName() + { + return name; + } + + public void setName(String name) + { + this.name = name; + } + + public Object getValue() + { + return value; + } + + public void setValue(Object value) + { + this.value = value; + } + + public String getString() + { + return value.toString(); + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exception.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exception.java new file mode 100644 index 0000000000..b1209a6631 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exception.java @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.code; + +import net.runelite.asm.ClassFile; +import net.runelite.asm.pool.Class; + +public class Exception implements Cloneable +{ + private Exceptions exceptions; + + private Label start, end, handler; + private Class catchType; + + public Exception(Exceptions exceptions) + { + this.exceptions = exceptions; + } + + @Override + public Exception clone() + { + try + { + return (Exception) super.clone(); + } + catch (CloneNotSupportedException ex) + { + throw new RuntimeException(); + } + } + + public Exceptions getExceptions() + { + return exceptions; + } + + public void setExceptions(Exceptions exceptions) + { + this.exceptions = exceptions; + } + + public Label getStart() + { + return start; + } + + public void setStart(Label ins) + { + start = ins; + } + + public Label getEnd() + { + return end; + } + + public void setEnd(Label end) + { + this.end = end; + } + + public Label getHandler() + { + return handler; + } + + public void setHandler(Label handler) + { + this.handler = handler; + } + + public Class getCatchType() + { + return catchType; + } + + public void setCatchType(Class catchType) + { + this.catchType = catchType; + } + + public void renameClass(ClassFile cf, String name) + { + if (catchType != null && cf.getName().equals(catchType.getName())) + catchType = new Class(name); + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exceptions.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exceptions.java new file mode 100644 index 0000000000..30b00a0115 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Exceptions.java @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.code; + +import java.util.ArrayList; +import java.util.List; +import net.runelite.asm.ClassFile; +import net.runelite.asm.attributes.Code; + +public class Exceptions +{ + private Code code; + private List exceptions = new ArrayList(); + + public Exceptions(Code code) + { + this.code = code; + } + + public void add(Exception e) + { + exceptions.add(e); + } + + public void remove(Exception e) + { + exceptions.remove(e); + } + + public void clear() + { + exceptions.clear(); + } + + public Code getCode() + { + return code; + } + + public List getExceptions() + { + return exceptions; + } + + public void renameClass(ClassFile cf, String name) + { + for (Exception e : exceptions) + e.renameClass(cf, name); + } +} \ No newline at end of file diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instruction.java new file mode 100644 index 0000000000..bf8e64535e --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instruction.java @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code; + +import net.runelite.asm.Method; +import net.runelite.asm.execution.Frame; +import net.runelite.asm.execution.InstructionContext; +import org.objectweb.asm.MethodVisitor; + +public abstract class Instruction implements Cloneable +{ + private Instructions instructions; + private InstructionType type; + + public Instruction(Instructions instructions, InstructionType type) + { + this.instructions = instructions; + this.type = type; + } + + @Override + public String toString() + { + if (this.getInstructions() != null) + { + Method m = this.getInstructions().getCode().getMethod(); + return super.toString() + " in " + m;// + " at pc 0x" + Integer.toHexString(this.getPc()); + } + else + { + return super.toString() + " "; + } + } + + @Override + public Instruction clone() + { + Instruction i; + try + { + i = (Instruction) super.clone(); + } + catch (CloneNotSupportedException ex) + { + throw new RuntimeException(ex); + } + + return i; + } + + protected void remove() + { + Exceptions exceptions = instructions.getCode().getExceptions(); + for (Exception e : exceptions.getExceptions()) + { + assert this != e.getStart(); + assert this != e.getEnd(); + assert this != e.getHandler(); + } + } + + public boolean removeStack() + { + assert instructions != null; + + this.getInstructions().remove(this); // calls remove() + + return true; + } + + // resolve jumps + public void resolve() + { + } + + public void accept(MethodVisitor visitor) + { + visitor.visitInsn(this.getType().getCode()); + } + + public Instructions getInstructions() + { + return instructions; + } + + public void setInstructions(Instructions instructions) + { + this.instructions = instructions; + } + + public InstructionType getType() + { + return type; + } + + protected void setType(InstructionType type) + { + this.type = type; + } + + public abstract InstructionContext execute(Frame e); + + /* does this terminate a block? */ + public boolean isTerminal() + { + return false; + } + + // look up symbols from pool + public void lookup() + { + } + + // instructions keep resolved method/field/class names, this updates the pool value (if the underlying resolved object changes) + public void regeneratePool() + { + } + + public void renameClass(String oldName, String newName) + { + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/InstructionType.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/InstructionType.java new file mode 100644 index 0000000000..0c347d4809 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/InstructionType.java @@ -0,0 +1,348 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code; + +import net.runelite.asm.attributes.code.instructions.AALoad; +import net.runelite.asm.attributes.code.instructions.AAStore; +import net.runelite.asm.attributes.code.instructions.AConstNull; +import net.runelite.asm.attributes.code.instructions.ALoad; +import net.runelite.asm.attributes.code.instructions.ANewArray; +import net.runelite.asm.attributes.code.instructions.AStore; +import net.runelite.asm.attributes.code.instructions.AThrow; +import net.runelite.asm.attributes.code.instructions.ArrayLength; +import net.runelite.asm.attributes.code.instructions.BALoad; +import net.runelite.asm.attributes.code.instructions.BAStore; +import net.runelite.asm.attributes.code.instructions.BiPush; +import net.runelite.asm.attributes.code.instructions.CALoad; +import net.runelite.asm.attributes.code.instructions.CAStore; +import net.runelite.asm.attributes.code.instructions.CheckCast; +import net.runelite.asm.attributes.code.instructions.D2F; +import net.runelite.asm.attributes.code.instructions.D2I; +import net.runelite.asm.attributes.code.instructions.D2L; +import net.runelite.asm.attributes.code.instructions.DALoad; +import net.runelite.asm.attributes.code.instructions.DAStore; +import net.runelite.asm.attributes.code.instructions.DAdd; +import net.runelite.asm.attributes.code.instructions.DCmpG; +import net.runelite.asm.attributes.code.instructions.DCmpL; +import net.runelite.asm.attributes.code.instructions.DDiv; +import net.runelite.asm.attributes.code.instructions.DLoad; +import net.runelite.asm.attributes.code.instructions.DMul; +import net.runelite.asm.attributes.code.instructions.DNeg; +import net.runelite.asm.attributes.code.instructions.DRem; +import net.runelite.asm.attributes.code.instructions.DStore; +import net.runelite.asm.attributes.code.instructions.DSub; +import net.runelite.asm.attributes.code.instructions.Dup; +import net.runelite.asm.attributes.code.instructions.Dup2; +import net.runelite.asm.attributes.code.instructions.Dup2_X1; +import net.runelite.asm.attributes.code.instructions.Dup2_X2; +import net.runelite.asm.attributes.code.instructions.Dup_X1; +import net.runelite.asm.attributes.code.instructions.Dup_X2; +import net.runelite.asm.attributes.code.instructions.F2D; +import net.runelite.asm.attributes.code.instructions.F2I; +import net.runelite.asm.attributes.code.instructions.F2L; +import net.runelite.asm.attributes.code.instructions.FALoad; +import net.runelite.asm.attributes.code.instructions.FAStore; +import net.runelite.asm.attributes.code.instructions.FAdd; +import net.runelite.asm.attributes.code.instructions.FCmpG; +import net.runelite.asm.attributes.code.instructions.FCmpL; +import net.runelite.asm.attributes.code.instructions.FDiv; +import net.runelite.asm.attributes.code.instructions.FLoad; +import net.runelite.asm.attributes.code.instructions.FMul; +import net.runelite.asm.attributes.code.instructions.FNeg; +import net.runelite.asm.attributes.code.instructions.FRem; +import net.runelite.asm.attributes.code.instructions.FStore; +import net.runelite.asm.attributes.code.instructions.FSub; +import net.runelite.asm.attributes.code.instructions.GetField; +import net.runelite.asm.attributes.code.instructions.GetStatic; +import net.runelite.asm.attributes.code.instructions.Goto; +import net.runelite.asm.attributes.code.instructions.GotoW; +import net.runelite.asm.attributes.code.instructions.I2B; +import net.runelite.asm.attributes.code.instructions.I2C; +import net.runelite.asm.attributes.code.instructions.I2D; +import net.runelite.asm.attributes.code.instructions.I2F; +import net.runelite.asm.attributes.code.instructions.I2L; +import net.runelite.asm.attributes.code.instructions.I2S; +import net.runelite.asm.attributes.code.instructions.IALoad; +import net.runelite.asm.attributes.code.instructions.IAStore; +import net.runelite.asm.attributes.code.instructions.IAdd; +import net.runelite.asm.attributes.code.instructions.IAnd; +import net.runelite.asm.attributes.code.instructions.IDiv; +import net.runelite.asm.attributes.code.instructions.IInc; +import net.runelite.asm.attributes.code.instructions.ILoad; +import net.runelite.asm.attributes.code.instructions.IMul; +import net.runelite.asm.attributes.code.instructions.INeg; +import net.runelite.asm.attributes.code.instructions.IOr; +import net.runelite.asm.attributes.code.instructions.IRem; +import net.runelite.asm.attributes.code.instructions.IShL; +import net.runelite.asm.attributes.code.instructions.IShR; +import net.runelite.asm.attributes.code.instructions.IStore; +import net.runelite.asm.attributes.code.instructions.ISub; +import net.runelite.asm.attributes.code.instructions.IUShR; +import net.runelite.asm.attributes.code.instructions.IXor; +import net.runelite.asm.attributes.code.instructions.IfACmpEq; +import net.runelite.asm.attributes.code.instructions.IfACmpNe; +import net.runelite.asm.attributes.code.instructions.IfCmpGe; +import net.runelite.asm.attributes.code.instructions.IfCmpGt; +import net.runelite.asm.attributes.code.instructions.IfCmpLe; +import net.runelite.asm.attributes.code.instructions.IfCmpLt; +import net.runelite.asm.attributes.code.instructions.IfEq; +import net.runelite.asm.attributes.code.instructions.IfGe; +import net.runelite.asm.attributes.code.instructions.IfGt; +import net.runelite.asm.attributes.code.instructions.IfICmpEq; +import net.runelite.asm.attributes.code.instructions.IfICmpNe; +import net.runelite.asm.attributes.code.instructions.IfLe; +import net.runelite.asm.attributes.code.instructions.IfLt; +import net.runelite.asm.attributes.code.instructions.IfNe; +import net.runelite.asm.attributes.code.instructions.IfNonNull; +import net.runelite.asm.attributes.code.instructions.IfNull; +import net.runelite.asm.attributes.code.instructions.InstanceOf; +import net.runelite.asm.attributes.code.instructions.InvokeDynamic; +import net.runelite.asm.attributes.code.instructions.InvokeInterface; +import net.runelite.asm.attributes.code.instructions.InvokeSpecial; +import net.runelite.asm.attributes.code.instructions.InvokeStatic; +import net.runelite.asm.attributes.code.instructions.InvokeVirtual; +import net.runelite.asm.attributes.code.instructions.L2D; +import net.runelite.asm.attributes.code.instructions.L2F; +import net.runelite.asm.attributes.code.instructions.L2I; +import net.runelite.asm.attributes.code.instructions.LALoad; +import net.runelite.asm.attributes.code.instructions.LAStore; +import net.runelite.asm.attributes.code.instructions.LAdd; +import net.runelite.asm.attributes.code.instructions.LAnd; +import net.runelite.asm.attributes.code.instructions.LCmp; +import net.runelite.asm.attributes.code.instructions.LDC; +import net.runelite.asm.attributes.code.instructions.LDiv; +import net.runelite.asm.attributes.code.instructions.LLoad; +import net.runelite.asm.attributes.code.instructions.LMul; +import net.runelite.asm.attributes.code.instructions.LNeg; +import net.runelite.asm.attributes.code.instructions.LOr; +import net.runelite.asm.attributes.code.instructions.LRem; +import net.runelite.asm.attributes.code.instructions.LShL; +import net.runelite.asm.attributes.code.instructions.LShR; +import net.runelite.asm.attributes.code.instructions.LStore; +import net.runelite.asm.attributes.code.instructions.LSub; +import net.runelite.asm.attributes.code.instructions.LUShR; +import net.runelite.asm.attributes.code.instructions.LXor; +import net.runelite.asm.attributes.code.instructions.LookupSwitch; +import net.runelite.asm.attributes.code.instructions.MonitorEnter; +import net.runelite.asm.attributes.code.instructions.MonitorExit; +import net.runelite.asm.attributes.code.instructions.MultiANewArray; +import net.runelite.asm.attributes.code.instructions.NOP; +import net.runelite.asm.attributes.code.instructions.New; +import net.runelite.asm.attributes.code.instructions.NewArray; +import net.runelite.asm.attributes.code.instructions.Pop; +import net.runelite.asm.attributes.code.instructions.Pop2; +import net.runelite.asm.attributes.code.instructions.PutField; +import net.runelite.asm.attributes.code.instructions.PutStatic; +import net.runelite.asm.attributes.code.instructions.Return; +import net.runelite.asm.attributes.code.instructions.SALoad; +import net.runelite.asm.attributes.code.instructions.SAStore; +import net.runelite.asm.attributes.code.instructions.SiPush; +import net.runelite.asm.attributes.code.instructions.Swap; +import net.runelite.asm.attributes.code.instructions.TableSwitch; +import net.runelite.asm.attributes.code.instructions.VReturn; + +public enum InstructionType +{ + NOP(0x00, "nop", NOP.class), + ACONST_NULL(0x01, "aconst_null", AConstNull.class), + BIPUSH(0x10, "bipush", BiPush.class), + SIPUSH(0x11, "sipush", SiPush.class), + LDC(-1, "ldc", LDC.class), + ILOAD(0x15, "iload", ILoad.class), + LLOAD(0x16, "lload", LLoad.class), + FLOAD(0x17, "fload", FLoad.class), + DLOAD(0x18, "dload", DLoad.class), + ALOAD(0x19, "aload", ALoad.class), + IALOAD(0x2e, "iaload", IALoad.class), + LALOAD(0x2f, "laload", LALoad.class), + FALOAD(0x30, "faload", FALoad.class), + DALOAD(0x31, "daload", DALoad.class), + AALOAD(0x32, "aaload", AALoad.class), + BALOAD(0x33, "baload", BALoad.class), + CALOAD(0x34, "caload", CALoad.class), + SALOAD(0x35, "saload", SALoad.class), + ISTORE(0x36, "istore", IStore.class), + LSTORE(0x37, "lstore", LStore.class), + FSTORE(0x38, "fstore", FStore.class), + DSTORE(0x39, "dstore", DStore.class), + ASTORE(0x3a, "astore", AStore.class), + IASTORE(0x4f, "iastore", IAStore.class), + LASTORE(0x50, "lastore", LAStore.class), + FASTORE(0x51, "fastore", FAStore.class), + DASTORE(0x52, "dastore", DAStore.class), + AASTORE(0x53, "aastore", AAStore.class), + BASTORE(0x54, "bastore", BAStore.class), + CASTORE(0x55, "castore", CAStore.class), + SASTORE(0x56, "sastore", SAStore.class), + POP(0x57, "pop", Pop.class), + POP2(0x58, "pop2", Pop2.class), + DUP(0x59, "dup", Dup.class), + DUP_X1(0x5a, "dup_x1", Dup_X1.class), + DUP_X2(0x5b, "dup_x2", Dup_X2.class), + DUP2(0x5c, "dup2", Dup2.class), + DUP2_X1(0x5d, "dup2_x1", Dup2_X1.class), + DUP2_X2(0x5e, "dup2_x2", Dup2_X2.class), + SWAP(0x5f, "swap", Swap.class), + IADD(0x60, "iadd", IAdd.class), + LADD(0x61, "ladd", LAdd.class), + FADD(0x62, "fadd", FAdd.class), + DADD(0x63, "dadd", DAdd.class), + ISUB(0x64, "isub", ISub.class), + LSUB(0x65, "lsub", LSub.class), + FSUB(0x66, "fsub", FSub.class), + DSUB(0x67, "dsub", DSub.class), + IMUL(0x68, "imul", IMul.class), + LMUL(0x69, "lmul", LMul.class), + FMUL(0x6a, "fmul", FMul.class), + DMUL(0x6b, "dmul", DMul.class), + IDIV(0x6c, "idiv", IDiv.class), + LDIV(0x6d, "ldiv", LDiv.class), + FDIV(0x6e, "fdiv", FDiv.class), + DDIV(0x6f, "ddiv", DDiv.class), + IREM(0x70, "irem", IRem.class), + LREM(0x71, "lrem", LRem.class), + FREM(0x72, "frem", FRem.class), + DREM(0x73, "drem", DRem.class), + INEG(0x74, "ineg", INeg.class), + LNEG(0x75, "lneg", LNeg.class), + FNEG(0x76, "fneg", FNeg.class), + DNEG(0x77, "dneg", DNeg.class), + ISHL(0x78, "ishl", IShL.class), + LSHL(0x79, "lshl", LShL.class), + ISHR(0x7a, "ishr", IShR.class), + LSHR(0x7b, "lshr", LShR.class), + IUSHR(0x7c, "iushr", IUShR.class), + LUSHR(0x7d, "lushr", LUShR.class), + IAND(0x7e, "iand", IAnd.class), + LAND(0x7f, "land", LAnd.class), + IOR(0x80, "ior", IOr.class), + LOR(0x81, "lor", LOr.class), + IXOR(0x82, "ixor", IXor.class), + LXOR(0x83, "lxor", LXor.class), + IINC(0x84, "iinc", IInc.class), + I2L(0x85, "i2l", I2L.class), + I2F(0x86, "i2f", I2F.class), + I2D(0x87, "i2d", I2D.class), + L2I(0x88, "l2i", L2I.class), + L2F(0x89, "l2f", L2F.class), + L2D(0x8a, "l2d", L2D.class), + F2I(0x8b, "f2i", F2I.class), + F2L(0x8c, "f2l", F2L.class), + F2D(0x8d, "f2d", F2D.class), + D2I(0x8e, "d2i", D2I.class), + D2L(0x8f, "d2l", D2L.class), + D2F(0x90, "d2f", D2F.class), + I2B(0x91, "i2b", I2B.class), + I2C(0x92, "i2c", I2C.class), + I2S(0x93, "i2s", I2S.class), + LCMP(0x94, "lcmp", LCmp.class), + FCMPL(0x95, "fcmpl", FCmpL.class), + FCMPG(0x96, "fcmpg", FCmpG.class), + DCMPL(0x97, "dcmpl", DCmpL.class), + DCMPG(0x98, "dcmpg", DCmpG.class), + IFEQ(0x99, "ifeq", IfEq.class), + IFNE(0x9a, "ifne", IfNe.class), + IFLT(0x9b, "iflt", IfLt.class), + IFGE(0x9c, "ifge", IfGe.class), + IFGT(0x9d, "ifgt", IfGt.class), + IFLE(0x9e, "ifle", IfLe.class), + IF_ICMPEQ(0x9f, "if_icmpeq", IfICmpEq.class), + IF_ICMPNE(0xa0, "if_icmpne", IfICmpNe.class), + IF_ICMPLT(0xa1, "if_cmplt", IfCmpLt.class), + IF_ICMPGE(0xa2, "if_icmpge", IfCmpGe.class), + IF_ICMPGT(0xa3, "if_icmpgt", IfCmpGt.class), + IF_ICMPLE(0xa4, "if_icmple", IfCmpLe.class), + IF_ACMPEQ(0xa5, "if_acmpeq", IfACmpEq.class), + IF_ACMPNE(0xa6, "if_acmpne", IfACmpNe.class), + GOTO(0xa7, "goto", Goto.class), + TABLESWITCH(0xaa, "tableswitch", TableSwitch.class), + LOOKUPSWITCH(0xab, "lookupswitch", LookupSwitch.class), + IRETURN(0xac, "ireturn", Return.class), + LRETURN(0xad, "lreturn", Return.class), + FRETURN(0xae, "freturn", Return.class), + DRETURN(0xaf, "dreturn", Return.class), + ARETURN(0xb0, "areturn", Return.class), + RETURN(0xb1, "return", VReturn.class), + GETSTATIC(0xb2, "getstatic", GetStatic.class), + PUTSTATIC(0xb3, "putstatic", PutStatic.class), + GETFIELD(0xb4, "getfield", GetField.class), + PUTFIELD(0xb5, "putfield", PutField.class), + INVOKEVIRTUAL(0xb6, "invokevirtual", InvokeVirtual.class), + INVOKESPECIAL(0xb7, "invokespecial", InvokeSpecial.class), + INVOKESTATIC(0xb8, "invokestatic", InvokeStatic.class), + INVOKEINTERFACE(0xb9, "invokeinterface", InvokeInterface.class), + INVOKEDYNAMIC(0xba, "invokedynamic", InvokeDynamic.class), + NEW(0xbb, "new", New.class), + NEWARRAY(0xbc, "newarray", NewArray.class), + ANEWARRAY(0xbd, "anewarray", ANewArray.class), + ARRAYLENGTH(0xbe, "arraylength", ArrayLength.class), + ATHROW(0xbf, "athrow", AThrow.class), + CHECKCAST(0xc0, "checkcast", CheckCast.class), + INSTANCEOf(0xc1, "instanceof", InstanceOf.class), + MONITORENTER(0xc2, "monitorenter", MonitorEnter.class), + MONITOREXIT(0xc3, "monitorexit", MonitorExit.class), + MULTIANEWARRAY(0xc5, "multianewarray", MultiANewArray.class), + IFNULL(0xc6, "ifnull", IfNull.class), + IFNONNULL(0xc7, "ifnonnull", IfNonNull.class), + GOTO_W(0xc8, "goto_w", GotoW.class); + + private final int code; + private final String name; + private final Class clazz; + + InstructionType(int op, String name, Class clazz) + { + this.code = op; + this.name = name; + this.clazz = clazz; + } + + public int getCode() + { + return code; + } + + public String getName() + { + return name; + } + + public Class getInstructionClass() + { + return clazz; + } + + public static InstructionType findInstructionFromCode(int code) + { + for (InstructionType t : InstructionType.values()) + { + if (t.getCode() == code) + { + return t; + } + } + return null; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instructions.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instructions.java new file mode 100644 index 0000000000..a528950d0a --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Instructions.java @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import net.runelite.asm.attributes.Code; + +public class Instructions +{ + private final Code code; + private final List instructions = new ArrayList<>(); + private final Map labelMap = new HashMap<>(); + + public Instructions(Code code) + { + this.code = code; + } + + public Label createLabelFor(Instruction target) + { + return createLabelFor(target, false); + } + + public Label createLabelFor(Instruction target, boolean forceCreate) + { + assert target.getInstructions() == this; + assert instructions.contains(target); + + if (target instanceof Label) + { + return (Label) target; + } + + int i = instructions.indexOf(target); + if (i > 0) + { + Instruction before = instructions.get(i - 1); + + if (!forceCreate && before instanceof Label) + { + return (Label) before; + } + } + + Label label = new Label(this); + label.setLabel(new org.objectweb.asm.Label()); + instructions.add(i, label); + labelMap.put(label.getLabel(), label); + return label; + } + + public Label findLabel(org.objectweb.asm.Label l) + { + Label label = labelMap.get(l); + assert label != null; + return label; + } + + public Label findOrCreateLabel(org.objectweb.asm.Label l) + { + Label label = labelMap.get(l); + if (label != null) + { + return label; + } + + label = new Label(this, l); + labelMap.put(l, label); + + return label; + } + + public void rebuildLabels() + { + labelMap.clear(); + + // ow2 asm requires new Labels each time you write out a class + // with ClassWriter, or else it crytpically fails + for (Instruction i : instructions) + { + if (i instanceof Label) + { + org.objectweb.asm.Label label = new org.objectweb.asm.Label(); + ((Label) i).setLabel(label); + + labelMap.put(label, (Label) i); + } + } + } + + public List getInstructions() + { + return instructions; + } + + public void addInstruction(Instruction i) + { + assert i.getInstructions() == this; + instructions.add(i); + } + + public void addInstruction(int idx, Instruction i) + { + assert i.getInstructions() == this; + instructions.add(idx, i); + } + + public void remove(Instruction ins) + { + assert ins.getInstructions() == this; + ins.remove(); + instructions.remove(ins); + ins.setInstructions(null); + } + + public void clear() + { + for (Instruction ins : instructions) + { + ins.remove(); + ins.setInstructions(null); + } + instructions.clear(); + } + + public Code getCode() + { + return code; + } + + public void lookup() + { + for (Instruction i : instructions) + { + i.lookup(); + } + } + + public void regeneratePool() + { + for (Instruction i : instructions) + { + i.regeneratePool(); + } + } + + public int replace(Instruction oldi, Instruction newi) + { + assert oldi != newi; + + assert oldi.getInstructions() == this; + assert newi.getInstructions() == this; + + assert instructions.contains(oldi); + assert !instructions.contains(newi); + + int i = instructions.indexOf(oldi); + instructions.remove(oldi); + oldi.setInstructions(null); + instructions.add(i, newi); + + return i; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Label.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Label.java new file mode 100644 index 0000000000..7f2cd70ffd --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Label.java @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code; + +import net.runelite.asm.attributes.code.instructions.NOP; +import org.objectweb.asm.MethodVisitor; + +public class Label extends NOP +{ + private org.objectweb.asm.Label label; + private Integer lineNumber; + + public Label(Instructions instructions) + { + super(instructions); + } + + public Label(Instructions instructions, org.objectweb.asm.Label label) + { + super(instructions); + this.label = label; + } + + @Override + public String toString() + { + String string; + + if (this.getInstructions() == null) + { + string = "label "; + } + else + { + Instruction next = next(); + + if (next == null) + { + string = "label with no next instruction"; + } + else + { + string = "label " + next.toString(); + } + } + + if (lineNumber != null) + { + string += " on line number " + lineNumber; + } + + return string; + } + + @Override + public Instruction clone() + { + Label l = (Label) super.clone(); + l.label = new org.objectweb.asm.Label(); + l.lineNumber = lineNumber; + return l; + } + + @Override + public void accept(MethodVisitor visitor) + { + visitor.visitLabel(label); + + if (lineNumber != null) + { + visitor.visitLineNumber(lineNumber, label); + } + } + + public org.objectweb.asm.Label getLabel() + { + return label; + } + + public void setLabel(org.objectweb.asm.Label label) + { + this.label = label; + } + + public void setLineNumber(Integer lineNumber) + { + this.lineNumber = lineNumber; + } + + public Instruction next() + { + Instructions ins = this.getInstructions(); + int i = ins.getInstructions().indexOf(this); + assert i != -1; + + Instruction next; + do + { + next = ins.getInstructions().get(i + 1); + ++i; + } + while (next instanceof Label); + + return next; + } +} diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSItemLayerMixin.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/LocalVariable.java similarity index 61% rename from runelite-mixins/src/main/java/net/runelite/mixins/RSItemLayerMixin.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/LocalVariable.java index 8b67d4d314..3956b453d1 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSItemLayerMixin.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/LocalVariable.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, SomeoneWithAnInternetConnection + * Copyright (c) 2018 Morgan Lewis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,37 +22,56 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.mixins; +package net.runelite.asm.attributes.code; -import java.awt.geom.Area; -import net.runelite.api.mixins.Inject; -import net.runelite.api.mixins.Mixin; -import net.runelite.rs.api.RSItemLayer; +import org.objectweb.asm.Label; -@Mixin(RSItemLayer.class) -public abstract class RSItemLayerMixin implements RSItemLayer +public class LocalVariable { - @Inject - private int itemLayerPlane; + private final String name; + private final String desc; + private final String signature; + private final Label start; + private final Label end; + private final int index; - @Inject - @Override - public int getPlane() + public LocalVariable(String name, String desc, String signature, Label start, Label end, int index) { - return itemLayerPlane; + this.name = name; + this.desc = desc; + this.signature = signature; + this.start = start; + this.end = end; + this.index = index; } - @Inject - @Override - public void setPlane(int plane) + public String getName() { - this.itemLayerPlane = plane; + return name; } - @Inject - @Override - public Area getClickbox() + public String getDesc() { - throw new UnsupportedOperationException(); + return desc; + } + + public String getSignature() + { + return signature; + } + + public Label getStart() + { + return start; + } + + public Label getEnd() + { + return end; + } + + public int getIndex() + { + return index; } } diff --git a/runelite-mixins/src/main/java/net/runelite/mixins/RSIgnoreMixin.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Parameter.java similarity index 71% rename from runelite-mixins/src/main/java/net/runelite/mixins/RSIgnoreMixin.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/Parameter.java index 98bcd7b3b2..b42a41a4b5 100644 --- a/runelite-mixins/src/main/java/net/runelite/mixins/RSIgnoreMixin.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/Parameter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018, Adam + * Copyright (c) 2018 Morgan Lewis * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -22,28 +22,37 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.mixins; +package net.runelite.asm.attributes.code; -import net.runelite.api.mixins.Inject; -import net.runelite.api.mixins.Mixin; -import net.runelite.rs.api.RSIgnore; -import net.runelite.rs.api.RSName; - -@Mixin(RSIgnore.class) -public abstract class RSIgnoreMixin implements RSIgnore +public class Parameter { - @Override - @Inject + private final String name; + private final int access; + private LocalVariable localVariable; + + public Parameter(String name, int access) + { + this.name = name; + this.access = access; + } + public String getName() { - return getRsName().getName(); + return name; } - @Override - @Inject - public String getPrevName() + public int getAccess() { - RSName prevName = getRsPrevName(); - return prevName == null ? null : prevName.getName(); + return access; + } + + public LocalVariable getLocalVariable() + { + return localVariable; + } + + public void setLocalVariable(LocalVariable localVariable) + { + this.localVariable = localVariable; } } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/AdditionInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/AdditionInstruction.java new file mode 100644 index 0000000000..0fbb69ab1d --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/AdditionInstruction.java @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code.instruction.types; + +import net.runelite.asm.Field; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; +import net.runelite.deob.deobfuscators.mapping.MappingExecutorUtil; +import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping; + +public interface AdditionInstruction extends MappableInstruction +{ + default InstructionContext findArrayLoad(InstructionContext ic1, InstructionContext ic2) + { + Instruction i1 = ic1.getInstruction(); + Instruction i2 = ic2.getInstruction(); + + if (i1 instanceof ArrayLoad && !(i2 instanceof ArrayLoad)) + { + return ic1; + } + if (i2 instanceof ArrayLoad && !(i1 instanceof ArrayLoad)) + { + return ic2; + } + + return null; + } + + @Override + default void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other) + { + /* lhs/rhs of addition instructions are randomally swapped, but + * we still map if each side is recognizable + * + * N.B. since the lhs/rhs of nested iadds can be swapped, and + * the mapper maps the first that it encounters, this can certainly + * attempt to map the wrong instructions even when mapping the correct + * method, so be careful. + */ + StackContext ctx1 = ctx.getPops().get(0); + StackContext ctx2 = ctx.getPops().get(1); + + StackContext other1 = other.getPops().get(0); + StackContext other2 = other.getPops().get(1); + + InstructionContext rc1 = ctx1.getPushed().resolve(ctx1); + InstructionContext rc2 = ctx2.getPushed().resolve(ctx2); //iaload + + InstructionContext ro1 = other1.getPushed().resolve(other1); + InstructionContext ro2 = other2.getPushed().resolve(other2); //iaload + + // There are a couple static final arrays that are only ever read from 1 or 2 places.. and never written + InstructionContext al1 = findArrayLoad(rc1, rc2); + InstructionContext al2 = findArrayLoad(ro1, ro2); + + if (al1 == null || al2 == null) + { + return; + } + + StackContext array1 = al1.getPops().get(1); + StackContext array2 = al2.getPops().get(1); + + InstructionContext field1 = array1.getPushed().resolve(array1); + InstructionContext field2 = array2.getPushed().resolve(array2); + + if (!(field1.getInstruction() instanceof GetFieldInstruction) || !(field2.getInstruction() instanceof GetFieldInstruction)) + { + return; + } + + GetFieldInstruction gf1 = (GetFieldInstruction) field1.getInstruction(); + GetFieldInstruction gf2 = (GetFieldInstruction) field2.getInstruction(); + + Field f1 = gf1.getMyField(); + Field f2 = gf2.getMyField(); + + if (f1 == null || f2 == null || !MappingExecutorUtil.isMaybeEqual(f1, f2)) + { + return; + } + + mappings.map((Instruction) this, f1, f2); + } + + @Override + default boolean isSame(InstructionContext thisIc, InstructionContext otherIc) + { + return this.getClass() == otherIc.getInstruction().getClass(); + } + + @Override + default boolean canMap(InstructionContext thisIc) + { + return true; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayLoad.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayLoad.java new file mode 100644 index 0000000000..da196f0056 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayLoad.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code.instruction.types; + +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; +import net.runelite.deob.deobfuscators.mapping.MappingExecutorUtil; +import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping; + +public interface ArrayLoad extends MappableInstruction +{ + @Override + default void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other) + { + StackContext index1 = ctx.getPops().get(0), + index2 = other.getPops().get(0); + + InstructionContext ctx1 = MappingExecutorUtil.resolve(index1.getPushed(), index1), + ctx2 = MappingExecutorUtil.resolve(index2.getPushed(), index2); + + assert ctx1.getInstruction() instanceof GetFieldInstruction; + assert ctx2.getInstruction() instanceof GetFieldInstruction; + + GetFieldInstruction gf1 = (GetFieldInstruction) ctx1.getInstruction(); + GetFieldInstruction gf2 = (GetFieldInstruction) ctx2.getInstruction(); + mappings.map((Instruction) this, gf1.getMyField(), gf2.getMyField()); + } + + @Override + default boolean isSame(InstructionContext thisIc, InstructionContext otherIc) + { + if (thisIc.getInstruction().getType() != otherIc.getInstruction().getType()) + { + return false; + } + + StackContext index1 = thisIc.getPops().get(0), + index2 = otherIc.getPops().get(0); + + InstructionContext ctx1 = MappingExecutorUtil.resolve(index1.getPushed(), index1), + ctx2 = MappingExecutorUtil.resolve(index2.getPushed(), index2); + + assert ctx1.getInstruction() instanceof GetFieldInstruction; + assert ctx2.getInstruction() instanceof GetFieldInstruction; + + GetFieldInstruction gf1 = (GetFieldInstruction) ctx1.getInstruction(); + GetFieldInstruction gf2 = (GetFieldInstruction) ctx2.getInstruction(); + + return MappingExecutorUtil.isMaybeEqual(gf1.getMyField(), gf2.getMyField()); + } + + @Override + default boolean canMap(InstructionContext thisIc) + { + // assume that obfuscation can't remove a load with a variable + // index. map field access. + StackContext index = thisIc.getPops().get(0); + InstructionContext ctx = MappingExecutorUtil.resolve(index.getPushed(), index); + return ctx.getInstruction() instanceof GetFieldInstruction; + } +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayStoreInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayStoreInstruction.java new file mode 100644 index 0000000000..de019ce9e0 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ArrayStoreInstruction.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.code.instruction.types; + +public interface ArrayStoreInstruction extends MappableInstruction +{ + +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSClanMember.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ComparisonInstruction.java similarity index 91% rename from runescape-api/src/main/java/net/runelite/rs/api/RSClanMember.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ComparisonInstruction.java index ba65238fa4..25e0cdf1da 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSClanMember.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ComparisonInstruction.java @@ -22,10 +22,10 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.rs.api; -import net.runelite.api.ClanMember; +package net.runelite.asm.attributes.code.instruction.types; -public interface RSClanMember extends RSChatPlayer, ClanMember +public interface ComparisonInstruction { + } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ConversionInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ConversionInstruction.java new file mode 100644 index 0000000000..099b281725 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/ConversionInstruction.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.code.instruction.types; + +public interface ConversionInstruction +{ + +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DivisionInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DivisionInstruction.java new file mode 100644 index 0000000000..f682748a65 --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DivisionInstruction.java @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.code.instruction.types; + +import net.runelite.asm.Field; +import net.runelite.asm.attributes.code.Instruction; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; +import net.runelite.deob.deobfuscators.mapping.MappingExecutorUtil; +import net.runelite.deob.deobfuscators.mapping.ParallelExecutorMapping; + +public interface DivisionInstruction extends MappableInstruction +{ + @Override + default void map(ParallelExecutorMapping mappings, InstructionContext ctx, InstructionContext other) + { + StackContext s1 = ctx.getPops().get(0), + s2 = ctx.getPops().get(1); + + StackContext o1 = other.getPops().get(0), + o2 = other.getPops().get(1); + + InstructionContext i1 = MappingExecutorUtil.resolve(s1.getPushed(), s1); + InstructionContext i2 = MappingExecutorUtil.resolve(s2.getPushed(), s2); + + InstructionContext io1 = MappingExecutorUtil.resolve(o1.getPushed(), o1); + InstructionContext io2 = MappingExecutorUtil.resolve(o2.getPushed(), o2); + + if (i1.getInstruction() instanceof GetFieldInstruction && io1.getInstruction() instanceof GetFieldInstruction) + { + GetFieldInstruction f1 = (GetFieldInstruction) i1.getInstruction(); + GetFieldInstruction f2 = (GetFieldInstruction) io1.getInstruction(); + + Field fi1 = f1.getMyField(), fi2 = f2.getMyField(); + + if (fi1 != null && fi2 != null) + mappings.map((Instruction) this, fi1, fi2); + } + + if (i2.getInstruction() instanceof GetFieldInstruction && io2.getInstruction() instanceof GetFieldInstruction) + { + GetFieldInstruction f1 = (GetFieldInstruction) i2.getInstruction(); + GetFieldInstruction f2 = (GetFieldInstruction) io2.getInstruction(); + + Field fi1 = f1.getMyField(), fi2 = f2.getMyField(); + + if (fi1 != null && fi2 != null) + mappings.map((Instruction) this, fi1, fi2); + } + } + + @Override + default boolean isSame(InstructionContext thisIc, InstructionContext otherIc) + { + return this.getClass() == otherIc.getInstruction().getClass(); + } + + @Override + default boolean canMap(InstructionContext thisIc) + { + return true; + } +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSObjectComposition.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DupInstruction.java similarity index 67% rename from runescape-api/src/main/java/net/runelite/rs/api/RSObjectComposition.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DupInstruction.java index 3df00175f5..93ccb70e45 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSObjectComposition.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/DupInstruction.java @@ -22,38 +22,30 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.rs.api; -import net.runelite.api.ObjectComposition; -import net.runelite.mapping.Import; +package net.runelite.asm.attributes.code.instruction.types; -public interface RSObjectComposition extends ObjectComposition +import java.util.List; +import net.runelite.asm.execution.InstructionContext; +import net.runelite.asm.execution.StackContext; + +public interface DupInstruction { - @Import("id") - @Override - int getId(); + StackContext getOriginal(StackContext sctx); + + StackContext getOtherBranch(StackContext sctx); - @Import("name") - @Override - String getName(); + /** + * get the duplicated stackcontexts (which is popped from this) + * @param ictx instruction context for this instruction + * @return + */ + List getDuplicated(InstructionContext ictx); - @Import("actions") - @Override - String[] getActions(); - - @Import("mapSceneId") - @Override - int getMapSceneId(); - - @Import("mapIconId") - @Override - int getMapIconId(); - - @Import("impostorIds") - @Override - int[] getImpostorIds(); - - @Import("getImpostor") - @Override - RSObjectComposition getImpostor(); + /** + * get the copied stackcontexts (pushed from this) + * @param ictx + * @return + */ + List getCopies(InstructionContext ictx); } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/FieldInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/FieldInstruction.java new file mode 100644 index 0000000000..e9ed4999ff --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/FieldInstruction.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code.instruction.types; + +import net.runelite.asm.pool.Field; + +public interface FieldInstruction +{ + Field getField(); + + void setField(Field field); + + net.runelite.asm.Field getMyField(); +} diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/GetFieldInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/GetFieldInstruction.java new file mode 100644 index 0000000000..f5a5af480a --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/GetFieldInstruction.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package net.runelite.asm.attributes.code.instruction.types; + +public interface GetFieldInstruction extends FieldInstruction +{ +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSDeque.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/IntInstruction.java similarity index 89% rename from runescape-api/src/main/java/net/runelite/rs/api/RSDeque.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/IntInstruction.java index 9a0c2aa303..2bc361ef44 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSDeque.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/IntInstruction.java @@ -22,15 +22,12 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.rs.api; -import net.runelite.mapping.Import; +package net.runelite.asm.attributes.code.instruction.types; -public interface RSDeque +public interface IntInstruction { - @Import("current") - RSNode getCurrent(); + int getOperand(); - @Import("head") - RSNode getHead(); + void setOperand(int operand); } diff --git a/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/InvokeInstruction.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/InvokeInstruction.java new file mode 100644 index 0000000000..9396f974de --- /dev/null +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/InvokeInstruction.java @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2016-2017, Adam + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package net.runelite.asm.attributes.code.instruction.types; + +import java.util.List; +import net.runelite.asm.Method; + +public interface InvokeInstruction extends MappableInstruction +{ + void removeParameter(int idx); + + net.runelite.asm.pool.Method getMethod(); + + void setMethod(net.runelite.asm.pool.Method method); + + List getMethods(); +} diff --git a/runescape-api/src/main/java/net/runelite/rs/api/RSHashTable.java b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/JumpingInstruction.java similarity index 83% rename from runescape-api/src/main/java/net/runelite/rs/api/RSHashTable.java rename to deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/JumpingInstruction.java index e1462ce1dd..fc1dda4b3a 100644 --- a/runescape-api/src/main/java/net/runelite/rs/api/RSHashTable.java +++ b/deobfuscator/src/main/java/net/runelite/asm/attributes/code/instruction/types/JumpingInstruction.java @@ -22,20 +22,16 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package net.runelite.rs.api; +package net.runelite.asm.attributes.code.instruction.types; -import net.runelite.api.HashTable; -import net.runelite.mapping.Import; +import java.util.List; +import net.runelite.asm.attributes.code.Label; -public interface RSHashTable extends HashTable +public interface JumpingInstruction { - @Import("get") - @Override - RSNode get(long value); + List