Export thread

  • Be sure to checkout “Tips & Tricks”
    Dear Guest Visitor → Once you register and log-in please checkout the “Tips & Tricks” page for some very handy tips!

    /Steve.
  • BootAble – FreeDOS boot testing freeware

    To obtain direct, low-level access to a system's mass storage drives, SpinRite runs under a GRC-customized version of FreeDOS which has been modified to add compatibility with all file systems. In order to run SpinRite it must first be possible to boot FreeDOS.

    GRC's “BootAble” freeware allows anyone to easily create BIOS-bootable media in order to workout and confirm the details of getting a machine to boot FreeDOS through a BIOS. Once the means of doing that has been determined, the media created by SpinRite can be booted and run in the same way.

    The participants here, who have taken the time to share their knowledge and experience, their successes and some frustrations with booting their computers into FreeDOS, have created a valuable knowledgebase which will benefit everyone who follows.

    You may click on the image to the right to obtain your own copy of BootAble. Then use the knowledge and experience documented here to boot your computer(s) into FreeDOS. And please do not hesitate to ask questions – nowhere else can better answers be found.

    (You may permanently close this reminder with the 'X' in the upper right.)

Thought / question about ASM

#1

C

coffeeprogrammer

The other day I was coding a web api in C# and using curl to view the responses, I had a problem with the JSON and XML being all pressed together, so I needed to find out the exact class and namespace of both for their formatting options to get it to pretty print in the console. As I was looking thought the C# class library I realized I had another assembler thought and question, which I already did a search and did not find much. Does Steve (or anyone that writes in asm) use namespaces in their code?. I don’t recall seeing anything in masm for that. He did say he writes OO. I have not programmed in assembler lately as a large amount of job listings want C# and rest apis so I have been focusing on that as well as writing design patterns in C#, but I hope some time to get back to ultra geek assembler. :) Thanks.



Chad


#2

C

coffeeprogrammer

I guess no one cares/knows. Seems like masm would/should have something like namespaces, i don't know.


#3

C

coffeeprogrammer

Well I have made some pretty significant progress on my journey. Between saturday and sunday I stay up all night reading Windows 10 System Programming part 1, and I think I have a good idea about kernel objects and the handles that indirectly access them. I stopped at chapter 4 but I took side trips in other books about COM. The source code in the book uses two libraries “Windows Implementation Library” and “windows template library”. I had quite a time figuring out how windows messages get mapped to events in ALT, but that seems to be what the windows template library uses. Its a macro thing. I think I know understand IUKnown and the factories and vtables that create server objects in com. And I got a little bit on connection points. Archive.org is a good resource. And as a C# developer I think that is what the binary NuGet (C#) packages are based on, after all they are binary DLLs and not source code. And that cleared up enough for me to understand the windows template library gui somewhat, the next part with the handles was c++ smart pointers in Windows Implementation Library, I have programmed in C++ in school, but I was unsure of what a smart pointer was, I get it now, unique and shared any way.

I have been sticking to C++ and not assembly, because my lack of knowledge with x86 instructions and windows inner workings is too much at once. I’ve decided that C++ and maybe at some point, C is what I will use for Windows for a time. I still need to understand Com I think that is still used in some areas of windows, like firewall rules for example.

Any way this original post was asking about namespaces in assembly, I wrote a simple c++ sample with two defined namespaces and disassembled it in VS. Still can’t tell, but my guess is that there are no namespaces and that if one where to follow windows.h and it’s includes and removing any namespaces, if there are any, you could basically program windows without namespaces. Thats my guess. C does not have namespaces.



I did copy windows.h to my sync drive and I am going to copy all of its includes and go over them carefully. I already found the old “win32 lean and mean” conditional include. It is Vs2022 and I also seen some includes for api sets, do I don’t know if that will complicate things. I just wanted to say thanks to Steve, I am not sure I would be willing to put in extra time for low levels if I have never found him online. Cool stuff Steve and can wait to hear about SpinRite 7 development on RTOS.


#4

Paul F

Paul F

I guess no one cares/knows. Seems like masm would/should have something like namespaces, i don't know.
I think looking into 'mangled names' will answer your question.
http://masm32.com/board/index.php?topic=6036.0


#5

C

coffeeprogrammer

Well thank you very much, I've not read the link yet but I did consult Wikipedia so I guess simply put it just adds different characters to overlapping identifier names. I am guessing this is one of the concepts covered in the compilers area. I've been looking for a good video series on compilers, hopefully based on C++, but I can't find anything that is super-great. I've checked youtube of course and coursea for something free or cheap, I can't think of too many more services, if anyone knows of any, that’s great. I just don't feel like reading about compilers at the moment that is why I am looking for a video course. I have Pluralsight and they do have an advanced JavaScript that is from the perspective of the JS compiler, but I want something more based on C++. After reviewing .cpp header files from Vs and the Windows SDK, Steve's SIB project, and the files and files from fasm I think I have a better idea of how some of the compilers and assemblers call an API like the Windows API. I also figured out __declspec at least in the dllimport and dllexport context. I figure out what I believe to understand lib files are just function prototypes pointing to the actual dlls. And of course a possibility of def files for creating lib files. At my current level of understanding I am believing that an export from a DLL can happen by way of a __declspec(dllexport) or a def file. Not 100% but that is correct, but that is what I am believing. I also figured out __stdcall by tracing back the headers files and what that tells the programmer what needs to happen when using the stack and calling procedures with arguments. I've wondered what the WINAPI and similar are for a while, I am not sure why people don't just use __stdcall in it's place, WINAPI and the others must add a little more information than __stdcall would. I couldn’t think of a way to generate LIB file with just a DLL and nothing else. There is DUMPBIN, but I didn't notice parameters or return types with that, too my thinking thinking one what have to make using of the c/cpp header files to make MASM type includes and likely the LIB files are already compatible. Well thanks again, I like posting what I am up to, I don't think I will catch up to Steve any time soon, but it is worth while. Thanks everyone.