﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">
  <channel>
    <title>WΛЯИING's blog</title>
    <description>The deepest secrets of Visual Basic ...</description>
    <link>http://www.decompiler-vb.net/blog/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 2.0.0.36</generator>
    <language>en-GB</language>
    <blogChannel:blogRoll>http://www.decompiler-vb.net/blog/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>Warning's blog</dc:creator>
    <dc:title>WΛЯИING's blog</dc:title>
    <geo:lat>0.000000</geo:lat>
    <geo:long>0.000000</geo:long>
    <item>
      <title>The truth about P-Code</title>
      <description>&lt;h2&gt;Introduction&lt;/h2&gt; &lt;p&gt;This article has been written to provide a better and essential information to users of decompilers since I got many complaints from customers of others Visual Basic decompilers because their application weren’t recovered by these decompilers. &lt;p&gt;The reason is, when you write a Visual Basic 6.0 application you may choose a P-Code or Native code compilation, then your application will be compiled to P-Code or Native code which are very different approaches of compilation, so the decompilation will be different too. &lt;p&gt;&lt;b&gt;There is a question you may absolutely ask yourself when you need a decompiler for a specific application:&lt;/b&gt; &lt;i&gt;Is my application compiled into native or P-Code mode ?&lt;/i&gt; &lt;p&gt;The main problem is that a lot of users got a P-Code decompiler in order to decompile their application, but released with Native Code…  &lt;p&gt;In fact, P-Code decompiler are today almost useless because 90% of Visual Basic 6 application are released with Native Code mode. This article will explain first the difference between P-Code and Native code, and then explain why the rate of Native code application is so important compared to P-Code applications. &lt;h2&gt;I. P-Code Versus Native Code&lt;/h2&gt; &lt;p&gt;When you write a line of code in the IDE, Visual Basic breaks it down into expressions and encodes the expressions into a preliminary format called op-codes. In other words, each line is partially precompiled as it is written. Some lines contain shared information that cannot be precompiled independently (mainly Dim statements and procedure definitions). This is why you have to restart if you change certain lines in break mode. The opcodes are compiled into p-code instructions when you compile (in the background if you have the Compile On Demand and Background Compile options set). &lt;p&gt;At run time, the p-code interpreter works through the program, decoding and executing p-code instructions. These p-code instructions are smaller than equivalent native code instructions, thus dramatically reducing the size of the executable program. But the system must load the p-code interpreter into memory in addition to the code, and it must decode each instruction. &lt;p&gt;It’s a different story with native code. You start with the same opcodes, but instead of translating to p-code instructions, the compiler translates to native instructions. Because you’re not going to be expecting an instant response while stepping through native code instructions in the IDE, the compiler can look at code from a greater distance; it can analyze blocks of code and find ways to eliminate inefficiency and duplication. The compiler philosophy is that, since you compile only once, you can take as long as you want to analyze as much code as necessary to generate the best results possible. &lt;p&gt;These two approaches create a disjunction. How can you guarantee that such different ways of analyzing code will generate the same results? Well, you can’t. In fact, if you look at the Advanced Optimizations dialog box (available from the Compile tab of the Project Properties dialog box) you’ll see a warning: "Enabling the following optimizations might prevent correct execution of your program." This might sound like an admission of failure, but welcome to the real world of compilers. Users of other compiled languages understand that optimization is a bonus. If it works, great. If not, turn it off. &lt;p&gt;On the other hand, very few developers are going to be used to the idea of working in an interpreter during development but releasing compiled code. Most compilers have a debug mode for fast compiles and a release mode for fast code. Visual Basic doesn’t worry about fast compiles because it has a no-compile mode that is faster than the fastest compiler. You get the best of both worlds, but it’s going to take a little while for people to really trust the compiler to generate code that they can’t easily see and debug. &lt;p&gt;Source : &lt;a href="http://vb.mvps.org/hardcore/html/p-codeversusnativecode.htm"&gt;http://vb.mvps.org/hardcore/html/p-codeversusnativecode.htm&lt;/a&gt; &lt;h2&gt;II. Proportion of P-Code application in the world&lt;/h2&gt; &lt;p&gt;&lt;b&gt;The amount of P-Code developed application is very small compared to Native Code developed application&lt;/b&gt; (90% of Visual Basic 6 applications are compiled with Native Code setting -default setting in VB6-), that is one of the reason why I decided to develop VBReFormer more for Native Code than for P-Code. &lt;p&gt;The massive number of Visual Basic Native application compared to P-Code applications is probably more important due to the fact the default value in the compiler is set up to « Native Code », and of course because native application are almost fast than C++ applications contrary to P-Code applications. &lt;p&gt;Before choosing a decompiler you must know if it was released for Native application, or for P-Code applications, and if your application was released in P-Code or Native mode. &lt;p&gt;Note that P-Code is more easy to decompile than Native Code because of it’s high level property.  </description>
      <link>http://www.decompiler-vb.net/blog/post/The-truth-about-P-Code.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/The-truth-about-P-Code.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=fc51a398-741e-41c6-8a0d-ca3d19ce446a</guid>
      <pubDate>Wed, 25 May 2011 16:59:58 -0400</pubDate>
      <category>Decompilers</category>
      <category>VBReFormer</category>
      <category>Visual Basic</category>
      <dc:publisher>WΛЯИING</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=fc51a398-741e-41c6-8a0d-ca3d19ce446a</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=fc51a398-741e-41c6-8a0d-ca3d19ce446a</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/The-truth-about-P-Code.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=fc51a398-741e-41c6-8a0d-ca3d19ce446a</wfw:commentRss>
    </item>
    <item>
      <title>C#: Adding many SortField to a CrystalReportViewer using reflection</title>
      <description>&lt;p&gt;I'm currently working on a project for a client which consists in translating an important management application initially developed in VB6, into C# 3.5, by using decompilation since the client lost his source code. This is my first .Net related post.&lt;/p&gt;
&lt;p&gt;The application uses many external components, including the powerful Crystal Report component.&lt;/p&gt;
&lt;p&gt;During the development of that new version I faced a problem with the .Net implementation of Crystal Report.&lt;/p&gt;
&lt;p&gt;Actually, with Visual Basic 6.0 it was an easy task to add one or many sort fields to the report document in order to sort the result by field (for example by "Lastname", "Firstname", and "ID").&lt;/p&gt;
&lt;p&gt;It's not the case with .Net implementation of Crystal Report Document, on which you cannot dynamically add sort field to document. You must add the sort field when you're editing the document. It's not really convenient when you don't know how many fields must be sorted when creating the document.&lt;/p&gt;
&lt;p&gt;The reason of this missing is not really clear since it's an existing feature on Visual Basic 6.0. We will learn here how to add many SortField to the ReportDocument of a CrystalReportViewer, using reflection.&lt;/p&gt;
&lt;p&gt;Imagine you have to sort the request's result by "Firstname", "Lastname", and "ID" fields, using the Crystal report document with the variable "Filename" as the report document path, and the variable "srcDataSet" dataset as the data source:&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt;[] sortFieldNames = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;string&lt;/span&gt;[] { &lt;span style="color: #a31515"&gt;"Firstname"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"Lastname"&lt;/span&gt;, &lt;span style="color: #a31515"&gt;"ID"&lt;/span&gt; }; &lt;br /&gt;&lt;span style="color: #2b91af"&gt;&lt;br /&gt;ReportDocument&lt;/span&gt; reportDocument = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;ReportDocument&lt;/span&gt;(); &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;reportDocument.FileName = &lt;span style="color: #2b91af"&gt;String&lt;/span&gt;.Format(&lt;span style="color: #a31515"&gt;"rassdk://{0}"&lt;/span&gt;, Filename); &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;reportDocument.SetDataSource(srcDataSet.Tables[&lt;span style="color: fuchsia"&gt;0&lt;/span&gt;]); &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;SortFields&lt;/span&gt; targetSortField = reportDocument.DataDefinition.SortFields; &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Here we can modify the sort field (only if existing in the document):&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;DatabaseFieldDefinition&lt;/span&gt; fieldDef = reportDocument.Database.Tables[&lt;span style="color: #a31515"&gt;"REPORTS"&lt;/span&gt;].Fields[&lt;span style="color: #a31515"&gt;"FIRSTNAME"&lt;/span&gt;]; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;targetSortField[&lt;span style="color: fuchsia"&gt;0&lt;/span&gt;].Field = fieldDef; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;targetSortField[&lt;span style="color: fuchsia"&gt;0&lt;/span&gt;].SortDirection = CrystalDecisions.Shared.&lt;span style="color: #2b91af"&gt;SortDirection&lt;/span&gt;.AscendingOrder;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;But impossible to add directly a new field to that SortFields collection because no method allows performing action:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CHowtoaddmanySortFieldtoaCrystalReportVi_3DCA/pic1.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pic1" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CHowtoaddmanySortFieldtoaCrystalReportVi_3DCA/pic1_thumb.png" border="0" alt="pic1" width="499" height="415" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Actually, it's possible to add a new sort field using the mother inherited class of each used component.&lt;/p&gt;
&lt;p&gt;First we get the "SortFields" mother's class of type (CrystalDecisions.ReportAppServer.DataDefModel.SortsClass ) by using the RasSorts private accessor of the SortFields object:&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;MethodInfo&lt;/span&gt; getRasSorts = targetSortField.GetType().GetMethod(&lt;span style="color: #a31515"&gt;"get_RasSorts"&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.NonPublic | &lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.Instance); &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: blue"&gt;object&lt;/span&gt; rasSorts = getRasSorts.Invoke(targetSortField, System.&lt;span style="color: #2b91af"&gt;Type&lt;/span&gt;.EmptyTypes); &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;It return an object of type CrystalDecisions.ReportAppServer.DataDefModel.SortsClass.&lt;/p&gt;
&lt;p&gt;Now we can access to the private "Add" method of the mother's class:&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;MethodInfo&lt;/span&gt; addSort = rasSorts.GetType().GetMethod(&lt;span style="color: #a31515"&gt;"Add"&lt;/span&gt;); &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The description of that method show that it accept one parameter of type CrystalDecisions.ReportAppServer.DataDefModel.ISCRSort.&lt;/p&gt;
&lt;p&gt;&lt;a rel="lightbox" href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CHowtoaddmanySortFieldtoaCrystalReportVi_3DCA/pic2.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="pic2" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CHowtoaddmanySortFieldtoaCrystalReportVi_3DCA/pic2_thumb.png" border="0" alt="pic2" width="489" height="103" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ISCRSort is an interface, so we have to create a new instance of a class that implement the ISCRSort interface. That class is called "SortClass" and come from the "CrystalDecisions.ReportAppServer.DataDefModel" assembly.&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;Assembly&lt;/span&gt; rasAssembly = getRasSorts.ReturnType.Assembly; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;ConstructorInfo&lt;/span&gt; ciRasSort = rasAssembly.GetType(&lt;span style="color: #a31515"&gt;"CrystalDecisions.ReportAppServer.DataDefModel.SortClass"&lt;/span&gt;).GetConstructor(&lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.Public | &lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.Instance, &lt;span style="color: blue"&gt;null&lt;/span&gt;, System.&lt;span style="color: #2b91af"&gt;Type&lt;/span&gt;.EmptyTypes, &lt;span style="color: blue"&gt;null&lt;/span&gt;); &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: blue"&gt;object&lt;/span&gt; rasSort = ciRasSort.Invoke(System.&lt;span style="color: #2b91af"&gt;Type&lt;/span&gt;.EmptyTypes);&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Our "rasSort" object now instantiate the SortClass class, implementing ISCRSort. &lt;br /&gt;Once the SortClass object is created, we must complete it with valid field, else it will return an error on execution.&lt;/p&gt;
&lt;p&gt;The SortClass class uses the "RasField" accessor to define the field which will be sorted.&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;MethodInfo&lt;/span&gt; setSortField = rasSort.GetType().GetMethod(&lt;span style="color: #a31515"&gt;"set_SortField"&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.Public | &lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.Instance); &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;But this method only accepts an object implementing the ISCRField interface: &lt;br /&gt;Void set_SortField(CrystalDecisions.ReportAppServer.DataDefModel.ISCRField);&lt;/p&gt;
&lt;p&gt;So we have to extract the object of our field object (called fieldDef) that implement the ISCRField interface, it can be done with the "RasField" accessor of our DatabaseFieldDefinition object called "fieldDef":&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: #2b91af"&gt;MethodInfo&lt;/span&gt; getRasField = fieldDef.GetType().GetMethod(&lt;span style="color: #a31515"&gt;"get_RasField"&lt;/span&gt;, &lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.NonPublic | &lt;span style="color: #2b91af"&gt;BindingFlags&lt;/span&gt;.Instance); &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: blue"&gt;object&lt;/span&gt; rasField = getRasField.Invoke(fieldDef, System.&lt;span style="color: #2b91af"&gt;Type&lt;/span&gt;.EmptyTypes); &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;And now, the final touch, we add it to the collection:&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;addSort.Invoke(rasSorts, &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: blue"&gt;object&lt;/span&gt;[] { rasSort }); &lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Your new sort field has been adding to the SortFields collection, and you can now modify it:&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;&lt;span style="color: blue"&gt;int&lt;/span&gt; n = reportDocument.DataDefinition.SortFields.Count - &lt;span style="color: fuchsia"&gt;1&lt;/span&gt;; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: courier new; font-size: 10pt"&gt;reportDocument.DataDefinition.SortFields[n].SortDirection = CrystalDecisions.Shared.&lt;span style="color: #2b91af"&gt;SortDirection&lt;/span&gt;.AscendingOrder; &lt;br /&gt;reportDocument.DataDefinition.SortFields[n].Field = fieldDef;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;That's all.&lt;/p&gt;</description>
      <link>http://www.decompiler-vb.net/blog/post/C-How-to-add-many-SortField-to-a-CrystalReportViewer-using-reflection.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/C-How-to-add-many-SortField-to-a-CrystalReportViewer-using-reflection.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=afa6442a-ced9-47df-b8be-1291c698818c</guid>
      <pubDate>Sat, 09 Apr 2011 22:16:00 -0400</pubDate>
      <category>.Net</category>
      <category>Reflection</category>
      <category>Reverve engineering</category>
      <category>Crystal Reports</category>
      <dc:publisher>WΛЯИІNG</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=afa6442a-ced9-47df-b8be-1291c698818c</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=afa6442a-ced9-47df-b8be-1291c698818c</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/C-How-to-add-many-SortField-to-a-CrystalReportViewer-using-reflection.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=afa6442a-ced9-47df-b8be-1291c698818c</wfw:commentRss>
    </item>
    <item>
      <title>VBReFormer: CrackMe Sample #1</title>
      <description>&lt;p&gt;
Now that VBReFormer is a well advanced decompiler for Visual Basic application, I was searching for some unsolved crackmes in order to made sample of decompiling for learning purpose. 
&lt;/p&gt;
&lt;p&gt;
The website Crackmes.de contains an impressive number of crackmes applications, a perfect source of samples. 
&lt;/p&gt;
&lt;p&gt;
For the first sample of CrackMe solving with VBReFormer Professional I decided to take &amp;ldquo;Step 2&amp;rdquo; from yudi (&lt;a href="http://crackmes.de/users/yudi/step_2/"&gt;more informations&lt;/a&gt;). 
&lt;/p&gt;
&lt;p&gt;
I will show you, step by step, how it&amp;rsquo;s simple to solve the yudi&amp;rsquo;s Step 2 using VBReFormer Professional. 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Running the application:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/screen1_4.png"&gt;&lt;img src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/screen1_thumb_1.png" border="0" alt="yudi's Step 2 (CrackMe) / Screenshot 1" width="420" height="335" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
We can see that a serial is generated using the name of the user. 
&lt;/p&gt;
&lt;p&gt;
How the serial is generated? See the following step. 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Now we just open the &amp;ldquo;Step 2.exe&amp;rdquo; file with VBReFormer Professional and getting the following result:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s2.png"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s2_thumb.png" border="0" alt="VBReFormer VB decompiler screenshot 1" width="463" height="390" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;We will now take a look to the first method loaded on Visual Basic application.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image005_2.gif"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image005_thumb.gif" border="0" alt="VBReFormer VB decompiler screenshot 2" width="296" height="130" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
We can see on this capture that the &amp;ldquo;Label4&amp;rdquo; visibility is set to False (not visible) at the beginning of the application. 
&lt;/p&gt;
&lt;p&gt;
Take a look to that control in the resource editor of VBReFormer and you will agree that it&amp;rsquo;s the control that show the message &amp;ldquo;Registered user!&amp;rdquo; 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image007_2.gif"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image007_thumb.gif" border="0" alt="VBReFormer VB decompiler screenshot 3" width="481" height="163" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
We now need to know where the &amp;ldquo;Label4&amp;rdquo; control visibility is set to true, and what does the &amp;ldquo;Timer1&amp;rdquo; control. 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The analysis of the Timer1 control is interesting but not very useful for the following of this tutorial.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image009_2.gif"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image009_thumb.gif" border="0" alt="VBReFormer VB decompiler screenshot 4" width="448" height="448" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
We can see here that the &amp;ldquo;Timer1_Timer&amp;rdquo; function is called every second by &amp;ldquo;Timer1&amp;rdquo; control in order to check that no debuggers, and if one is running, to close it. 
&lt;/p&gt;
&lt;p&gt;
We can note that it also close any MessageBox windows. 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;Now we are looking for the code under the &amp;ldquo;Try&amp;rdquo; button which check if the key match with the name.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
That &amp;ldquo;Try&amp;rdquo; button is the &amp;ldquo;Command1&amp;rdquo; button in VBReFormer: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image011_2.gif"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image011_thumb.gif" border="0" alt="VBReFormer VB decompiler screenshot 5" width="409" height="92" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Then just look to the Command1_Click() function in order to see the algorithm of key checking: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image013_2.gif"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image013_thumb.gif" border="0" alt="clip_image013" width="511" height="626" /&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s8.png"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s8_thumb.png" border="0" alt="VBReFormer VB decompiler screenshot 6" width="637" height="801" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
The algorithm seems a little complicated for newbie, but complete and without any syntax and source code error from VBReFormer. 
&lt;/p&gt;
&lt;p&gt;
That&amp;rsquo;s a great thing for us; we will be able to test the application into the Visual Basic IDE later (to make a key generator for example). 
&lt;/p&gt;
&lt;p&gt;
By analyzing the code we can see the following: 
&lt;/p&gt;

&lt;div class="customCode"&gt;
&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;Set&lt;/font&gt; var_pv2 = Me.Text1()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv3 = var_pv2.Text()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv10 = (var_pv3)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv11 = (&lt;font color="#ff0000"&gt;Date&lt;/font&gt;$) &amp;amp; (&amp;quot; &amp;quot;)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv12 = (var_pv11) &amp;amp; (&lt;font color="#ff0000"&gt;Time&lt;/font&gt;$)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv13 = (var_pv12)&lt;/font&gt; 
&lt;/div&gt;

&lt;p&gt;
This part of code is showing us that the key is generated from the Name, but also with the Date and the Time ! 
&lt;/p&gt;
&lt;p&gt;
That&amp;rsquo;s meaning it&amp;rsquo;s almost impossible to generate a key that does not expire the following second. 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;In order to made the Key Generator, save the project with VBReFormer, and open it with Visual Basic 6.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
When it&amp;rsquo;s opened into the Visual Basic IDE, remove the debugger watching functions and just keep the following: 
&lt;/p&gt;
&lt;p&gt;
o Command1_Click 
&lt;/p&gt;
&lt;p&gt;
o Command2_Click 
&lt;/p&gt;
&lt;p&gt;
Now remove the following conditions block from Command1_Click function: 
&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt; (var_num8) &lt;font color="#0000ff"&gt;Then&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv6 = (&lt;font color="#910000"&gt;&amp;quot;Hey&amp;quot;&lt;/font&gt;)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv7 = (&lt;font color="#800000"&gt;&amp;quot;need something&amp;quot;&lt;/font&gt;)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv9 = MsgBox(var_pv7, 4160, var_pv6)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New" color="#0000ff"&gt;End If&lt;/font&gt; 
&lt;/div&gt;
&lt;p&gt;
These block are showing an alert when the &amp;ldquo;Name&amp;rdquo; field and when the &amp;ldquo;Key&amp;rdquo; field are empty, but it&amp;rsquo;s not usefull for a keygen. 
&lt;/p&gt;
&lt;p&gt;
At the end of the Command1_Click function we can see the serial check condition: 
&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;Set&lt;/font&gt; var_pv2 = Me.Text2()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv3 = var_pv2.Text()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv21 = (var_pv3)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv22 = ((var_pv19 &lt;font color="#0000ff"&gt;Like&lt;/font&gt; var_pv21))&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;If&lt;/font&gt; (((var_pv22) = (&lt;font color="#0000ff"&gt;True&lt;/font&gt;))) &lt;font color="#0000ff"&gt;Then&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set&lt;/font&gt; var_pv2 = Me.Label4()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv2.Visible() = &lt;font color="#0000ff"&gt;True&lt;br /&gt;
&lt;/font&gt;&lt;/font&gt;&lt;font face="Courier New" color="#0000ff"&gt;End If&lt;/font&gt; 
&lt;/div&gt;
&lt;p&gt;
That code is checking that the serial (stored in var_pv19 variable) generated from the name with the algorithm is the same than the one entered in the &amp;ldquo;Serial&amp;rdquo; field (Text2.Text). 
&lt;/p&gt;
&lt;p&gt;
To show the generated serial, we just need to replace that condition block by the following line of code: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image017_2.gif"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/clip_image017_thumb.gif" border="0" alt="VBReFormer VB decompiler screenshot 7" width="328" height="130" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
You must also remove the following line of code which remove the content of the both fields: 
&lt;/p&gt;
&lt;div class="customCode"&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;Set&lt;/font&gt; var_pv2 = Me.Text1()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv2.Text() = &lt;font color="#800000"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;Set&lt;/font&gt; var_pv2 = Me.Text2()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;var_pv2.Text() = &lt;font color="#800000"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;Set&lt;/font&gt; var_pv2 = Me.Text1()&lt;/font&gt; 
&lt;/div&gt;
&lt;p&gt;
After all change and simplifications, we have the following keygen code: 
&lt;/p&gt;
&lt;p&gt;
&lt;div class="customCode"&gt;
&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;Private Sub&lt;/font&gt; Command1_Click()&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv10 = Text1.Text&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv13 = Date$ &amp;amp; &lt;font color="#800000"&gt;&amp;quot; &amp;quot;&lt;/font&gt; &amp;amp; Time$&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For&lt;/font&gt; var_pv14 = 1 &lt;font color="#0000ff"&gt;To&lt;/font&gt; Len(var_pv13) &lt;font color="#0000ff"&gt;Step&lt;/font&gt; 1&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If&lt;/font&gt; IsNumeric(Mid$(var_pv13, &lt;font color="#0000ff"&gt;CLng&lt;/font&gt;(var_pv14), 1)) &lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv15 = Asc(Mid$(var_pv13, &lt;font color="#0000ff"&gt;CLng&lt;/font&gt;(var_pv14), 1))&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If&lt;/font&gt; var_pv14 &amp;lt;= Len(var_pv10) &lt;font color="#0000ff"&gt;Then&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv16 = Str(Asc(Mid$(var_pv10, &lt;font color="#0000ff"&gt;CLng&lt;/font&gt;(var_pv14), 1)))&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv16 = Right$(var_pv16, 1)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv16 = Val(var_pv16)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New" color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv18 = var_pv18 &amp;amp; Chr$(&lt;font color="#0000ff"&gt;CLng&lt;/font&gt;(var_pv15 + 17 + var_pv16))&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv18 = var_pv18 &amp;amp; Chr$(&lt;font color="#0000ff"&gt;CLng&lt;/font&gt;(var_pv15 + 17 + var_pv16 * 2))&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New" color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/font&gt; var_pv14&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; For&lt;/font&gt; var_pv14 = 1 &lt;font color="#0000ff"&gt;To&lt;/font&gt; 24 &lt;font color="#0000ff"&gt;Step&lt;/font&gt; 4&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv19 = var_pv19 &amp;amp; Mid$(var_pv18, &lt;font color="#0000ff"&gt;CLng&lt;/font&gt;(var_pv14), 4) &amp;amp; &lt;font color="#800000"&gt;&amp;quot;-&amp;quot;&lt;/font&gt;&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&lt;font color="#0000ff"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;/font&gt; var_pv14&lt;/font&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv20 = Len(var_pv19) - 1&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var_pv19 = Mid$(var_pv19, 1, var_pv20)&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Text2.Text = var_pv19&lt;br /&gt;
&lt;/font&gt;&lt;font face="Courier New" color="#0000ff"&gt;End Sub&lt;/font&gt; 
&lt;/p&gt;
&lt;/div&gt;
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;We now have to test our keygen:&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s10.png"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s10_thumb.png" border="0" alt="yudi's Step 2 (CrackMe) / Screenshot 2" width="429" height="689" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;The first window is the windows of our KeyGen created from the original crackme, and the second window is the one of the original Crackme, with the key from the KeyGen. &lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The result is that our keygen work perfectly! 
&lt;/p&gt;
&lt;p&gt;
Just note that the use of date and time make your key valid for only 1 minute after having generated it. 
&lt;/p&gt;
&lt;p&gt;
Is it possible to bypass that limitation? 
&lt;/p&gt;
&lt;p&gt;
Yes it is ! In fact, to get the &amp;ldquo;Registered user!&amp;rdquo; message you even don&amp;rsquo;t need a key generator. By reading the code you can see that the operator used to perform a comparison between the both string key is the &amp;ldquo;Like&amp;rdquo; operator. 
&lt;/p&gt;
&lt;p&gt;
The &amp;ldquo;like&amp;rdquo; operator allows to comparate a string and a pattern&amp;hellip; 
&lt;/p&gt;
&lt;p&gt;
Then you just can set &amp;ldquo;*&amp;rdquo; into the serial field and you will have a key which will be valid at anytime, with any name: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s11_1.png"&gt;&lt;img style="border-width: 0px" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/CrackmeyudisStep2_4233/s11_thumb_1.png" border="0" alt="yudi's Step 2 (CrackMe) / Screenshot 3" width="420" height="335" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
Source code of the key generator can be downloaded here: 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.decompiler-vb.net/documentation/crackmes/step_2.zip"&gt;http://www.decompiler-vb.net/documentation/crackmes/step_2.zip&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
Enjoy it !
&lt;/p&gt;
</description>
      <link>http://www.decompiler-vb.net/blog/post/VBReFormer-vb-decompiler-crackme-sample1.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/VBReFormer-vb-decompiler-crackme-sample1.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=d0ec5a9f-027b-4d0e-b673-5b9efd0643e7</guid>
      <pubDate>Wed, 05 Jan 2011 22:42:00 -0400</pubDate>
      <category>Decompilers</category>
      <category>Reverve engineering</category>
      <category>Security</category>
      <category>VBReFormer</category>
      <category>Visual Basic</category>
      <dc:publisher>WΛЯИІNG</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=d0ec5a9f-027b-4d0e-b673-5b9efd0643e7</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=d0ec5a9f-027b-4d0e-b673-5b9efd0643e7</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/VBReFormer-vb-decompiler-crackme-sample1.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=d0ec5a9f-027b-4d0e-b673-5b9efd0643e7</wfw:commentRss>
    </item>
    <item>
      <title>Crystal Reports : Point sur le déploiement</title>
      <description>&lt;h2&gt;Avant Visual Studio 2008 :
&lt;/h2&gt;&lt;p&gt;J'écris cet article car les solutions de déploiement d'une application .Net employant Crystal Reports ont quelques peux évoluées depuis Visual Studio 2008. En effet afin de déployer son application avec les librairies de Crystal Reports il suffisait d'ajouter les « merge modules » ou modules de fusion suivant à son projet d'installation et de déploiement :
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;div&gt;&lt;strong&gt;Crystal Reports 2003 :
&lt;/strong&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;Crystal_Database_Access2003.msm
&lt;/li&gt;&lt;li&gt;Crystal_Database_Access2003_enu.msm
&lt;/li&gt;&lt;li&gt;Crystal_regwiz2003.msm
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;div&gt;&lt;strong&gt;Crystal Reports 2005 :
&lt;/strong&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;CrystalReportsRedist2005_x86.msm
&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;L'idée des merge modules de pouvoir intégrer facilement des fichiers et librairies supplémentaire à une solution de déploiement/installation.
&lt;/p&gt;&lt;h2&gt;Après Visual Studio 2008 :
&lt;/h2&gt;&lt;p&gt;Cette solution n'est plus d'actualité avec Crystal Reports 2008 qui ne s'intègre plus aussi facilement à un package de déploiement .Net, il faut désormais inclure l'installation des composants Crystal Reports au processus d'installation de votre application, en plus de votre propre solution de déploiement. Ces fichiers sont inclus à l'installation de Visual Studio 2008 et disponibles dans les dossiers suivants :
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Crystal Reports Basic for Visual Studio 2008 (x86) 
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt; C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5\CRRedist2008_x86.msi 
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Crystal Reports Basic for Visual Studio 2008 (x64) 
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt; C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bootstrapper\Packages\CrystalReports10_5\CRRedist2008_x64.msi 
&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Crystal Reports Basic for Visual Studio 2008 (IA64) 
&lt;/strong&gt;&lt;/p&gt;&lt;p&gt; C:\Program Files\Microsoft Visual Studio 9.0\Crystal Reports\CRRedist\IA64\CRRedist2008_ia64.msi
&lt;/p&gt;&lt;p&gt;Il est également possible d'obtenir les fichiers d'installation de Crystal Reports, toutes versions confondu via le site de l'éditeur &lt;a href="http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm"&gt;http://service.sap.com/sap/bc/bsp/spn/bobj_download/main.htm&lt;/a&gt;.
&lt;/p&gt;&lt;h2&gt;Et Crystal Reports dans Visual Studio 2010 ?
&lt;/h2&gt;&lt;p&gt;Ceux qui utilisent la version bêta de Visual Studio 2010 l'auront remarqué, Crystal Reports est tout simplement absent. Pour les inquiets, &lt;a href="http://blogs.msdn.com/scottno/"&gt;Scott Nonnenberg&lt;/a&gt; (Program Manager, Visual C# Team) a annoncé que Crystal Reports for Visual Studio 2010 sera publié séparément au lieu d'être inclus directement dans Visual Studio. 
&lt;/p&gt;&lt;p&gt;Plus d'informations par ici :
&lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa288411(VS.71).aspx"&gt;http://msdn.microsoft.com/en-us/library/aa288411(VS.71).aspx&lt;/a&gt;
	&lt;/p&gt;&lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/ms225231.aspx"&gt;http://msdn.microsoft.com/en-us/library/ms225231.aspx&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;</description>
      <link>http://www.decompiler-vb.net/blog/post/Crystal-Reports-Point-sur-le-deploiement.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/Crystal-Reports-Point-sur-le-deploiement.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=0d037488-67ee-4016-98a8-dd2895aadda6</guid>
      <pubDate>Sat, 04 Dec 2010 12:37:00 -0400</pubDate>
      <category>Crystal Reports</category>
      <category>.Net</category>
      <dc:publisher>WΛЯИІNG</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=0d037488-67ee-4016-98a8-dd2895aadda6</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=0d037488-67ee-4016-98a8-dd2895aadda6</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/Crystal-Reports-Point-sur-le-deploiement.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=0d037488-67ee-4016-98a8-dd2895aadda6</wfw:commentRss>
    </item>
    <item>
      <title>VBReFormer: How to alter a Visual Basic 6.0 application</title>
      <description>&lt;p&gt;
