Re: copymemory basic question



"Sam Hobbs" <samuel@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:eXiM4dTsFHA.3216@xxxxxxxxxxxxxxxxxxxxxxx
> I use the value "0DEB1h" (&HDEB1) so that I can find the code in the
> machine code listing. I compile the code prior to dis-assembly in order to
> get the compiled code. I created a small test project with just a module
> and later I added a class. I compiled the project and then dumped the exe
> using:
>
> DUMPBIN /DisAsm /Out:Dump.txt StaticCode.exe
>

There is an easier way to see the compiled code than this by using VC++ 6.0.
Here are step by step instructions:

- Create a new VB project, and write a sample code in Form_Click in Form1.
- Add a MsgBox "Hello" in the code.
- Save the project(a must).
- Go to Project|Properties|Compile, and select "Create Symbolic Debug Info".
- Compile and save.
- Run the EXE from Windows Explorer.
- Go to VC++ 6.0|File|Close Workspace.
- Go to Build|Start Debug|Attach to process, and select your running EXE.
- Click on Form1, this will execute Form_Click, and a message box with the
word Hello will appear. Do not click OK yet.
- Go to VC++ 6.0|Debug|Break.
- Go to View|Debug Windows, and make sure that "Call Stack" window is
visible.
- One of the lines in "Call Stack" shows "Form1::Form_Click()", double click
on that, this will view the source code.
- Now Right Click on any source line that you like, and select "Go to
Disassembly", this will show the source and what VB compiled the code to in
an easy to view format.
- After you are done, make sure that you turn off the debug info in your VB6
project and recompile, otherwise, you will make it easier for a hacker to
break your code.

It's important to note that VB6 does source level optimization, a specific
line may be compiled differently based on the lines before it.

Please start a new thread if you want to discuss this further as this might
be off topic...

Feel free to post this on the web...


.



Relevant Pages

  • Re: Question on exe size
    ... Changing the various compile modes did Jack. ... Deleting the original exe and then compiling did nothing, ... Anyone else here using Core 2 Quads for VB6? ... On both boxes and the laptop the Project Properties are set to Compile to Native Code, ...
    (microsoft.public.vb.general.discussion)
  • Re: advice needed
    ... You're an idiot, McCarthy, and a dishonest idiot at that! ... The OP said that he had a learning copy of VB6 which he had been using for a long time and that he had a problem in that the learning edition does not compile to exe and he could not afford to buy a full copy of VB6 even if it were commercially available, ...
    (microsoft.public.vb.general.discussion)
  • Re: Is CMUCL insane? P.S. Me vs. CLM (Common Lisp Music)
    ... Or to build Windows without a working version of Windows. ... why are you trying to compile CMUCL?" ... let's assume I use Linux and not an emulator here... ...
    (comp.lang.lisp)
  • Re: ANNOUNCE: DBI 1.54 RC6 - including cool new DBD::Gofer stateless proxy
    ... Fixed to compile for perl built with -DNO_MATHOMS thanks to Jerry D. ... Changed setting trace file to no longer write "Trace file set" to new file. ... Updated DBI::DBD docs for driver authors thanks to Ammon Riley ... Some testing on strange platforms, like Windows, would be helpful as ...
    (perl.dbi.users)
  • Re: Momentary black screen when program launches
    ... lets say the compiler takes 5 seconds to compile my source. ... seconds is up then I can get back to the Windows desktop and I will see an ... spawned by another program (IDE, Explorer, etc.) ... The Help and Support newsgroup is *terribly* named, ...
    (microsoft.public.windowsxp.general)

Loading