Solved

convert from C into Pascal ( Delphi )

Posted on 2009-04-03
20
1,011 Views
Last Modified: 2013-11-23
Hi , can someone convert this project from C to Pascal .

many thanks .
project.zip
0
Comment
Question by:frize
  • 7
  • 7
  • 3
  • +2
20 Comments
 
LVL 36

Expert Comment

by:Geert Gruwez
Comment Utility
why not explain what you want as project, maybe there is allready a delphi project ?
0
 
LVL 22

Expert Comment

by:8080_Diver
Comment Utility
frize,
THe basic answer is, "Yes, I can; however, no offense intended but this is the sort of thing that I and every Delphi developer that I know usually charge for."
What you are asking is not really a "question" per se but for someone to do work for you and that is what usually involves some sort of contractual relationship and remuneration for efforts expended (in other words, you pay some one for them doing the work ;-).
0
 
LVL 7

Author Comment

by:frize
Comment Utility
Thank you 8080_Diver , i will think about this ( i promise ) .


sir Geert_Gruwez    ( why not explain what you want as project .... ) no i don't think so .

take a look at the Project and you will see .


many thanks
0
 
LVL 14

Expert Comment

by:SteveBay
Comment Utility
frize,
All this appears to be is a Boyer-Moore search algorithm.  
http://en.wikipedia.org/wiki/Boyer-Moore_string_search_algorithm
This has been done and done again in many languages including Pascal.
It is far more likely that you will find what you need by searching for it rather than hoping someone here will take the time and effort to do what you ask.
I found a free delphi project that does this here:
http://www.programmersheaven.com/download/4292/download.aspx
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
I think the VCL string searching routines were optimized to use Boyer-Moore algorithm a while back.
0
 
LVL 36

Expert Comment

by:Geert Gruwez
Comment Utility
why do you want to delete this question ?
All experts's answer were making me think i will not have a Solution .
You did get a solution, but maybe not the one you liked.
It may require some more fine tuning on your part but that's programming ... and this site !

give a good reason for deletion, otherwise i object to deleting this question
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
I object to the delete request for the following reasons:
* not enough time has elapsed since the (Friday) posting of the question
* the discussion is active
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
I've looked at the C code.  

* I'm now sure how the GNU license of the C code might affect any language conversion.

* This C code does a memory scan for the Conflicker worm/virus.

====================
@frize

1. Have you looked at this C-to-Pascal project?
http://c2pas.sourceforge.net/

It should be a good first step.  Since it expects you to have 'good' Delphi knowledge, you should start with this translation result and ask our help to supplement your work.

2. You can use this JEDI project utility to convert the header file (.h)
ftp://ftp.delphi-jedi.org/darth/HeadConv.zip

Nice article:
http://www.drbob42.com/delphi/headconv.htm

3. How about this converter:
http://www.filedudes.com/C_2_Delphi_Converter-download-49816.html

4. How about the converters on this Torry page:
http://www.torry.net/pages.php?id=1518
0
 
LVL 22

Expert Comment

by:8080_Diver
Comment Utility
I believe that there have been sufficient suggestions for resolving this question so that the author should assign points, either individually or on a shared basis.  The discussion has provided answers to the direction to take and, to follow a strict interpretation of the terminology of "answering a question", the original question ("Hi , can someone convert this project from C to Pascal ."), has, indeed, been answered in that, yes, someone can tdo that.
I, too, object to the question being deleted (even though I rather expect that other will get the points ;-).
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@8080_Diver

I think it is too early to assign points and close this question.  

Note: frize has about 20% of his questions in deleted status.  I would like to keep this question out of that category.  I would also like to make the closing of this question a resource for future readers and, maybe, the rest of the IT world affected by Conflicker.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Author Comment

by:frize
Comment Utility
Ok , i'm really sorry , But sometimes One can think he will not get a Solution ( that's human he always wants to get what he 's planned to get ) .

Again sorry .

The problem now is : How could i splite all these points for all of you ( really you all worth them )

any suggestion for that ?.
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@frize

As I wrote to 8080, it is a bit early to close this question.  You should first attempt to use some of the conversion/translation utilities and then post comments (prefereably with converted code snippets) for any problems you might have with the Delphi code or some C++ code that did not convert.  