&lt;strong&gt;English:&lt;/strong&gt; 
&lt;/p&gt;
&lt;p&gt;
One of the most exiting feature of VBReFormer is design edition mode&amp;nbsp;for binaries&amp;nbsp;Visual Basic applications. 
&lt;/p&gt;
&lt;p&gt;
I have done this webcast to show that we can easily edit and alter an executable written with Visual Basic 6 with help of my half-decompiler &lt;a href="http://www.decompiler-vb.net/vbreformer.aspx"&gt;VBReFormer 2007 Professional Edition&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
For more information about VBReFormer: &lt;a href="http://www.decompiler-vb.net/"&gt;http://www.decompiler-vb.net/&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;French:&lt;/strong&gt; 
&lt;/p&gt;
&lt;p&gt;
L&amp;#39;une des plus importante fonction de VBReFormer est la possibilit&amp;eacute; d&amp;#39;&amp;eacute;diter le design de vos applications Visual Basic m&amp;ecirc;me une fois compil&amp;eacute;. 
&lt;/p&gt;
&lt;p&gt;
J&amp;#39;ai&amp;nbsp;donc r&amp;eacute;alis&amp;eacute;&amp;nbsp;ce petit webcast pour montrer que l&amp;#39;on peut facilement &amp;eacute;diter un ex&amp;eacute;cutable &amp;eacute;crit en Visual Basic 6 avec l&amp;#39;aide de mon semi-d&amp;eacute;compilateur &lt;a href="http://www.decompiler-vb.net/vbreformer.aspx"&gt;VBReFormer 2007 Professional Edition&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
Pour plus de renseignements &amp;agrave; propos de VBReFormer: &lt;a href="http://www.decompiler-vb.net/"&gt;http://www.decompiler-vb.net/&lt;/a&gt; . 
&lt;/p&gt;
&lt;p&gt;
D&amp;#39;ailleurs, pour ceux que la traduction d&amp;#39;applications int&amp;eacute;resse, je vous conseille d&amp;#39;aller visiter le site de la communaut&amp;eacute; des traducteurs francophones (&lt;a href="http://www.toutfr.com/"&gt;http://www.toutfr.com/&lt;/a&gt;) qui est une communaut&amp;eacute; de passionn&amp;eacute;s tr&amp;egrave;s sympathique . 
&lt;/p&gt;
&lt;div style="overflow-y: hidden; overflow-x: hidden; margin: 0px auto; width: 529px; height: 398px; padding: 0px"&gt;
&lt;iframe src="http://silverlight.services.live.com/invoke/67766/VBReFormer%20part1/iframe.html" frameborder="0" style="overflow-y: hidden; overflow-x: hidden; width: 546px; height: 409px"&gt;&lt;/iframe&gt;
&lt;/div&gt;
</description>
      <link>http://www.decompiler-vb.net/blog/post/VBReFormer-How-to-alter-a-Visual-Basic-60-application.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/VBReFormer-How-to-alter-a-Visual-Basic-60-application.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=c7660e11-0bed-4426-ad33-3a3d6aa0d696</guid>
      <pubDate>Sat, 22 May 2010 21:59:00 -0400</pubDate>
      <category>Decompilers</category>
      <category>VBReFormer</category>
      <category>Visual Basic</category>
      <dc:publisher>WΛЯИING</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=c7660e11-0bed-4426-ad33-3a3d6aa0d696</pingback:target>
      <slash:comments>1</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=c7660e11-0bed-4426-ad33-3a3d6aa0d696</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/VBReFormer-How-to-alter-a-Visual-Basic-60-application.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=c7660e11-0bed-4426-ad33-3a3d6aa0d696</wfw:commentRss>
    </item>
    <item>
      <title>New release: VBReFormer 5.4 Professional</title>
      <description>&lt;p&gt;I’m proud to announce the release and availability of VBReFormer Professional 5.4 (for licensed users). &lt;p&gt;The updated version of VBReFormer can be downloaded from your client account! &lt;br&gt;&lt;a href="http://www.decompiler-vb.net/account.aspx"&gt;http://www.decompiler-vb.net/account.aspx&lt;/a&gt; &lt;p&gt;&lt;b&gt;What’s new in VBReFormer Professional 5.4 ?&lt;/b&gt; &lt;p&gt;1. The analysis engine for disassembling and decompiling has been modified to recover language structure information (in order to decompile If/End If/Do/Loop/While blocks). &lt;p&gt;Then VBReFormer is now able to decompile simple conditions block like If/End If and Do/Loop/While conditions block. &lt;p&gt;2. The event name from controls is now back and shown on the code. &lt;p&gt;3. Conditions with Variant type and floating points type (Single and Double) is now supported because we included lot of news Visual Basic Virtual Machine functions: &lt;p&gt;&lt;i&gt;__vbaVarTstEq&lt;br&gt;&lt;/i&gt;&lt;i&gt;__vbaVarTstGe&lt;br&gt;&lt;/i&gt;&lt;i&gt;__vbaVarTstGt&lt;br&gt;&lt;/i&gt;&lt;i&gt;__vbaVarTstLe&lt;br&gt;&lt;/i&gt;&lt;i&gt;__vbaVarTstLt&lt;br&gt;&lt;/i&gt;&lt;i&gt;__vbaVarTstNe&lt;/i&gt; &lt;p&gt;&lt;i&gt;&lt;/i&gt; &lt;p&gt;4. An important bugfix has been applied. The problem was that VBReFormer sometime crashed on loading application on Windows XP, and was not showing every code from Visual Basic objects (vb6.old library was not properly setup). &lt;p&gt;5. New preference setting: You can now choose if you want to show only assembly code, only Visual Basic code, or the both.&lt;/p&gt;</description>
      <link>http://www.decompiler-vb.net/blog/post/New-release-VBReFormer-54-Professional.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/New-release-VBReFormer-54-Professional.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=99d6c6b2-3b69-4ef0-b2dd-efe80e08966c</guid>
      <pubDate>Thu, 05 Nov 2009 17:11:35 -0400</pubDate>
      <category>Decompilers</category>
      <category>VBReFormer</category>
      <category>Visual Basic</category>
      <dc:publisher>WΛЯИING</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=99d6c6b2-3b69-4ef0-b2dd-efe80e08966c</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=99d6c6b2-3b69-4ef0-b2dd-efe80e08966c</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/New-release-VBReFormer-54-Professional.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=99d6c6b2-3b69-4ef0-b2dd-efe80e08966c</wfw:commentRss>
    </item>
    <item>
      <title>How to bypass Visual Basic 6.0 application security forms ?</title>
      <description>&lt;p style="text-align: justify"&gt;In the year 2002, while I was working on my Visual Basic decompiler, VBReFormer, I discovered an interesting way on how to bypass the startup login form of any secured Visual Basic 6.0 application. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Any information presented here is only for learning purposes. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;This is an important issue for the following reasons: &lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;     &lt;div style="text-align: justify"&gt;This issue affects almost 100% of Visual Basic applications secured by a startup security form or startup license form &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="text-align: justify"&gt;This issue is common to Visual Basic 4.0 to Visual Basic 6.0 &lt;/div&gt;   &lt;/li&gt;    &lt;li&gt;     &lt;div style="text-align: justify"&gt;This issue does not need any assembler knowledge to be applied, really quick and fast to apply &lt;/div&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p style="text-align: justify"&gt;In this article, I will show you how your application can be bypassed by this vulnerability, and how you can secure your application against this issue. &lt;/p&gt;  &lt;h2&gt;Description of the vulnerability: &lt;/h2&gt;  &lt;p style="text-align: justify"&gt;The internal Visual Basic application structure provides a table in which each form configuration properties are stored. &lt;a href="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/HowtobypassVis.0applicationsecurityforms_701/Crystal_Clear_app_virus_detected_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="128" alt="Crystal_Clear_app_virus_detected" src="http://www.decompiler-vb.net/blog/image.axd?picture=WindowsLiveWriter/HowtobypassVis.0applicationsecurityforms_701/Crystal_Clear_app_virus_detected_thumb.png" width="128" align="right" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p style="text-align: justify"&gt;The main data of each user form, user control and designer are stored on a table of form header which provides the following information: signature, unique identifier, startup attribute, address of the form, and reserved bytes. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;The issue is that the startup attribute is really easy to change in order to make the main form of an application the startup form of your application. &lt;/p&gt;  &lt;h2&gt;Scenario of attack: &lt;/h2&gt;  &lt;p style="text-align: justify"&gt;We will work with a hexadecimal editor in order to analyze and edit the application. It's the only needed tool. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;In the following scenario, the sample application we will bypass has two form called &amp;quot;frmMain&amp;quot; and &amp;quot;frmLicense&amp;quot;. The &amp;quot;frmMain&amp;quot; form is the Main form, and the &amp;quot;frmLicense&amp;quot; form is a form asking licensing information in order to access to the Main form, then the application is secured by a &amp;quot;frmLicense&amp;quot; form which is the startup form. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;First of all, you must search and found the Visual Basic Header, which contains all important information of your application. To find it, just search the Visual Basic Header signature (&amp;quot;VB5!&amp;quot;) into the binary: &lt;/p&gt;  &lt;div&gt;   &lt;table style="background: #eaf1dd; border-collapse: collapse" border="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td style="border-right: medium none; padding-right: 7px; border-top: black 1pt solid; padding-left: 7px; border-left: medium none; border-bottom: black 1pt solid"&gt;           &lt;p&gt;&lt;span style="font-size: 9pt; font-family: courier new"&gt;&lt;strong&gt;&lt;span style="color: #a6a6a6"&gt;0000 0000 7011 4000 4C00 0000&lt;/span&gt;&lt;span style="color: black"&gt; &lt;/span&gt;&lt;span style="color: white; background-color: red"&gt;5642 3521&lt;/span&gt;&lt;span style="color: black"&gt;                   &lt;br /&gt;F01F 5642 3646 522E 444C 4C00 0000 0000                    &lt;br /&gt;7E00 0000 0000 0000 0000 0000 0000 0A00                    &lt;br /&gt;0C04 0000 0904 0000 0000 0000 6C16 4000                    &lt;br /&gt;80F0 3000 00FF FFFF 0800 0000 0100 0000                    &lt;br /&gt;0100 0000 E900 0000 &lt;span style="background-color: lime"&gt;3C12 4000&lt;/span&gt; 3C12 4000                    &lt;br /&gt;3411 4000 7800 0000 8000 0000 8800 0000                    &lt;br /&gt;8900 0000 0000 0000 0000 0000 0000 0000                    &lt;br /&gt;0000 0000 5072 6F6A 6574 3300 5072 6F6A                    &lt;br /&gt;6574 3100 0050 726F 6A65 7431 0000 0000&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;          &lt;td style="border-right: medium none; padding-right: 7px; border-top: black 1pt solid; padding-left: 7px; border-left: medium none; border-bottom: black 1pt solid"&gt;           &lt;p&gt;&lt;span style="font-size: 9pt; font-family: courier new"&gt;&lt;strong&gt;&lt;span style="color: #a6a6a6"&gt;....p.@.L...&lt;/span&gt;&lt;span style="color: white"&gt;&lt;span style="background-color: red"&gt;VB5!&lt;/span&gt;                    &lt;br /&gt;&lt;/span&gt;&lt;span style="color: black"&gt;..VB6FR.DLL.....                   &lt;br /&gt;~...............                    &lt;br /&gt;............l.@.                    &lt;br /&gt;..0.............                    &lt;br /&gt;........&lt;span style="background-color: lime"&gt;&amp;lt;.@.&lt;/span&gt;&amp;lt;.@.                    &lt;br /&gt;4.@.x...........                    &lt;br /&gt;................                    &lt;br /&gt;....Projet3.Proj                    &lt;br /&gt;et1..Projet1....&lt;/span&gt;&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p style="text-align: justify"&gt;   &lt;br /&gt;Note that the Visual Basic header has a length of 0x68 bytes, but this is not the most important information because we only need 2 bytes from this header to continue. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;The information we need is the address of the Form Header Table, stored at the offset 0x4D of the Visual Basic Header. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Here we can read the address 0x0040123C. This is the Virtual Address of the Form Header Table, and we must convert it into a real address. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Basically, if your software is a Visual Basic 6.0 application, it mean that the Form Header Table is stored at the real address 0x0000123C = (0x0040123C - 0x00400000) in your application. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;We now have to go to the address 0x123C to see the Form Header Table: &lt;/p&gt;  &lt;div&gt;   &lt;table style="border-collapse: collapse" border="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td style="padding-right: 7px; border-top: #9bbb59 1pt solid; padding-left: 7px; border-bottom: #9bbb59 1pt solid"&gt;           &lt;p&gt;&lt;span style="font-size: 10pt; color: black; font-family: courier new"&gt;&lt;strong&gt;&lt;span style="background-color: lime"&gt;5000 0000&lt;/span&gt; BBD5 839F DDD7 CC41 BD2F 2358                  &lt;br /&gt;28D2 B2E6 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;0000 0000 0000 0000 &lt;span style="background-color: yellow"&gt;1000&lt;/span&gt; 0000 0000 0000                  &lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;9C00 0000 0000 0000 7011 4000 4C00 0000&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;          &lt;td style="padding-right: 7px; border-top: #9bbb59 1pt solid; padding-left: 7px; border-bottom: #9bbb59 1pt solid" valign="middle"&gt;           &lt;p&gt;&lt;span style="font-size: 16pt; color: black"&gt;&lt;strong&gt;frmLicense&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="background: #e6eed5"&gt;         &lt;td style="padding-right: 7px; border-top: medium none; padding-left: 7px; border-bottom: #9bbb59 1pt solid"&gt;           &lt;p&gt;&lt;span style="font-size: 10pt; color: black; font-family: courier new"&gt;&lt;strong&gt;&lt;span style="background-color: lime"&gt;5000 0000&lt;/span&gt; BC8B D132 ACD5 8E46 80EA 6E9A                  &lt;br /&gt;F88F C04D 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;0000 0000 0100 0000 &lt;span style="background-color: yellow"&gt;0000&lt;/span&gt; 0000 0000 0000                  &lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;9C00 0000 0000 0000 7C1C 4000 9C00 0000&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;          &lt;td style="padding-right: 7px; border-top: medium none; padding-left: 7px; border-bottom: #9bbb59 1pt solid" valign="middle"&gt;           &lt;p&gt;&lt;span style="font-size: 16pt; color: black"&gt;&lt;strong&gt;frmMain&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p style="text-align: justify"&gt;   &lt;br /&gt;We can see on the above sample there is a table of two &amp;quot;Form Header&amp;quot;, one header per form: &amp;quot;frmLicense&amp;quot; and &amp;quot;frmMain&amp;quot;. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;A Form Header starts with the 0x50000000 signature, and has a length of 0x50 bytes. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;The information we need, here highlighted in blue is the Control Flag. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;The Control Flag can take the following values: &lt;/p&gt;  &lt;div style="margin-left: 28pt"&gt;   &lt;table style="border-collapse: collapse" width="520" border="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;&lt;b&gt;Form Type&lt;/b&gt;&lt;/td&gt;          &lt;td width="57"&gt;&lt;b&gt;Startup&lt;/b&gt;&lt;/td&gt;          &lt;td width="45"&gt;&lt;b&gt;Dec&lt;/b&gt;&lt;/td&gt;          &lt;td width="68"&gt;&lt;b&gt;Hex&lt;/b&gt;&lt;/td&gt;          &lt;td width="154"&gt;&lt;b&gt;Bin&lt;/b&gt;&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;SDI Form&lt;/td&gt;          &lt;td width="57"&gt;N&lt;/td&gt;          &lt;td width="46"&gt;0&lt;/td&gt;          &lt;td width="69"&gt;0x0000&lt;/td&gt;          &lt;td width="154"&gt;0b00000000000&lt;b&gt;0&lt;/b&gt;0000&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;MDI Container Form&lt;/td&gt;          &lt;td width="57"&gt;N&lt;/td&gt;          &lt;td width="47"&gt;1&lt;/td&gt;          &lt;td width="69"&gt;0x0001&lt;/td&gt;          &lt;td width="154"&gt;0b00000000000&lt;b&gt;0&lt;/b&gt;0001&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;SDI Form&lt;/td&gt;          &lt;td width="57"&gt;Y&lt;/td&gt;          &lt;td width="48"&gt;16&lt;/td&gt;          &lt;td width="69"&gt;0x0010&lt;/td&gt;          &lt;td width="154"&gt;0b00000000000&lt;b&gt;1&lt;/b&gt;0000&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;MDI Container Form&lt;/td&gt;          &lt;td width="57"&gt;Y&lt;/td&gt;          &lt;td width="49"&gt;17&lt;/td&gt;          &lt;td width="69"&gt;0x0011&lt;/td&gt;          &lt;td width="154"&gt;0b00000000000&lt;b&gt;1&lt;/b&gt;0001&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;MDI Child Form&lt;/td&gt;          &lt;td width="57"&gt;Y&lt;/td&gt;          &lt;td width="49"&gt;18&lt;/td&gt;          &lt;td width="69"&gt;0x0012&lt;/td&gt;          &lt;td width="154"&gt;0b00000000000&lt;b&gt;1&lt;/b&gt;0010&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;SDI Form With Window control&lt;/td&gt;          &lt;td width="57"&gt;N&lt;/td&gt;          &lt;td width="49"&gt;128&lt;/td&gt;          &lt;td width="69"&gt;0x0080&lt;/td&gt;          &lt;td width="154"&gt;0b00000000100&lt;b&gt;0&lt;/b&gt;0000&lt;/td&gt;       &lt;/tr&gt;        &lt;tr&gt;         &lt;td width="182" colspan="2"&gt;SDI Form With Window control&lt;/td&gt;          &lt;td width="57"&gt;Y&lt;/td&gt;          &lt;td width="50"&gt;144&lt;/td&gt;          &lt;td width="70"&gt;0x0090&lt;/td&gt;          &lt;td width="155"&gt;0b00000000100&lt;b&gt;1&lt;/b&gt;0000&lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p style="text-align: justify"&gt;   &lt;br /&gt;The above example show that the &amp;quot;frmLicense&amp;quot; Control Flag is set to 0x0010 (SDI Form [startup]) and the &amp;quot;frmMain&amp;quot; Startup Flag is set to 0x0000 (SDI Form [no startup]) meaning the &amp;quot;frmLicense&amp;quot; form is the startup form of the application. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;The objective being to bypass the &amp;quot;frmLicense&amp;quot; form, we now have to exchange the startup flag of the both forms in order to make the &amp;quot;frmMain&amp;quot; form the startup form of the application. &lt;/p&gt;  &lt;div&gt;   &lt;table style="border-collapse: collapse" border="0"&gt;&lt;tbody&gt;       &lt;tr&gt;         &lt;td style="padding-right: 7px; border-top: #9bbb59 1pt solid; padding-left: 7px; border-bottom: #9bbb59 1pt solid"&gt;           &lt;p&gt;&lt;span style="font-size: 9pt; color: black; font-family: courier new"&gt;&lt;strong&gt;&lt;span style="background-color: lime"&gt;5000 0000&lt;/span&gt; BBD5 839F DDD7 CC41 BD2F 2358                  &lt;br /&gt;28D2 B2E6 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;0000 0000 0000 0000 &lt;span style="background-color: yellow"&gt;0000&lt;/span&gt; 0000 0000 0000                  &lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;9C00 0000 0000 0000 7011 4000 4C00 0000&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;          &lt;td style="padding-right: 7px; border-top: #9bbb59 1pt solid; padding-left: 7px; border-bottom: #9bbb59 1pt solid" valign="middle"&gt;           &lt;p&gt;&lt;span style="font-size: 16pt; color: black"&gt;&lt;strong&gt;frmLicence&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;        &lt;tr style="background: #e6eed5"&gt;         &lt;td style="padding-right: 7px; border-top: medium none; padding-left: 7px; border-bottom: #9bbb59 1pt solid"&gt;           &lt;p&gt;&lt;span style="font-size: 9pt; color: black; font-family: courier new"&gt;&lt;strong&gt;&lt;span style="background-color: lime"&gt;5000 0000&lt;/span&gt; BC8B D132 ACD5 8E46 80EA 6E9A                  &lt;br /&gt;F88F C04D 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;0000 0000 0100 0000 &lt;span style="background-color: yellow"&gt;1000&lt;/span&gt; 0000 0000 0000                  &lt;br /&gt;0000 0000 0000 0000 0000 0000 0000 0000                  &lt;br /&gt;9C00 0000 0000 0000 7C1C 4000 9C00 0000&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;          &lt;td style="padding-right: 7px; border-top: medium none; padding-left: 7px; border-bottom: #9bbb59 1pt solid" valign="middle"&gt;           &lt;p&gt;&lt;span style="font-size: 16pt; color: black"&gt;&lt;strong&gt;frmMain&lt;/strong&gt;&lt;/span&gt; &lt;/p&gt;         &lt;/td&gt;       &lt;/tr&gt;     &lt;/tbody&gt;&lt;/table&gt; &lt;/div&gt;  &lt;p style="text-align: justify"&gt;   &lt;br /&gt;This is so simple to apply, just one byte to change, and the &amp;quot;frmMain&amp;quot; form is set to startup form of the application. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Now, when you start the application, you have a direct access to the &amp;quot;frmMain&amp;quot; form, bypassing the &amp;quot;frmLicense&amp;quot; form. &lt;/p&gt;  &lt;h2&gt;How to protect your application against this vulnerability ?&lt;/h2&gt;  &lt;p style="text-align: justify"&gt;We have seen on the above scenario that all Visual Basic 4.0 to 6.0 applications are potentially affected by this issue; there are existing applications, commonly called &amp;quot;Visual Basic Universal Cracker&amp;quot; which allows making this work on automatic way, just with one click. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Then it's very important, when you write your application, to think about this issue in order to prevent against applying it on your application. There are different ways to setup protection your application against the application of this issue. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;The different solutions are grouped into two categories, which are the code side solutions, and the binary side solutions. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Binary side solutions are applied after the application has been compiled, like packers, compressors, or external solutions of licensing. &lt;/p&gt;  &lt;p style="text-align: justify"&gt;Code source side solutions are directly applied on the source code of your application. For example you can define a simple global variable which will be checked during all the execution of your application, and on each form. Another solution is to define the startup form on the Sub Main() procedure of your application. Of course, that is not sufficient to secure your application against advanced crackers, but on this way you will protect your software against a common and simple vulnerability. &lt;/p&gt;</description>
      <link>http://www.decompiler-vb.net/blog/post/How-to-bypass-Visual-Basic-60-application-security-forms-.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/How-to-bypass-Visual-Basic-60-application-security-forms-.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=1d193047-aa90-4866-8c77-e1ca1ae29e11</guid>
      <pubDate>Tue, 26 May 2009 17:17:00 -0400</pubDate>
      <category>Security</category>
      <category>Visual Basic</category>
      <dc:publisher>WΛЯИING</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=1d193047-aa90-4866-8c77-e1ca1ae29e11</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=1d193047-aa90-4866-8c77-e1ca1ae29e11</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/How-to-bypass-Visual-Basic-60-application-security-forms-.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=1d193047-aa90-4866-8c77-e1ca1ae29e11</wfw:commentRss>
    </item>
    <item>
      <title>Opening blog</title>
      <description>&lt;p&gt;
Hello,&amp;nbsp; 
&lt;/p&gt;
&lt;p&gt;
My name is Sylvain Bruyere,&amp;nbsp;I&amp;#39;m a freelance/developer&amp;nbsp;focused on Microsoft development languages,&amp;nbsp;and I develop a&amp;nbsp;native&amp;nbsp;Visual Basic decompiler since the year 1999, called VBReFormer. 
&lt;/p&gt;
&lt;p&gt;
After years of research on decompiler technologies, I am glad to announce the opening of this blog that will focus on knowledge-depth development for Visual Basic, related to object modeling,&amp;nbsp;compilation, decompilation, and security. &lt;br /&gt;
&lt;br /&gt;
As you can guess,&amp;nbsp;I will talk in this blog of my experiences with Visual Basic development, and others&amp;nbsp;related experiences. 
&lt;/p&gt;
</description>
      <link>http://www.decompiler-vb.net/blog/post/Opening-Blog-Sylvain-Bruyere.aspx</link>
      <comments>http://www.decompiler-vb.net/blog/post/Opening-Blog-Sylvain-Bruyere.aspx#comment</comments>
      <guid>http://www.decompiler-vb.net/blog/post.aspx?id=d452d982-35c5-4a8b-9888-97961982a412</guid>
      <pubDate>Thu, 22 May 2008 21:45:00 -0400</pubDate>
      <category>Decompilers</category>
      <category>VBReFormer</category>
      <category>Visual Basic</category>
      <dc:publisher>WΛЯИING</dc:publisher>
      <pingback:server>http://www.decompiler-vb.net/blog/pingback.axd</pingback:server>
      <pingback:target>http://www.decompiler-vb.net/blog/post.aspx?id=d452d982-35c5-4a8b-9888-97961982a412</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.decompiler-vb.net/blog/trackback.axd?id=d452d982-35c5-4a8b-9888-97961982a412</trackback:ping>
      <wfw:comment>http://www.decompiler-vb.net/blog/post/Opening-Blog-Sylvain-Bruyere.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.decompiler-vb.net/blog/syndication.axd?post=d452d982-35c5-4a8b-9888-97961982a412</wfw:commentRss>
    </item>
  </channel>
</rss>