I think in the end Conan sneak up on them by hiding himself in transportation Gin was taking. He then bugged himself with cellphone, and somehow able to eavesdrop them. Vermouth noticed him, and turn him in to Black Organization. He then realize who is the boss, much to his shock and disbelief. He told them his own real identity, told them he has to lie his girlfriend and family as he turn sentimental. The boss asked Gin and Vodka not to kill Conan, as told them Conan is now part of experiment as he admit himself is founder of pill for many years.
They locked Conan up in the cage. When Conan realized them is out of his ear's reach, he then secretly tell the police to reach and arrest them, as they once tried to attempt kill him but he's not going anywhere until B.O. was arrested. The police, S.W.A.T and FBI came and bring down Black Organization, and Takagi come to free Conan. When the police win the war, Vermouth took this moment kill Vodka. Sato arrest the boss, and learn of explosion taking place soon, Takagi and Conan all on the way escape and were hurt after explosion taking place.
The boss plan to escape and disarm Sato, but had himself smacked down by Ran's kick. When Conan woke in hospital, was surprised to see her keep addressing him as Conan. Later he learn from police, they want him to tell Ran personally, as they know her kick hurt more than her temper so they thought best to let Shinichi hurt less by letting him to confess. They received request from Haibara not to leak Shinichi's secret as he plan to tell it to Ran personally. And Heiji barged in and yelled his real name but to Conan's dismay and anger. Ran came in to see Shinichi as she heard him calling Kudo, thinking her boyfriend is here.
Conan take his cue and ask Heiji to give personal space, and Ran finally sit down to hear Conan going to tell his secret. Later Kogoro barged in, telling he heard from Eri about Conan in hospital. He then blurted the secret, but Ran and Kogoro don't believe it, Kudo Yusaku and Yukkiko came in to verify the truth with them. Yukkiko admit she was in disguise when pick Conan up, and he believe it's kidnap situation that cause detective blush. Shinichi's parents asked Kogoro and Ran to calm down and allowed their son to tell the story. They convince Ran to let Shinichi off until he discharged from hospital.
Afterwards, Ran doesn't know does she want to forgive Shinichi, he tell his parents he need a musical instrument to play a song. Sooo, after many days they avoid to talk about his secret, Kudo parents decided to take Shinichi to America, and picked him up after he discharged. He turn back to his original form when he heard the laboratory found one when Haibara send her research and findings. So somehow Ran managed to calm down, hears the song she know so well. Soon he manage to reconcile with her, ask her to go to America with him. Jodie tell Eri Conan is Shinichi, who receive protection from FBI and has alias of Edogowa Conan, and Eri accept the fact Conan is Shinichi as Sato also think best of victim have to disguise if to protect Ran from terrorist. Ran told her she's going to America with Shinichi, Eri agree she allowed to go with him.
Eri went to see Conan, and hear from him Kogoro is good detective when Mouri willing to place effort to find who's the murderer, tell Kogoro have once crack few cases on his own. She then decided to move in with Kogoro, and happily live together with him as he changed his bad habit when she spend time with him. Ran send postcards to them during her stay in America, live happily with Shinichi.