The brain consists out of millions of cells that are connected by neurons, and it is the combination of them along with their connections that make up the brain. Memories aren't stored in a single braincell, but instead a stimulus will activate several brain cells that fire their neurons together, the more they do this the more they get linked for faster firing and thus recollection. Handy for learning math, how to brush your teeth or walking.
So for your nanobots to decipher the brain you would have to know it's exact composition right now. The nanobot needs to be able to scan the braincell and predict what would happen if it was hit by a stimulus of a wide range of magnitudes, and what kind of signal it would send and where that would go. So you would also need to know where the current neuron connections are, what these are connected too and also how these connections grow to create sequences and grouped braincells to store memory and functions.
On top of that short-term memory seems to be stored for a large part in the neurons themselves, and their current active state needs to be taken into account. Neurons can have feedbackloops to hold a signal for a long time, for example when you have a wound so you feel a dull pain and avoid damaging it further, but it can also be used for storing other information for a time like a phone number or adress.
So that's what your nanobots first need to know. The composition of the braincells, the way the braincells would interpret a signal and based on their composition what signal it would send, the grouping of the braincells and the placement, connections, growth and changes of the neurons during use.
Then they need to combine all this information to map out the brain, and see where they want to make changes. Your nano"bots" are most likely a type of virusses that use that swarm intelligence where every individual machine is stupid but together they can solve complex tasks (just like the brain they want to change).
Some reading material into this if you want: