Short answer:
- The server sends a variable that says the player is B-ing in a packet.
- That variable is saved to an address in memory.
- That address is checked every X tick(s) of the bot to see if someone is B-ing. The users can check this with an API command.
Reading memory wont get you banned unless they have some sort of anti-cheat, and state that they will ban you in their TOS. RIOT servers do not seem to have either of these, but Garena does (XINCODE3).
Not 100% sure about RIOT's reason for the Recall thing, but this would be mine:
The reason B-ing is always readable is because: if a player is lagging and shoots a missile, they should still have the info sent to them for where people are B-ing to hide the lag of that missile. Imaging if you shot an Ashe R, lag, and don't see your arrow hit someone because the packet of them being there returning to base hasn't gotten to you yet. Just because you don't see it doesn't mean its not saved in memory.
If you wanted to write a simple pseudo hack ('Hello World' level):
- Scan memory to find the BASE address in ram for the program. Do this every launch. The BASE is the address where a programs memory allocation starts, this changes every launch.
- Scan memory addresses starting at that base address for something you know (the players name in this example), and note that address.
- Subtract the BASE address from your character name address. This is the "offset" for the player name. Save this to a variable.
- Add the "offset" you just found to the BASE address to always get the location of the player name in memory. You need to do this because the BASE changes every run on most machines.
- Read the address of the sum in the last step to get the player name.
Note: Some developers/compilers hide these well, and you have to use patterns to find the offsets in real time at launch. You will also need to re-acquire the offsets and check the patterns after each new build of the program is released (each patch in a game).
TLDR: GOS uses magnets. 