<Guest0>
i have just developed a caesar cipher program on my stm32f429 device. the key in the device is "3" and i would like to extract this key from my device. i think i need to get a memory dump of my device. so, can you tell me the potential scenarios for extracting the secret key from my board? how can i do it? (im also open for your resource
<Guest0>
suggestions), thanks a lot!
<olerem>
Guest0: create memory dump and flush dump. use radare2 to extract the key
bencoh has joined #openocd
bencoh has quit [Changing host]
<Guest0>
olerem as i understand radare2 is a tool to analyze bin files. but, how can i dump memory of any device?
Error403 has joined #openocd
<Haohmaru>
"of any device" is too broad, for that particular chip one way is via SWD debugger
<Haohmaru>
where's the data you wanna get? in the RAM or in the flash?
Bugies has joined #openocd
<Guest0>
Haohmaru I defined the secret key in an int variable, so i think its in RAM
<Haohmaru>
an int variable may be in RAM or flash or both, depends on how you compile and build the thing
<Haohmaru>
if it's in flash, it may be enough to use the .elf and radare2 to find it
<Haohmaru>
if it's in RAM - debugger
Guest0 has quit [Ping timeout: 252 seconds]
Error403 has quit [Quit: Leaving]
nerozero has quit [Remote host closed the connection]
nerozero has joined #openocd
Bertl_zZ is now known as Bertl
Guest0 has joined #openocd
<Guest0>
Haohmaru which debugger can i use? and how to use .elf and radare2 :') when i read blog post about radare2 i see this command: "radare2 file.exe" but do not have a binary
<PaulFertser>
Guest0: are you a student?
<PaulFertser>
Guest0: you can use same debugger you're using to flash the stm32 part
<Guest0>
yes i am
<PaulFertser>
Guest0: since you have the source code I suggest you do objdump -S to see how your code translates into assembly and where exactly that key is stored and how it's handled.
<Guest0>
umm yes i know that i can use ST Utility program to inspect memory. But it will only work for STM devices, i would like to gain experience on reversing on embedded devices
<PaulFertser>
Guest0: we're on OpenOCD channel, so for get the proprietary utility.
<Guest0>
PaulFertser is it possible to dump the memory with OpenOCD? If so, how can I do it
<Haohmaru>
Guest0 the .elf *is* the binary/exe
<Haohmaru>
your compiler most-probably spits out an .elf
<Guest0>
Haohmaru ok sir but i will think like it is not my device. Please assume i am reversing a foreign board. I still have the source code, but an reverse engineer will not have my codes (and .elf output of compiler) - thats why i do not want to use STM softwares like ST Utility
<Guest0>
how could I see the secret key in memory if it would not my device and I would not have the elf output?
<Xogium>
the whole point of secret key is, well.. Hopefully its stored in some secure storage, be it memory or otherwise, so I don't think you could see it so easily if at all
<Guest0>
actually it is not a secret key sir, i just defined the key by an integer variable and its probably stored in flash