# Unknown Code Retrieval

**URL:** <https://forum.arduino.cc/t/unknown-code-retrieval/1000374>\
**Category:** Interfacing w/ Software on the Computer\
**Created:** [June 7, 2022, 2:38pm UTC](https://forum.arduino.cc/t/unknown-code-retrieval/1000374 "2022-06-07T14:38:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![oliverelewis](https://avatars.discourse-cdn.com/v4/letter/o/97f17d/32.png) [@oliverelewis](https://forum.arduino.cc/u/oliverelewis)\
**Post date:** [June 7, 2022, 2:38pm UTC](https://forum.arduino.cc/t/unknown-code-retrieval/1000374/1 "2022-06-07T14:38:54Z")

</div>

I am working on a project which involves the use of an Arduino Mega. Someone has previously written a lengthy piece of code which mostly performs the correct necessary functions but requires several modifications. Unfortunately, I do not have access to this code and cannot contact the individual who wrote the code in the first place. Is it possible to download the HEX file on the Arduino and then convert said HEX file back into Arduino code? If so, how? This would be much preferred compared to writing the whole bulk of code myself and would save a lot of time.

---

<div class="post-metadata">

**Author:** ![kolaha](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kolaha/32/966427_2.png) [@kolaha](https://forum.arduino.cc/u/kolaha)\
**Post date:** [June 7, 2022, 2:44pm UTC](https://forum.arduino.cc/t/unknown-code-retrieval/1000374/2 "2022-06-07T14:44:25Z")

</div>

it is easier to learn C++ and write any needed sketches as wasting time while decoding machine code to something readable

---

<div class="post-metadata">

**Author:** ![anon73444976](https://avatars.discourse-cdn.com/v4/letter/a/439d5e/32.png) [@anon73444976](https://forum.arduino.cc/u/anon73444976)\
**Post date:** [June 7, 2022, 2:44pm UTC](https://forum.arduino.cc/t/unknown-code-retrieval/1000374/3 "2022-06-07T14:44:33Z")

</div>

> [@oliverelewis](#):
>
> . Is it possible to download the HEX file on the Arduino and then convert said HEX file back into Arduino code? I

Not easily, no.

---

<div class="post-metadata">

**Author:** ![sterretje](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/sterretje/32/391294_2.png) [@sterretje](https://forum.arduino.cc/u/sterretje)\
**Post date:** [June 7, 2022, 2:48pm UTC](https://forum.arduino.cc/t/unknown-code-retrieval/1000374/4 "2022-06-07T14:48:13Z")

</div>

> [@oliverelewis](#):
>
> Is it possible to download the HEX file on the Arduino

Yes

> [@oliverelewis](#):
>
> and then convert said HEX file back into Arduino code

No, There are tools that attempt to convert assemby to C, not sure how good they are; and it will never be the Arduino "language".

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [December 4, 2022, 2:48pm UTC](https://forum.arduino.cc/t/unknown-code-retrieval/1000374/5 "2022-12-04T14:48:46Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
