Jump to content
Tuts 4 You

Is There A Way To Make Faster String Operation In Delphi?


ChupaChu

Recommended Posts

Posted (edited)

I had an idea to make a universal "ant-olly" routine for my delphi program.

Basicaly what id does is:

-get all processes runing

-get all modules of each and every process

-if module name gets recognized it trigers stuff in program.

I am using lists to store all the data, and Pos(ModuleName[j], Strings)

in a loop to check for known blacklisted modules.

Is there a way to make the code faster?

Execution on average system takes about 600ms

(and CPU usage gets to 100% for that time)

I want to reduce cpu consumption, and i know

asm code would most definetly do just that

but my asm skils are almost equal to none.

I'm gratefull for every help i get!

Regards, ChupaChu!

Edited by ChupaChu
Posted

When does your tool get stuck?

When loading processes running?

When loading modules of every process?

When searching known names in all modules?

Have you checked it is not entering in useless loops?

If you want you could share your loading & searching routine, maybe it would be easier to detect where it is slow...

Cheers

Nacho_dj

Posted (edited)

There are no endless loops here.

Its just that String operation take time.

Lets say you have 50 running processess

each of them has at least 10 modules

taht makes 500 text strings.

In basic there was MID and MID$, the second

was faster doing string operations than just MID

but i dont know if there is something like that in

Delphi.

I am mostly using Delphi POS command to find parts of string in another.

There was in basic a command that would alow

system events in order not to get temporeraly

system lockups (cpu=100%) every few miliseconds.

I dont know how to do that in Delphi, it might help a bit.

Edited by ChupaChu

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...