Please be patient and stick with this question.  We are here to help you, but you will need to do some of the leg work.
0
 
LVL 45

Accepted Solution

by:
aikimark earned 320 total points
Comment Utility
@frize

Although you might have a translation of the Conflicker signatures as a static byte array (see example in snippet), you should probably consider an external signature source.  That way, you would not need to recompile your application as new variations of the virus emerge.  

I read an article today that there is now an Conflicker-generation engine that has been produced to help malware authors create new versions (variants, mutations) of this bug.

This C-to-Delphi conversion should start with some goals and constraints on your part, since the original C might not be completely understood by us and an implementation of the C program's algorithm and data structures might be more efficiently implemented.

Note to other Delphi experts: please correct my code snippet if I got it wrong.

signature_conficker_A : Array[0..127] Of Byte = (#CF,#F0,#7B,#61,#89,#D7,#16,#E8,#1B,#09,#ED,#31,#45,#FE,#2E,#E7,#8A,#24,#B9,#56,#F6,#73,#41,#36,#78,#EF,#37,#50,#DF,#EC,#86,#CA,#4F,#E2,#96,#4B,#C3,#E6,#F4,#50,#BA,#16,#56,#E8,#4E,#76,#F2,#5B,#72,#45,#57,#98,#7A,#07,#0B,#97,#15,#17,#E9,#AB,#F6,#6D,#13,#56,#DE,#66,#1A,#55,#AE,#AE,#9E,#94,#53,#EE,#60,#25,#34,#FC,#01,#CB,#F7,#66,#1D,#F4,#B0,#E9,#1D,#6F,#E9,#A9,#1B,#82,#C1,#A3,#5C,#6E,#E3,#DA,#61,#65,#28,#AB,#36,#6A,#A5,#3E,#E9,#EE,#0A,#C1,#3A,#E2,#27,#43,#F6,#1E,#0B,#03,#2A,#3C,#9B,#91,#FE,#E9,#40,#76,#BF,#25);
 
 

signature_conficker_B: Array[0..511] Of Byte = (#E7,#A7,#2D,#F5,#45,#CA,#12,#49,#E6,#44,#1E,#D6,#72,#4C,#1B,#BA,#3C,#72,#F0,#8B,#4B,#EB,#75,#F3,#5E,#E8,#44,#CD,#87,#56,#E9,#21,#E6,#06,#34,#33,#76,#49,#93,#42,#EC,#E8,#03,#36,#19,#A6,#AD,#4D,#12,#59,#7F,#96,#01,#85,#41,#25,#CB,#E2,#83,#7E,#72,#DF,#85,#B3,#DD,#E1,#59,#FB,#97,#78,#9A,#2D,#B2,#B6,#3D,#E9,#58,#52,#45,#39,#1B,#90,#C8,#9F,#D7,#5C,#2B,#42,#DE,#A6,#6A,#D8,#03,#D0,#F2,#4C,#AF,#72,#24,#2E,#9D,#8C,#F3,#4D,#2F,#2F,#4D,#F2,#49,#D6,#89,#29,#A2,#C9,#C6,#FF,#F2,#5F,#98,#B6,#68,#09,#AD,#92,#10,#70,#D5,#10,#EA,#1C,#DA,#B6,#BC,#D4,#03,#CC,#8D,#9E,#8E,#57,#8C,#CF,#FC,#BC,#5B,#C3,#9E,#31,#5B,#DA,#08,#8A,#93,#26,#80,#BF,#D2,#DB,#45,#80,#83,#33,#87,#AF,#69,#C2,#F6,#5F,#15,#99,#34,#14,#CB,#0F,#88,#CC,#44,#29,#E9,#93,#45,#9E,#7E,#F9,#12,#87,#8A,#93,#8E,#33,#43,#BB,#0C,#40,#5B,#60,#4C,#86,#40,#31,#17,#99,#65,#13,#E4,#6C,#C2,#8A,#E5,#A4,#30,#D9,#F3,#D6,#6A,#BB,#EB,#DF,#DA,#02,#EC,#6D,#38,#7E,#23,#EE,#11,#68,#8A,#62,#7D,#A8,#93,#93,#9E,#C6,#DC,#7B,#F1,#23,#5D,#66,#72,#39,#C8,#3D,#E5,#56,#C3,#20,#D9,#A8,#9A,#25,#35,#E4,#3B,#99,#D4,#7E,#61,#D1,#D7,#74,#50,#E3,#6A,#EB,#49,#5A,#31,#3D,#21,#DE,#29,#4A,#CD,#30,#FC,#D1,#FD,#D7,#98,#73,#60,#4B,#A6,#53,#08,#5D,#F9,#EE,#05,#E6,#21,#97,#ED,#D9,#B7,#D6,#BC,#00,#34,#B1,#76,#6B,#BD,#26,#60,#8A,#2C,#1C,#B6,#E6,#58,#2D,#47,#4D,#40,#09,#5B,#83,#B1,#9D,#3C,#98,#8E,#A2,#2D,#9E,#5D,#7A,#07,#F1,#0D,#C8,#1B,#26,#47,#B0,#1A,#1C,#70,#08,#76,#4C,#C2,#9C,#CF,#3A,#F3,#0E,#1E,#C6,#00,#A8,#15,#CB,#47,#92,#7E,#1D,#F9,#07,#42,#AA,#92,#49,#DC,#04,#71,#ED,#D6,#E7,#DC,#E6,#AD,#3C,#BD,#25,#18,#32,#FA,#EC,#FA,#B7,#A5,#FB,#CC,#A1,#49,#52,#BA,#30,#60,#A7,#D3,#B0,#A3,#95,#E5,#F2,#DA,#61,#BD,#27,#D2,#97,#C0,#D8,#66,#33,#37,#04,#13,#D2,#36,#9D,#3F,#CB,#24,#79,#6B,#2E,#69,#22,#E1,#0B,#AD,#C1,#5B,#48,#8A,#E1,#D5,#00,#87,#37,#44,#06,#F5,#AE,#4C,#74,#4B,#20,#0F,#A3,#57,#63,#08,#D4,#57,#EB,#F0,#3A,#E3,#1A,#03,#C4,#DF,#9A,#17,#2D,#7F,#FD,#1F,#44,#71,#DA,#49,#B7,#BA,#3F,#26,#B5,#DD,#9C,#FE,#CA,#18,#70,#DB,#EC,#99,#63,#84,#96,#30,#10,#80,#4C,#33,#73,#4D,#BC,#B2,#C3,#79,#2C,#83,#68,#CD,#41,#5C,#45,#ED,#7D,#E7,#BE,#A8,#88);
 
 

signature_conficker_C: Array[0..511] Of Byte = (#13,#E5,#A4,#19,#AD,#58,#46,#33,#10,#1E,#FE,#C1,#A1,#96,#4F,#B1,#18,#FB,#E1,#49,#20,#32,#9C,#17,#E8,#1C,#7C,#BC,#6D,#81,#31,#C9,#DB,#8D,#7D,#BC,#A1,#BB,#94,#E4,#21,#04,#7D,#30,#AA,#F9,#67,#8C,#78,#A6,#41,#47,#CA,#08,#57,#B9,#52,#00,#A9,#2B,#E0,#78,#D7,#FC,#5A,#57,#FB,#7C,#D9,#D0,#16,#E2,#2E,#2C,#DE,#F6,#DB,#84,#94,#43,#E7,#EE,#72,#1C,#86,#7E,#81,#95,#59,#CE,#39,#BB,#A2,#20,#A0,#81,#63,#03,#09,#3D,#9C,#EF,#5F,#EE,#03,#8B,#D9,#56,#21,#A8,#C4,#FA,#B5,#B1,#69,#20,#74,#30,#B5,#1C,#EA,#83,#04,#78,#50,#78,#AC,#1C,#8C,#54,#5D,#2B,#E3,#92,#75,#BD,#D9,#78,#5E,#EB,#21,#43,#9B,#A6,#16,#89,#D4,#6B,#0B,#0F,#0D,#6A,#15,#47,#F8,#19,#50,#41,#62,#2C,#9E,#D8,#9A,#56,#3B,#41,#7A,#C4,#5A,#44,#AF,#FB,#D6,#7D,#F9,#1C,#C0,#46,#A3,#F5,#81,#49,#BA,#D6,#E1,#06,#A8,#93,#F6,#E7,#87,#83,#62,#E8,#C0,#BC,#2D,#18,#7A,#69,#1E,#1A,#F5,#19,#5A,#B9,#CE,#7A,#34,#DC,#A0,#3A,#2E,#EE,#6B,#12,#B2,#F0,#2D,#2E,#87,#6D,#5F,#2D,#F5,#97,#BC,#F0,#53,#1A,#30,#C5,#6D,#C5,#A4,#A2,#28,#BE,#88,#AD,#E1,#79,#06,#6E,#3C,#90,#F3,#36,#F9,#2F,#F8,#05,#3B,#5B,#EA,#C3,#D3,#01,#E5,#67,#6C,#4C,#28,#7E,#35,#B3,#CD,#6E,#33,#D3,#D3,#20,#2E,#09,#CF,#30,#79,#4A,#41,#03,#62,#76,#1D,#92,#B2,#A4,#34,#88,#09,#44,#14,#55,#14,#E8,#EF,#F0,#FC,#CB,#82,#E0,#04,#50,#42,#36,#DC,#3D,#B8,#92,#E9,#AB,#13,#5A,#7B,#0E,#07,#A4,#EB,#71,#69,#1C,#03,#A9,#0E,#5E,#29,#43,#57,#D4,#A8,#E0,#71,#BD,#47,#6E,#73,#CC,#82,#0B,#63,#81,#89,#6F,#AC,#5E,#59,#16,#3F,#E2,#D2,#DC,#A4,#BD,#F7,#77,#EA,#0A,#F3,#CC,#6F,#4D,#51,#DB,#7C,#94,#7D,#57,#5E,#1B,#A6,#A2,#18,#E1,#C5,#B6,#E2,#20,#8E,#6C,#11,#4F,#C9,#1E,#F6,#56,#93,#8F,#56,#62,#A0,#11,#86,#1F,#1D,#1D,#2D,#D7,#2A,#E1,#30,#31,#30,#1C,#A8,#BF,#28,#0D,#0E,#90,#DA,#2D,#54,#B7,#8C,#03,#44,#00,#7D,#5B,#AB,#C2,#5F,#51,#34,#E0,#A5,#BF,#2D,#ED,#C3,#28,#D4,#BB,#59,#B5,#F2,#5E,#FD,#5A,#5B,#9A,#E9,#39,#62,#B4,#99,#4E,#35,#09,#E2,#A2,#B1,#81,#2B,#2F,#4B,#DB,#3E,#76,#62,#22,#52,#FD,#79,#5B,#6E,#53,#70,#3C,#BE,#9E,#4D,#AB,#54,#D3,#9E,#62,#FF,#59,#7A,#60,#FC,#78,#48,#1E,#05,#2F,#CB,#1C,#F9,#5F,#23,#91,#FE,#7E,#42,#E2,#88,#B0,#D3,#33,#87,#41,#00,#72,#4F,#94,#63,#22,#67,#B9,#A2,#20);

Open in new window

0
 
LVL 7

Author Comment

by:frize
Comment Utility
Ok , aikimark ( many thanks for advice ) .

I will do some C-to-Delphi conversion  and put them here .

I think this Question will concern every one as we're leading With Conficker .

So we will help each other .

again many thankd for all of you  .

Yours frize .
0
 
LVL 7

Author Comment

by:frize
Comment Utility
I think i will increase Points not For the Sake of getting a Solution but because we are leading with Conficker , So help each other .

what do you think EXPERTS .
0
 
LVL 36

Expert Comment

by:Geert Gruwez
Comment Utility
leading with Conficker ...
you mean suffering from the Conficker virus ?
0
 
LVL 7

Author Comment

by:frize
Comment Utility
yes , i mean suffering from the Conficker virus
0
 
LVL 7

Author Comment

by:frize
Comment Utility
sorry i wrote leading ....  but i meant dealing ....
0
 
LVL 7

Author Closing Comment

by:frize
Comment Utility
many thanks
0
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
@frize

Thanks for the points.  Did your Delphi code catch some conficker-infected systems?
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now