Brain explode: AI is getting a little scary

Okay I kind of just had my mind blown.
I am working on an interesting project in which I need to modify a PE file. The problem with modifying PE files is there is a checksum that windows defender looks at and flags you as being a mean bad jerk and puts your executable in executable jail. Soooo I need to fix that header.
First I asked chatGPT how I could accomplish this with rust.

Looks plausible. I copy the code into a new rust project... well the code was close, but chatGPT made up some functions and thus the logic of the code won't work.
A little frustrated I asked google how to check the header with python...

Cool, Google AI gave me a snippet... I made a quick virtualenv, pip installed pefile
and I had a working example that could validate the header checksum for me.
Next I loaded up cursor and pointed it at the rust project I had made from chatGPT. Not even thinking about the python snippet and venv in that folder. (This is called foreshadowing, It is my understanding that it is good for story telling)
I ask the cursor agent (which is claude-sonnet 3.7) the following:

Cursor did it's thing. Offered up some changes and it works.
x-pe$ cargo run
Compiling x-pe v0.1.0 (/home/evan/repos/x-pe)
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.37s
Running `target/debug/x-pe`
Old Checksum: 0x692460
New Checksum: 0x683B86
Checksum fixed successfully!
Looking at what cursor did. First it searched for the library and functions to fix the header. Didn't find anything... It also recognized that the library functions from the chatGPT code didn't exist. Then with no prompting at all found the python snippet, the algorithm in the virtualenv code and re-implemented the algorithm in rust... 🤯
And it worked the first time I ran it. Most importantly now defender doesn't hate my binaries.
I don't know what it means exactly, but that was pretty cool.