Click here to Skip to main content
15,897,273 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: VC 2005 compiler error Pin
CPallini28-Nov-07 0:45
mveCPallini28-Nov-07 0:45 
GeneralRe: VC 2005 compiler error Pin
neha.agarwal2728-Nov-07 1:00
neha.agarwal2728-Nov-07 1:00 
GeneralRe: VC 2005 compiler error Pin
David Crow29-Nov-07 2:45
David Crow29-Nov-07 2:45 
GeneralI know... Pin
CPallini29-Nov-07 3:07
mveCPallini29-Nov-07 3:07 
GeneralRe: VC 2005 compiler error Pin
toxcct28-Nov-07 1:34
toxcct28-Nov-07 1:34 
GeneralRe: VC 2005 compiler error Pin
neha.agarwal2728-Nov-07 1:38
neha.agarwal2728-Nov-07 1:38 
GeneralRe: VC 2005 compiler error Pin
toxcct28-Nov-07 1:40
toxcct28-Nov-07 1:40 
GeneralRe: VC 2005 compiler error Pin
Cedric Moonen28-Nov-07 1:47
Cedric Moonen28-Nov-07 1:47 
GeneralRe: VC 2005 compiler error Pin
neha.agarwal2728-Nov-07 17:36
neha.agarwal2728-Nov-07 17:36 
GeneralRe: VC 2005 compiler error Pin
David Crow29-Nov-07 2:51
David Crow29-Nov-07 2:51 
QuestionHelp with a couple of C questions Pin
3alawii27-Nov-07 23:57
3alawii27-Nov-07 23:57 
AnswerRe: Help with a couple of C questions Pin
manish.patel28-Nov-07 1:31
manish.patel28-Nov-07 1:31 
AnswerRe: Help with a couple of C questions Pin
manish.patel28-Nov-07 1:36
manish.patel28-Nov-07 1:36 
AnswerRe: Help with a couple of C questions Pin
David Crow28-Nov-07 3:26
David Crow28-Nov-07 3:26 
AnswerRe: Help with a couple of C questions Pin
BadKarma28-Nov-07 3:36
BadKarma28-Nov-07 3:36 
Questionnfo Pin
john563227-Nov-07 23:24
john563227-Nov-07 23:24 
AnswerRe: nfo Pin
toxcct27-Nov-07 23:28
toxcct27-Nov-07 23:28 
GeneralOfftopic Pin
Nelek28-Nov-07 3:13
protectorNelek28-Nov-07 3:13 
GeneralRe: Offtopic Pin
toxcct28-Nov-07 3:18
toxcct28-Nov-07 3:18 
GeneralRe: Offtopic Pin
Nelek28-Nov-07 21:43
protectorNelek28-Nov-07 21:43 
GeneralRe: Offtopic Pin
toxcct28-Nov-07 21:47
toxcct28-Nov-07 21:47 
QuestionConsult the issue of Win API routine address and code injection Pin
Jude Deng27-Nov-07 23:04
Jude Deng27-Nov-07 23:04 
AnswerRe: Consult the issue of Win API routine address and code injection [modified] Pin
maciu202028-Nov-07 0:20
maciu202028-Nov-07 0:20 
GeneralRe: Consult the issue of Win API routine address and code injection Pin
Jude Deng28-Nov-07 14:48
Jude Deng28-Nov-07 14:48 
GeneralRe: Consult the issue of Win API routine address and code injection Pin
maciu202028-Nov-07 23:15
maciu202028-Nov-07 23:15 
Actually the address may vary, windows sets it while loading kernel32.dll.
But on each machine, all processes share kernel32.dll functions' addresses.
DWORD __stdcall RemoteThreadProc(LPVOID lParam)<br />
{<br />
  __asm<br />
  {<br />
    push 0<br />
    call DWORD PTR LoadLibrary<br />
  }<br />
}

should be ok...as long as you compile your program with optimizations on.
It would be definitely OK if you wrote the whole thing in assembly to ensure that compiler won't insert there something you don't want it to.
push 0<br />
call DWORD PTR LoadLibrary<br />
retn 0

generates the same code, no matter where it's placed.

If it still doesn't work, can you disassembly RemoteThreadProc and post here?

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.