flat assembler
Message board for the users of flat assembler.
Index
> Main > struct and union problem |
Author |
|
vid 03 Sep 2011, 22:45
try DBEvent.u.CreateProcessInfo.lpStartAddress
|
|||
03 Sep 2011, 22:45 |
|
Overflowz 03 Sep 2011, 22:51
same problem.
|
|||
03 Sep 2011, 22:51 |
|
typedef 03 Sep 2011, 23:53
^^^^
http://www.programmersheaven.com/mb/CandCPP/62634/62634/struct-vs-union/ I could have said use struct instead but as the above link says, the size of a union is the size of its largest member, because all union members share the same memory. |
|||
03 Sep 2011, 23:53 |
|
Overflowz 04 Sep 2011, 00:41
Never mind what differences are between them, I know but I'm trying to access them but I can't. I found another struct of that, but I can't access it's elements. First of all, this structure shows me error - "Undefined Symbol RIP_INFO..dwType.u" and stops at first "virtual at .u". and second, I can't access it's elements. For example, I need to access this element: DEBUG_EVENT.u.CreateProcessInfo.lpStartAddress but it fails.. I don't have any ideas how to fix structures and macroses here..
Code: EXCEPTION_NONCONTINUABLE = 0x1 EXCEPTION_MAXIMUM_PARAMETERS = 15 EXCEPTION_DEBUG_EVENT = 1 CREATE_THREAD_DEBUG_EVENT = 2 CREATE_PROCESS_DEBUG_EVENT = 3 EXIT_THREAD_DEBUG_EVENT = 4 EXIT_PROCESS_DEBUG_EVENT = 5 LOAD_DLL_DEBUG_EVENT = 6 UNLOAD_DLL_DEBUG_EVENT = 7 OUTPUT_DEBUG_STRING_EVENT = 8 RIP_EVENT = 9 struct EXCEPTION_RECORD .ExceptionCode dd ? .ExceptionFlags dd ? .pExceptionRecord dd ? .ExceptionAddress dd ? .NumberParameters dd ? .ExceptionInformation rd 15 ends struct EXCEPTION_DEBUG_INFO .pExceptionRecord EXCEPTION_RECORD .dwFirstChance dd ? ends struct CREATE_THREAD_DEBUG_INFO .hThread dd ? .lpThreadLocalBase dd ? .lpStartAddress dd ? ends struct CREATE_PROCESS_DEBUG_INFO .hFile dd ? .hProcess dd ? .hThread dd ? .lpBaseOfImage dd ? .dwDebugInfoFileOffset dd ? .nDebugInfoSize dd ? .lpThreadLocalBase dd ? .lpStartAddress dd ? .lpImageName dd ? .fUnicode dw ? ends struct EXIT_THREAD_DEBUG_INFO .dwExitCode dd ? ends struct EXIT_PROCESS_DEBUG_INFO .dwExitCode dd ? ends struct LOAD_DLL_DEBUG_INFO .hFile dd ? .lpBaseOfDll dd ? .dwDebugInfoFileOffset dd ? .nDebugInfoSize dd ? .lpImageName dd ? .fUnicode dw ? ends struct UNLOAD_DLL_DEBUG_INFO .lpBaseOfDll dd ? ends struct OUTPUT_DEBUG_STRING_INFO .lpDebugStringData dd ? .fUnicode dw ? .nDebugStringiLength dw ? ends struct RIP_INFO .dwError dd ? .dwType dd ? ends struct DEBUG_EVENT .dwDebugEventCode dd ? .dwProcessId dd ? .dwThreadId dd ? .u rb sizeof.EXCEPTION_DEBUG_INFO virtual at .u .Exception EXCEPTION_DEBUG_INFO end virtual virtual at .u .CreateThread CREATE_THREAD_DEBUG_INFO end virtual virtual at .u .CreateProcessInfo CREATE_PROCESS_DEBUG_INFO end virtual virtual at .u .ExitThread EXIT_THREAD_DEBUG_INFO end virtual virtual at .u .ExitProcess EXIT_PROCESS_DEBUG_INFO end virtual virtual at .u .LoadDll LOAD_DLL_DEBUG_INFO end virtual virtual at .u .UnloadDll UNLOAD_DLL_DEBUG_INFO end virtual virtual at .u .DebugString OUTPUT_DEBUG_STRING_INFO end virtual virtual at .u .RipInfo RIP_INFO end virtual ends could someone just test it to see what is the result ? here's attachements of some source codes that fails. -- will be very thankful if someone will fix this for me or teaches how to access them. Thanks.
|
|||||||||||
04 Sep 2011, 00:41 |
|
revolution 04 Sep 2011, 00:49
'struct' is a macro and you shouldn't be including the leading dot (.) in the member fields with that macro. Also it is not compatible with 'virtual'.
Instead I suggest you use 'struc' instead with curly brackets {} and remove the 'ends'. Code: struc EXCEPTION_RECORD { .ExceptionCode dd ? .ExceptionFlags dd ? .pExceptionRecord dd ? .ExceptionAddress dd ? .NumberParameters dd ? .ExceptionInformation rd 15 } ;etc If you still insist upon using 'struct' then you need to follow the rules and alter all your structure member fields. If you don't understand 'struc' then read the help: http://flatassembler.net/docs.php We can't be duplicating the documentation here in the forum, that would be inefficient use of time. |
|||
04 Sep 2011, 00:49 |
|
Overflowz 04 Sep 2011, 00:54
Thanks revolution! It works perfect for now! Thank you!!!
I'll read that, thanks again! |
|||
04 Sep 2011, 00:54 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.