How to Limit the Bandwidth with madCodeHook ??

c++ / delphi package - dll injection and api hooking
Post Reply
LeVuHoang
Posts: 131
Joined: Fri Oct 22, 2004 8:37 am

How to Limit the Bandwidth with madCodeHook ??

Post by LeVuHoang »

Hello, I've tried to hook all Send/Receive API as the firewall and calculate speed rate for it. But It's seem a wrong way because It run incorrectly.
Is there any idea about this ???
I'd uploaded my source code to Limit the connection bandwidth if you wish to see (copy/paste to your browser without download manager).

http://levuhoang.freeunixhost.com/BandWidthLimiter.zip

Thank you.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

No idea what to say here. Are you asking why your project isn't working as expected or are you asking for a way to achieve a specific task?
LeVuHoang
Posts: 131
Joined: Fri Oct 22, 2004 8:37 am

Post by LeVuHoang »

hi madshi,
I don't know that can I use API Hook to solve my problem is Limit bandwidth or not.
If yes, how to do it ? I tried, but not successful and my work posted above.
If no, how to solve this problem ???

Thank you all :)
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

That's a difficult thing to do. Probably you could hook the WinSock APIs and measure the bandwidth and if the bandwidth is too high, you could artificially delay the API calls. Not easy, though.
LeVuHoang
Posts: 131
Joined: Fri Oct 22, 2004 8:37 am

Post by LeVuHoang »

yes madshi,
If the bandwidth is too high, buffer will be sent is very large.
If the buffer is 16kb and We wish to limit the bandwidth to 2kb/s. We MUST delay 8s before the buffer can send out.
It's not a good idea. I tried NetLimit, It run very smoothly :crazy:
The buffer now is 1024bytes/s (1kb/s) not 16kb once.
So, I think that I must SPLIT the packet into smaller packet but I don't know how to do that. I tried to hook Winsock Send API and change the sending buffer size, resize the return sent variable but The Sending program is crashed.
I can not how to do next. That's interesting. Is there any one give me an idea or let's discuss about this function ???

Thank you all.
Masturbation Anime Big-Tits Asian BDSM Shy Squirt European Tanned Cartoons Tiny Face-Fucked Doggystyle Home Thai Party Beach Tall 18-year-olds Juicy Cum-Facial College-Girl Dorm Hairless Frog-Sex Vintage Beauty Mature Anal-Creampie Shemale Cum-Swapping Voyeur Spanish FFM Mistress Gloryhole Peeing Ebony Bathroom Nipples
Last edited by LeVuHoang on Tue Dec 16, 2008 8:05 am, edited 1 time in total.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

Yeah, splitting makes sense.
LeVuHoang
Posts: 131
Joined: Fri Oct 22, 2004 8:37 am

Post by LeVuHoang »

Is there anybody know how to SPLIT the sending packet ???
Post Reply