update doc

This commit is contained in:
hengyunabc committed 2020-08-28 16:33:35 +08:00
1 parent d2aa602115
commit 26b92f34e7
28 files changed
+252 -26

No files matched your search

+13
View File
@@ -249,6 +249,19 @@ field: random
seedOffset=@Long[24],
]</pre></div>
</div>
<ul class="simple">
<li><p>Specify classLoader</p></li>
</ul>
<p>Note that the hashcode changes, you need to check the current ClassLoader information first, and extract the hashcode corresponding to the ClassLoader using <code class="docutils literal notranslate"><span class="pre">sc</span> <span class="pre">-d</span> <span class="pre">&lt;ClassName&gt;</span></code>.</p>
<p>if you use<code class="docutils literal notranslate"><span class="pre">-c</span></code>, you have to manually type hashcode by <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">&lt;hashcode&gt;</span></code>.</p>
<div class="highlight-bash notranslate"><div class="highlight hljs"><pre class="bash">$ getstatic -c 3d4eac69 demo.MathGame random</pre></div>
</div>
<p>For classloader with only one instance, it can be specified by <code class="docutils literal notranslate"><span class="pre">--classLoaderClass</span></code> using class name, which is more convenient to use.</p>
<p><code class="docutils literal notranslate"><span class="pre">getstatic</span> <span class="pre">--classLoaderClass</span> <span class="pre">demo.MathGame</span> <span class="pre">random</span></code></p>
<ul class="simple">
<li><p>PS: Here the classLoaderClass in java 8 is sun.misc.Launcher$AppClassLoader, while in java 11 it’s jdk.internal.loader.ClassLoaders$AppClassLoader. Currently katacoda using java 8.</p></li>
</ul>
<p>The value of <code class="docutils literal notranslate"><span class="pre">--classloaderclass</span></code> is the class name of classloader. It can only work when it matches a unique classloader instance. The purpose is to facilitate the input of general commands. However, <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">&lt;hashcode&gt;</span></code> is dynamic.</p>
<p>Tip: if the static field is a complex class, you can even use <a class="reference external" href="https://commons.apache.org/proper/commons-ognl/language-guide.html"><code class="docutils literal notranslate"><span class="pre">OGNL</span></code></a> to traverse, filter and access the inner properties of this class.</p>
<div class="toctree-wrapper compound">
<ul>