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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

TIL you can de-obfuscate code with ChatGPT

225 点作者 alexandr1us超过 2 年前

19 条评论

shever73超过 2 年前
<a href="https:&#x2F;&#x2F;twitter.com&#x2F;AlexAlexandrius&#x2F;status&#x2F;1617885287048425478?s=20&amp;t=fVNqR7S_mhvIDHtRe50Wrw" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;AlexAlexandrius&#x2F;status&#x2F;16178852870484254...</a><p>So, all I&#x27;ve learned is that ChatGPT knows the obfuscated and de-obfuscated versions of code that it itself has generated.
评论 #34506574 未加载
评论 #34504210 未加载
crizzlenizzle超过 2 年前
Is it correct though?<p>I’ve been toying around with ChatGPT for a few weeks now and I encountered a few situations in which ChatGPT was like 90% accurate at best. Things like suggesting snippets of configuration files or plugin research. It’s good to get an idea and get started somewhere, but I certainly cannot trust it blindly.
评论 #34505674 未加载
评论 #34503642 未加载
评论 #34505302 未加载
评论 #34504584 未加载
评论 #34507533 未加载
评论 #34504003 未加载
评论 #34509248 未加载
评论 #34504447 未加载
评论 #34507560 未加载
评论 #34503882 未加载
rednerrus超过 2 年前
It&#x27;s been my experience that ChatGPT gets things wrong sometimes. It&#x27;s also been my experience that if you say &quot;X isn&#x27;t working as expected.&quot; it will do its best to fix the issues. It usually does a pretty good job of fixing it.<p>I had it write a handful of scripts for me yesterday. It got about 90% of it right on the first pass and 99% of it right on the second pass. You still need to have some understanding of what you&#x27;re doing so you can see when things are wrong but man if it doesn&#x27;t save you a lot of time.
ZyanWu超过 2 年前
Misleading, ChatGPT generated both obfuscated and de-obfuscated code
评论 #34503916 未加载
mlatu超过 2 年前
i would rather ask it to give me the python source of a program capable to deobfuscate THAT string.<p>anything else is just naive, wishfull thinking and a waste of time. you will have to deobfuscate the code manually anyways<p>but at least you got on HN<p>EDIT:<p>OMG...<p>the obfuscated code was generated by chatgpt<p>AND DOESNT EVEN WORK
评论 #34503864 未加载
teeray超过 2 年前
Every commenter is jumping in asking “is it correct?” Even if it’s not 100%, if it’s at least reasonably close, it could be a tremendous force-multiplier against obfuscation for someone with some familiarity with roughly what the code is trying to do.
评论 #34503725 未加载
评论 #34503853 未加载
评论 #34507293 未加载
shagie超过 2 年前
Fortunately, there&#x27;s a good repository of obfuscated code.<p><a href="https:&#x2F;&#x2F;www.ioccc.org" rel="nofollow">https:&#x2F;&#x2F;www.ioccc.org</a><p><pre><code> int main(int b,char**i){long long n=B,a=I^n,r=(a&#x2F;b&amp;a)&gt;&gt;4,y=atoi(*++i),_=(((a^n&#x2F;b)*(y&gt;&gt;T)|y&gt;&gt;S)&amp;r)|(a^r);printf(&quot;%.8s\n&quot;,(char*)&amp;_);} </code></pre> If you want to get the same (or similar) results:<p><pre><code> curl https:&#x2F;&#x2F;api.openai.com&#x2F;v1&#x2F;completions \ -H &quot;Content-Type: application&#x2F;json&quot; \ -H &quot;Authorization: Bearer $OPENAI_API_KEY&quot; \ -d &#x27;{ &quot;model&quot;: &quot;code-davinci-002&quot;, &quot;prompt&quot;: &quot;Deobfuscate the following C code:\n\nint main(int b,char**i){long long n=B,a=I^n,r=(a&#x2F;b&amp;a)&gt;&gt;4,y=atoi(*++i),_=(((a^n&#x2F;b)*(y&gt;&gt;T)|y&gt;&gt;S)&amp;r)|(a^r);printf(\&quot;%.8s\\n\&quot;,(char*)&amp;_);}&quot;, &quot;temperature&quot;: 0, &quot;max_tokens&quot;: 256, &quot;top_p&quot;: 1, &quot;frequency_penalty&quot;: 0, &quot;presence_penalty&quot;: 0 }&#x27; </code></pre> That one loops on the response:<p><pre><code> The code is obfuscated with the following rules: * `B` is the value of `b` * `I` is the value of `i` * `T` is the value of `y` * `S` is the value of `_` </code></pre> Changing to: &quot;model&quot;: &quot;text-davinci-003&quot;,<p><pre><code> int main(int b, char** i) { long long n = b, a = *i[0] ^ n, r = (a &#x2F; b &amp; a) &gt;&gt; 4, y = atoi(*++i), _ = (((a ^ n &#x2F; b) * (y &gt;&gt; 8) | y &gt;&gt; 7) &amp; r) | (a ^ r); printf(&quot;%.8s\n&quot;, (char*)&amp;_); } </code></pre> Which... isn&#x27;t exactly helpful.<p>Asking it to explain it instead:<p><pre><code> This code is a C program that prints out a string. The program takes two parameters, b and i, and assigns them to variables n and a. Then the program performs various calculations on those variables and the parameters, such as shifting and bitwise operations. Finally, the program prints out the result of the calculations, which is stored in the variable _, as an 8-character string.</code></pre>
captainmuon超过 2 年前
Wow, I wonder how many &quot;bytes of state&quot; ChatGPT must have internally to be able to do that transform. Or does it guess from certain sequences and just writes something plausible?<p>It would be interesting to test if it can solve &quot;memory hard&quot; problems, like repeated obfuscation or hashing, that would require large internal state. Then you could map how large the equivalent memory would be.
azatom超过 2 年前
Two types of comments:<p>- &quot;the result doesn&#x27;t even work...&quot; yeah, even to be a rubberduck is amazing, what thll you expect, got your payment too?<p>- &quot;wow, amazing...&quot;: not really, best case it is a google without (direct) advertisement, found the original code&#x2F;very similar parts..<p>tryied with own obfuscated code, not from the net... can not get anything from it
dom96超过 2 年前
Also interested about its accuracy. I built a C&#x2F;C++ obfuscator[0] a while back, I&#x27;ll have to make a note to see how well ChatGPT deobfuscates its output.<p>[0] - <a href="https:&#x2F;&#x2F;picheta.me&#x2F;obfuscator" rel="nofollow">https:&#x2F;&#x2F;picheta.me&#x2F;obfuscator</a>
Double_a_92超过 2 年前
More like: &quot;ChatGPT can pretend to deobfuscate the code&quot;
评论 #34503548 未加载
cinntaile超过 2 年前
That&#x27;s amazing, I&#x27;ll have to try this. Did you verify that it&#x27;s correct?
omgomgomgomg超过 2 年前
And the thing does not learn, it does not save the good answers somewhere nor does it discard the bad ones.<p>I have asked it to generate some mac os compatible vba code, oh dear, that &quot;macro&quot; never worked so far.
jcadam超过 2 年前
I asked ChatGPT to write me a fibonacci sequence generator suitable for entry into the obfuscated C contest. And it actually spit out something reasonably well obfuscated (used lots of macros).
arriu超过 2 年前
Could this be taken to the extreme by asking it to decompile assembly?
评论 #34503653 未加载
评论 #34504097 未加载
评论 #34504134 未加载
评论 #34503774 未加载
1970-01-01超过 2 年前
Soundness implies validity, but validity does not imply soundness.
RektBoy超过 2 年前
Give it binary obfuscated with VMprotect
KomoD超过 2 年前
Wasn&#x27;t really a particularly difficult sample... You know what it does by just looking at it.
dsabanin超过 2 年前
I have to say, I find all the comments dismissing ChatGPT hilarious. I read them in a funny grandpa voice. However, we should look past the insignificant details. The main achievement is that we now have a really capable unstructured text-to-computer interface. We can hook it up to anything and it will give us answers with whatever properties we desire, in whatever shape we can think of.
评论 #34504110 未加载
评论 #34504525 未加载
评论 #34504372 未加载
评论 #34507403 未加载
评论 #34505582 未加载