vortex, can't remember the details and it _might_ be a rumor - I just know that weird stuff has happened when I have been messing with .rsrc, and that a bunch of PE packers/crypters that obfuscate section names have options for not messing with .rsrc.

Maverick, it's not missing. It's in user32.lib.
Posted on 2003-04-01 08:27:30 by f0dder
Thanks f0dder,yes the exe packers offers an option for the resource section.
Posted on 2003-04-02 07:05:24 by Vortex
You can debug your VC apps. with Ollydbg by using the switch /Z7 for the compiler:




Cl.exe /I\includepath /c /Z7 /Ogtyb2 /Gs /G6 /Gz /Zp1 /FAs /Fa%1.asm /Fo%1.OBJ %1.C

\masm32\bin\link /ENTRY:start /DEBUG /DEBUGTYPE:CV /SUBSYSTEM:WINDOWS
/LIBPATH:c:\masm32\lib /out:%1.exe start.obj %1.obj kernel32.lib user32.lib gdi32.lib msvcrt.lib

(+ other necessary libs.)



A small C Run-time start-up code(start.asm):




.386
.model flat,stdcall
option casemap:none

WinMain proto :DWORD,:DWORD,:DWORD,:DWORD

include \masm32\include\windows.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc

.data
.data?
hInstance HINSTANCE ?
CommandLine LPSTR ?

.code
start:
invoke GetModuleHandle, NULL
mov hInstance,eax
invoke GetCommandLine
invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT
invoke ExitProcess,eax
end start

Posted on 2003-04-23 09:08:38 by Vortex
This one for console apps:




.386
.model flat,stdcall
option casemap:none

extern main:proc

include \masm32\include\windows.inc
include \masm32\include\kernel32.inc

extern __getmainargs:proc

.data
.data?
argc dd ?
argv dd ?
env dd ?
.code
start:
push 0
push offset env
push offset argv
push offset argc
call __getmainargs
add esp,16
push argv
push argc
call main
add esp,8
invoke ExitProcess,0
end start



Naturally,the msvcrt.lib is required for __getmainargs.

All these start-up codes can be used with the C/C++ compiler
from Digital Mars.
Posted on 2003-04-23 09:19:52 by Vortex