This is not possible if your lines will not change in position and length.
So, to make it possible: make your "size" in the URL of your URL, which is used to receive very large updates (think: 512 characters filled with zeros at the end). So you have a place to update the line.
Why is it impossible to use variable-sized strings? Well, I can explain this with a small snippet of x86 assembler:
PUSH OFFSET test.004024F0
Let's say; at offset test.004024F0 - your string is of variable size. Now consider the change:
I want to insert a line that is longer than the original line, which is stored before the line at 004024F0 : this makes 004024F0 for the new value, say: 004024F5 (the new line, before this record, is 5 characters longer than the original).
Do you find this simple: find all 004024F0 and replace it with 004024F5 ? Wrong . 004024F0 can also be a regular "instruction" (more precisely: ADD BYTE PTR DS:[EAX+24],AL; LOCK ... ). If this instruction is in your code, it will be replaced by something incorrect.
Well, you might think, but what about searching for this PUSH instruction? False : there are almost unlimited "PUSH" methods. For example, MOV EAX, 004024F0; MOV ESP, EAX; ADD ESP, 4 MOV EAX, 004024F0; MOV ESP, EAX; ADD ESP, 4 MOV EAX, 004024F0; MOV ESP, EAX; ADD ESP, 4 . There is also the possibility of calculating the field: MOV EAX, 00402000; ADD EAX, 4F0; ... MOV EAX, 00402000; ADD EAX, 4F0; ... MOV EAX, 00402000; ADD EAX, 4F0; ... Thus, this makes it "virtually unlimited."
However, if you use fields of static size; you do not need to change the code related to the strings. If you reserve enough space for a specific field, you can easily write a “longer” line than the original, because the line size is calculated by finding the first “zero byte”; enter the rest of the field with zeros.
If you use fields of static size, it is very difficult to find a "position in the file" at compile time. Considering a lot of time, spending hacking your own application; you can write code that modifies .exe and saves a new String value with a given offset. This file offset is not known at compile time, and you can fix this file offset later using a tool like OllyDbg . This allows the executable to fix itself :-)