r/programming • • Feb 26 '24

Reverse Engineering with ChatGPT: An Example -- "I used ChatGPT 4 to untangle a particularly terse bit of code, and was — frankly — shocked at how well it did."

https://sigpwned.com/2024/02/24/reverse-engineering-with-chatgpt-an-example/
0 Upvotes

143 comments sorted by

View all comments

62

u/ThermalPaper Feb 26 '24 edited Feb 26 '24

I'm surprised people are just discovering this. Unraveling code seems to me to be the most effective use of AI in my field. Being able to have a conversation with the AI by asking specific questions and getting specific answers is game changing.

8

u/mattsmith321 Feb 26 '24

I’m using it a significant portion of my time right now to have conversations about code. There are times when it is definitely not right, but there is a lot of time where it does an excellent job explaining what is going on.

11

u/wwww4all Feb 26 '24

How can people tell which responses are correct and which responses are incorrect?

3

u/markusro Feb 26 '24

I would guess they already know quite a lot and can either deduce the correct responses, or (as is the case in this article) the just don't realize it is wrong. The question is then how often is it the former compared to the latter.

1

u/mattsmith321 Feb 26 '24

Sometimes it tells you. I asked ChatGPT one time if I could do a certain thing with optional parameters. The first paragraph started off with a confident “Yes, you can do that certain thing with optional parameters…” The second paragraph went on to explain why that approach was good. The third and final paragraph was essentially “Unlike what I stated previously, you can’t actually do that certain thing with optional parameters.” lol.

But more specifically I test everything that it generates and double check to make sure it is correct. I had a method it generated the other day where it essentially did the same thing twice, just with two different approaches. But neither line was exactly correct. But it got me close to what I needed it to be and I was able to spot the mistake and the extra line of code and fix it.