TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Capstone Disassembler Framework

40 点作者 jmacjmac大约 4 年前

3 条评论

molticrystal大约 4 年前
Also about 4 months ago a new version of Unicorn emulator was released, about 3.5 years after the last official release. It was a very minor change though:<p><pre><code> Various bugfixes for the core and bindings of all architectures. No longer require Python to build the core. Support read&#x2F;write to many new registers of X86 &amp; Arm64. Add new API: uc_context_free() Add new query type: UC_QUERY_TIMEOUT Better support for native Windows build </code></pre> Keystone assembler also got a release in the summer of last year after several years.<p>So if you thought they were dead, it seems there are still a few stones unplaced.
khalladay大约 4 年前
Capstone is a real treat to work with. It has a lot of quality of life features that really sped up development when I was putting together a function hooking system (like tagging instructions with RIP-relative operands).
peter_d_sherman大约 4 年前
Idea:<p>If any assembler&#x2F;disassembler author&#x2F;team out there wants to produce an assembler&#x2F;disassembler which is authoritative (difficult to do on x86, because there are so many different possible combinations of instruction encoding, <a href="https:&#x2F;&#x2F;github.com&#x2F;xoreaxeaxeax&#x2F;sandsifter" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;xoreaxeaxeax&#x2F;sandsifter</a> : &quot;Typically, several million undocumented instructions on your processor will be found, but these generally fall into a small number of different groups.&quot;) -- then what they&#x27;d do is to create a third program -- which &quot;pits&quot; the output of Assembler A vs. Assembler B, Disassembler A vs. Disassembler B...<p>That is, between any two assemblers (for the same CPU architecture&#x2F;instruction set), or any two disassemblers (again, for the same instruction set), <i>where are the anomalies</i>?<p>If we think about an assembler as a simple function, y=f(x), that is, I give it a string of ascii bytes as input (x), and I get a string (1..n) binary bytes as output (y), and a disassembler as the reverse function, then how difficult would it be to write a program which imported the assembly functionality of two (or more) assemblers, and then just started comparing the outputs?<p>Well, there&#x27;s a slight problem there, which is, that you&#x27;d have to create a series of strings representing valid assembler instructions first...<p>But, why not let the disassembler(s) do that!<p>So our future program for &quot;pitting&quot; assembler vs. assembler, disassembler vs. disassembler looks like this:<p>1) Start with a single byte, 00.<p>2) Pass that byte to the disassembler. Is it a valid instruction?<p>3) If so, pass the string passed back to an assembler, and get the result of that.<p>4) Is the resulting binary byte (or byte string) the same as the one we started with? If so, all OK. If not, log the anomaly to a log!<p>5) Increment single byte by 1, perform above instructions in a loop until after we hit 255, then start with a 2-byte string, and same thing (like an odometer). Keep doing this until we&#x27;ve expanded to the max allowable for a x86, which I believe is 15 bytes in length (Note: That&#x27;s one BIG number(!) -- could we perform this loop in one lifetime? I don&#x27;t know... perhaps if it took too long we could intelligently skip some combinations like Christopher Domas does in Sandsifter)...<p>But anyway, that would be the algorithm for &quot;pitting&quot; Assembler vs. Assembler (or perhaps more specifically Assembler vs. Disassembler (you get the general idea of what&#x27;s being said here!)) -- and comparing the results!<p>Think of it as a &#x27;diff&#x27; tool -- but for the output of assemblers&#x2F;disassemblers -- as opposed to files...<p>Why?<p>Well, because x86 is complex, to say the least!<p>And well, because it&#x27;s more likely than not, that any given Assembler&#x2F;Disassembler -- contains bugs and&#x2F;or errors, even though they might not be intentional!<p>Anyway, if no one else does it... I&#x27;ll do it in the future (too busy with other things right now!)... so &quot;Note to future self&quot; &lt;g&gt;.<p>But the entire program would amount to a few loops...<p>Actually, that&#x27;s another good point... Any assembler&#x2F;disasembler program worth its salt -- should provide its libraries with Python (or other easily scriptable language) bindings... many do; some don&#x27;t; just a random related observation...
评论 #26363392 未加载
评论 #26364765 未加载