It difficult to judge scale from pic. but the bottom piece may be an attatchment for a hand ratchet. Snaps on before the socket,makes it easier to hand tighten a nut or bolt without moving the ratchet handle. Is the hole square ?
get a clearer picture of the lock so I can tell you about it. You can look at other posts that I have replyed to in ref to locks. You will probably find it.