-2

I want decode a large base64 code on my delphi project When I paste it in my project I see the Long String error .. for solve it I use to it syntax:

'samecode'+
'samecode'+
'samecode';

But if I manually using this syntax it's too large time ...

Is there the quick way for solve it ?

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
Danial Hosseini
  • 33
  • 1
  • 2
  • 9
  • 1
    You mean [E2056 String literals may have at most 255 elements](http://docwiki.embarcadero.com/RADStudio/XE7/en/E2056_String_literals_may_have_at_most_255_elements_%28Delphi%29) compiler error and length of a constant in your source ? – TLama Mar 03 '15 at 14:32
  • When I copy the source I see this error : unterminated string at line x ; and before it I see this error: --------------------------- Error --------------------------- One or more lines were too long and have been truncated. --------------------------- OK --------------------------- ( this is show with message box ) – Danial Hosseini Mar 03 '15 at 14:33

1 Answers1

1

You have a few options:

  1. Compile the text to a string resource and link that to your executable. Load the resource at runtime.
  2. Place the text in a file that you deploy alongside your executable and load it at runtime.
  3. Write a script to read the text and format it to a manner suitable for inclusion in your source code.

Since your text is actually a base64 encoded file, I doubt that you want to do any of this. What you really ought to be doing is decoding the base64 text to a binary file and linking that as a resource.

Given that the base64 encoded file is in fact a virus (MSIL/Bladabindi.AJ), I cannot imagine anybody wanting to help you. I'm disappointed that I've done as much as I have. You should be ashamed of yourself.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • Can you give me a sample code for these options? :) Thanks – Danial Hosseini Mar 03 '15 at 14:38
  • 1
    I don't really want to code up all 3. Surely you're a programmer too? ;-) Which of these options suits your needs. I'd use all 3 faced with slightly different problems. Also, for option 3 I'd use python. I doubt you want to go that way. Knowing a good scripting language really pays off. – David Heffernan Mar 03 '15 at 14:41
  • ok thanks bro for answering :) Good luck and have a good time – Danial Hosseini Mar 03 '15 at 14:44
  • Do you want to consider a resource, or do you want it in the source code? – David Heffernan Mar 03 '15 at 14:45
  • 1
    I don't understand that. I can certainly help you flesh out your preferred option, but I won't prepare a tutorial on all the different ways of doing this. I've asked you questions in comments above that have not been answered. Please do contribute to this. – David Heffernan Mar 03 '15 at 14:51
  • my brother :) I want to use 1sth options :) so I search about it but not found any resource for it , if you can providing a good description it's very good otherwise please give me a resource for it , thanks – Danial Hosseini Mar 03 '15 at 14:54
  • This question covers that: http://stackoverflow.com/questions/24803059/text-resource-wont-compile-into-my-delphi-exe – David Heffernan Mar 03 '15 at 14:59