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.
Maverick, it's not missing. It's in user32.lib.
Thanks f0dder,yes the exe packers offers an option for the resource section.
You can debug your VC apps. with Ollydbg by using the switch /Z7 for the compiler:
A small C Run-time start-up code(start.asm):
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
This one for console apps:
Naturally,the msvcrt.lib is required for __getmainargs.
All these start-up codes can be used with the C/C++ compiler
from Digital Mars.
.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.