To extract the code, you cannot use the standard "Upload" button in the Arduino IDE. Instead, you need tools designed for direct memory access: how to download the current code from an arduino board?
When you "download" from an Arduino, you are essentially performing a of the flash storage. 2. Tools You’ll Need download current code from arduino
How to Download Current Code from Arduino Losing the original source code for an Arduino project is a common headache for makers. Whether you've accidentally deleted a .ino file or you need to replicate a device whose programmer is no longer available, you might wonder if you can "download" the code back from the board. To extract the code, you cannot use the