Dear all,
Thank you very much for your help. I have managed to get very far along with this issue.
I will document this experience here so people in the future with a similar problem may get something useful from it.
Today I did as you suggested. I armed myself with some photographs, and went to immigration tower. On the way I called my consulate and told them my situation. They said that I should go to immigration tower to extend my visa and then go to the consulate to pick up my new passport.
I arrived at the immigration tower, went to 5th floor, told the woman in the counter my situation and filled some forms. She asked me to wait. When she called me back, she said the officer said they couldn't extend my visa because today was the expiry date of my visa and then suggested that I had to fly tonight. I remarked it was impossible for me to leave a state and get into another without a passport. She apologized and repeated the reason of the refusal. That turned me into mode and I knew something else had to be done.
I called my consulate and let them know my situation. Meanwhile I went to a counter in the 4th floor(I didn't even see what the purpose of the place was, all they told me was that "this not the place for extensions") and sent me to 2nd floor. In second floor they sent me back to the 5th floor, where I had to cut through more bullshit. Long story short, my consulate contacted the officer whom initially rejected my request and he told me that I should get a new passport and come back when I got it. They said they could extend my visa(as a tourist) for up to 40 as long as I was getting a new passport.
I went to my consulate afterwards and got my new passport(I am from Peru), however I still need a new visa for the place I am going after hong kong so I will go to immigration tower to get an extension while I get the visa. The officer in Immigration Tower said that's okay.
Hopefully my consulate is very small and they could help me quickly, but the people in Immigration Tower were really unbelievable.
So, anyway, if something like this happened to you, don't give up, don't let them treat you like nothing. Fight for your rights.
Thanks again to all who replied.
That is all.