Article 4: Heavy encirclement (2000100005.29) Out of nothing As mentioned last time, for the "Settings" form, you can use the method of adding a font block to change the font. "Weiping" also asked: "Where is it added ?". I want to clarify first. The key is not to add the font block to where, but to delete bytes from other places. What are the string counters and control block counters that should be modified? Where are they? Okay. Take the "Settings" form as an example. This time, the last modified file is used, so the offset is also subject to this. Use uedit to open vopt99.exe. Jump to the offset "12480h" (for the sake of simplicity, the search process is omitted). We can see that this is the place where the "Settings" form name is located, but this form does not have an icon, there is no "caption" (in VB, there is no "caption" for a form without a title bar), so the next line is recognizable as "linktopic", that is, "form1 ". But let's put it down first, because we have no space to add the font block. For the next two rows, You can see "frame1", and then the next row is the "caption" of the frame. Here it is "display parameter settings", which contains 12 bytes in total, however, the two bytes before "display parameter settings" are "13 00", that is, 19 in decimal format. Therefore, we can provide 19-12 = 7 bytes. Select the "00" of the 7 bytes after "display parameter settings" and press "Ctrl + X" to cut the cut (uedit does not work in this case ), then, change "13 00" to "0C 00" and click the next line. You can see "01 3f 00" after "FF". Here, "FF" is the ending sign of the previous "Block". It is the control site starting from "01, "3f 00" is the size of the control starting from "3f", so reduce it by 7 and change it to "38 00 ". Now we get 7 bytes. Go down to "12589h" and you can see "displaycheck". Then, its title (Caption) "hides the large file list", which contains 14 bytes in total, the previous "string counter" is "14 00", that is, 20, so here we can get 20-14 = 6 bytes. Similar to the above example, cut the next six "00" and change "14 00" to "0e 00". Find the first "1257fh" of the "block, reduce the next two bytes "3f 00" by 6 and change them to "39 00 ". Now we have 6 more bytes and 13 in total. We can start to insert the font block. Now we need to consider where the font block is inserted. Let's try it before "46" as we did last time. At "12479h", the value here was the size of the form, and now it is "43 00 00 00", adding 13 bytes, it is "50 00 00". modify it. Now, find the end of the form, calculate 12479 H + 43 H = 124bch, and jump to "124bch". The first three bytes are "46 03 FF ", just insert it in front of "46. Copy 13 bytes at will, add "46" in "insert" mode, and change them to "40 01 86 00 00 90 01 90 5f 01 00 01 20" storage disk. Okay. Now, let's choose "about" from the menu. What does it show? Invalid file format error! It doesn't matter. We move the font block one byte, save the disk, and run it again. The "invalid file format" error occurs again. That's all right, again, move one byte forward, save the disk, and run again, how? -- Enjoy it! Increased cost Do you want to calculate the space required by the font block from the moment you steal it? Good. Let's get started. Or vopt99. After "display parameter settings", there are three buttons: "Help", "cancel", and ...... "OK" is "OK". Let's continue. The English format of "cancel" is "cancel", which consists of 6 bytes, while "cancel" only needs 4 bytes, which can save 2 bytes and can be sent to "OK ". Jump to "12547h". Here is the "cancel" string counter, change it from "06 00" to "04 00", and cut the space added during the original translation to both sides, then, subtract 2 from the block counter at "12531h" and change it to "2D 00 ". Jump to "12577h", insert two bytes before "OK", change these four bytes to "OK", and change the counter in front of it to "04 00 ", change "Block counter" at "1255fh" to "2D 00" to save the disk. OK. Run the command and go to the "display parameter settings" mode. Have you seen it? The original "OK" has been changed to "OK ". (Sometimes, some counters can run without modification, but you must keep the habit of modifying the counter. This is the first condition to ensure the normal operation of the program, this cumulative error may cause irreparable consequences. Be sure to pay attention to it !) Growing troubles Just now, when I entered the "display parameter settings" mode, I saw that "OK" has been changed to "OK". What else did I see? By the way, the "checkbox" title "hidden file distribution chart" is changed from one row to two because of the increase of the font, and none of the two lines are completely displayed, this is not a good result, but it cannot be said. What should we do? Of course, it is to modify the width of the control. Jump to "125c7h". Here is the position of the "Block counter" of the control where the "hidden file distribution chart" is located. Its value is "3f 00 ", so 125c7h + 3fh = 12606 h, and then jump to "12606h", "FF" is its end mark, and then 12 bytes forward, from then on, the 8 bytes are the position information of this "checkbox". Currently, it is "F0 00 D0 02 08 07 C3 00 ", the number of each two bytes is "Left", "TOP", "width", and "height". What we need to modify is "width ", it is "08 07", the decimal value is "1800", and it is changed to "2000", that is, "D0 07". Now, modify and save the disk. Now, run it again and go to the "display parameter settings" mode. Is that good? You can continue to modify other items. (Note: I have not listed the locations of all controls here, because it is difficult to find them, but if winhex is used, it is helpful because it shows the size of the 1-byte, 2-byte, and 4-byte decimal integer of the current cursor .) Exotic collection Yesterday, I saw a so-called vb5 online decompilation site. What is the URL ?! This site can provide decompilation of less than 1 MB during the whole day from GMT to AM or Sunday, and only 50 kb for other times, so let's go between PM and PM Beijing time. (You can first package it in ZIP format) It seems that someone has been studying this problem before, but he has positioned this kind of work on "decompilation", but eventually he can only "decompile" some forms, it may be disappointing, so it has not been updated since 98 years. (Chinese characters are not supported, but the English software is needed for decompilation) Although it is impossible to compile a program decompiled into a normal executable file, it provides a lot of information, such as which strings need to be translated and which cannot be translated, the location information of a widget, and so on. (I really want to get its source code, so I don't need to study the structure of the form block any more. :) (Today [5.29] I learned that vb5's decompilation program vb4tools can indeed decompile form information and functions in assembly language, but it is only effective for extremely simple programs and slightly complex programs, in The Decompilation process, errors may occur and exit, so that the problem can be avoided) Final Fantasy I just mentioned that recompilation is not allowed. In fact, it is not completely impossible to re-compile. Although there is no code, we can use the visual environment of VB to edit these forms (really great !), Modify the font, modify the title, modify the location, and re-compile the program. Although this program is not what we want, we can copy the form block, replace the form block of the original program. Note that the resulting form block is always different from the original form block. If it is larger than the original one, you need to modify the source code to reduce it and re-compile it. If it is smaller than the original one, you need to add some bytes in some parts of the form block to make the sum of the original form blocks as big, and then replace it. Fortunately, it is easy to add bytes. :) Since the form can be decompiled, it is not very difficult to create the "ultimate Chinese tool" of VB. All the problems are just the workload. Okay. Let me summarize it. There are two resource formats in VB. One is what we call "form block" here, because all ASCII strings exist in the "form block", so there is no "ASCII string" resource; the other one is the Unicode string. You can use the "string replacement" compiled by me to find all such Unicode strings (which refer to Unicode strings in VB format, some Unicode strings in VB executable files are not in the VB format, but these strings are not displayed and do not need to be translated. Therefore, my "string replacement" does not extract these Unicode strings, it is not extracted even when "Unlimited search" is used .). Can be translated, the string in the form block can change the length, but the Unicode string cannot be modified longer than the original string. (VB Programs can also use resources in the standard Windows format, that is, resources in the VC format. However, even if you use resources such as dialog, there will not be resources such as dialog, menu, accelerator, but only resources such as string or bitmap. You can use the standard resource editor for localization, however, because VB itself cannot edit such resources, it generally uses VC to edit, compile, and then link to the VB program. I don't think such resources belong to VB resources) At this point, I think the problem of font blocks has completely ended. In addition, I can also say that I have solved all the basics of VB in Chinese (using these skills can already be used to develop more than 95% of VB Programs in Chinese, if you want to perfect the other 5%, you may need some programming experience, this article is not only the end of my font research, but also the final article about VB Chinese. (In addition, today [5.29] I learned that a Tao from the Chinese studio at the new starting point has also studied the modification of the VB font, and there is a method I have not found to modify the font, it is recommended that you take a look at it as well as those who are working on VB .) |