I'm trying learning assembly language and i need to know how to read the assembly varsion of a c program from the windows 10 command prompt. I've tried using C:\users\prete\Desktop\booksrc$ gcc -g firstprog.c but it doesn't work  please help me thank you!
8699
How does one do this?  If I want to analyze how something is getting compiled, how would I get the emitted assembly code?
64269
My friend produced a small proof-of-concept assembler that worked on x86. I decided to port it for x86_64 as well, but I immediately hit a problem.  I wrote a small piece of program in C, then compiled and objdumped the code. After that I inserted it to my python script, therefore the x86_64 code is correct:  from ctypes import cast, CFUNCTYPE, c_char_p, c_long  buffer = ''.join(map(chr, [ #0000000000000000 &lt;add&gt;:   0x55,                     # push   %rbp   0x48, 0x89, 0xe5,         # mov    %rsp,%rbp   0x48, 0x89, 0x7d, 0xf8,   # mov    %rdi,-0x8(%rbp)   0x48, 0x8b, 0x45, 0xf8,   # mov    -0x8(%rbp),%rax   0x48, 0x83, 0xc0, 0x0a,   # add    $0xa,%rax   0xc9,                     # leaveq    0xc3,                     # retq ]))  fptr = cast(c_char_p(buffer), CFUNCTYPE(c_long, c_long)) print fptr(1234)   Now, why does this script keeps doing segmentation fault whenever I run it?  I have yet a question about mprotect and no execution flag. It is said to protect against most basic security exploits like buffer overruns. But what is the real reason it's in use? You could just keep on writing until you hit the .text, then inject your instructions into a nice, PROT_EXEC -area. Unless, of course, you use a write protection in .text  But then, why have that PROT_EXEC everywhere anyway? Wouldn't it just help tremendously that your .text section is write protected?
31798
Is there any way to copy text that's shown in the Command Prompt window C:\Windows\system32\cmd.exe to the clipboard?
10701
I am looking for a way to execute some console commands automatically when a command-prompt is opened in Windows, specifically to set some command aliases.  For example, when a command-prompt is opened, I want a command such as the following to be automatically run so that I can use ls instead of dir.  doskey ls=dir   How can this be done?
11839
It's been a while since I last coded arm assembler and I'm a little rusty on the details. If I call a C function from arm,  I only have to worry about saving r0-r3 and lr, right?  If the C function uses any other registers, is it responsible for saving those on the stack and restoring them? In other words, the compiler would generate code to do this for C functions.   For example if I use r10 in an assembler function, I don't have to push its value on the stack, or to memory, and pop/restore it after a C call, do I?  This is for arm-eabi-gcc 4.3.0.
18701
Does anyone know of any good tools (I'm looking for IDEs) to write assembly on the Mac. Xcode is a little cumbersome to me.  Also, on the Intel Macs, can I use generic x86 asm?  Or is there a modified instruction set? Any information about post Intel.  Also: I know that on windows, asm can run in an emulated environment created by the OS to let the code think it's running on its own dedicated machine. Does OS X provide the same thing?
72143
Could someone please explain? I couldn't find anything on the internet, everything talks about how to go about it in some way, but nothing says exactly what it is.   Also, what is a fully trusted assembly and how do they differ from one another?  I have a MS certification exam and this is the only topic that I just don't understand.  EDIT: Thanks guys. Now I have a better understanding of security in .NET. I was able to pass my certification exam.
100764
The assembly code I'm trying to run is simply a syscall 60. # exit.s .intel_syntax noprefix .section .text .globl _start  _start:  xor rax, rax mov al, 0x3c xor rdi, rdi xor rdi, 1  syscall  assembling this with as exit.s -o exit.o, linking with ld exit.o -o exit and objdump -d exit to get the final code. // ret.c const char shellcode[] = &quot;\x48\x31\xc0\xb0\x3c\x48\x31\xff\x48\x83\xf7\x01\x0f\x05&quot;; int main() {     (*(void(*)())shellcode)(); }  I compile using gcc -fno-stack-protector -z execstack -no-pie -o ret ret.c On Manjaro Linux (kernel 5.10) and Ubuntu (kernel 5.8), I get a seg fault when trying to run the final executable. I tried the same on Ubuntu 16.04 (kernel 4.4) and it works flawlessly. I did some research, and it looks like  might have changed the behavior, but I'm not sure. My question: How do I get the above code to work on the latest kernel version?
39426
I know that WIN32 denotes win32 compilation but what is _WIN32 used for?
88230
I just switched from Windows to Ubuntu 11.10.  I wrote the following code in C with the text editor and saved it as HelloWorld.c in Documents.  #include &lt;stdio.h&gt; int main() {     printf("Hello World!\n");     return 0; }   And I started the Terminal and enter the following commands:  cd Documents  gcc HelloWorld.c   A file called a.out, which, after some search on Google, is the executable. I entered this command:  a.out   But I get   a.out: command not found   Which step did I do wrongly?
66054
Suppose I am writing an application in C++ and C#.  I want to write the low level parts in C++ and write the high level logic in C#.  How can I load a .NET assembly from my C++ program and start calling methods and accessing the properties of my C# classes?
12589
I shifted to Ubuntu 10.10 now I am facing problem to have C/C++ compiler. What are the possible ways so that I can use C/C++ compiler using all the libraries (like graphic, math, conio, stdlib, etc) as in Microsoft Windows creating executable file?
38606
The man command brings up a nice manual for many programs, but how can I use it more effectively? For example man gcc brings:  NAME        gcc - GNU project C and C++ compiler  SYNOPSIS        gcc [-c|-S|-E] [-std=standard]            [-g] [-pg] [-Olevel]            [-Wwarn...] [-Wpedantic]            [-Idir...] [-Ldir...]            [-Dmacro[=defn]...] [-Umacro]            [-foption...] [-mmachine-option...]            [-o outfile] [@file] infile...         Only the most useful options are listed here; see below for the        remainder.  g++ accepts mostly the same options as gcc. .... many text   But what if I need only some part of it? What is the best way to jump to the section where -Idir is described, for example?
36363
Session transcript: &gt; type lookma.c int main() {   printf(&quot;%s&quot;, &quot;no stdio.h&quot;); }  &gt; cl lookma.c Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 14.00.50727.762 for 80x86 Copyright (C) Microsoft Corporation.  All rights reserved.  lookma.c Microsoft (R) Incremental Linker Version 8.00.50727.762 Copyright (C) Microsoft Corporation.  All rights reserved.  /out:lookma.exe lookma.obj  &gt; lookma no stdio.h
72947
Where can I find a good resource which can tell me more about any installed DLL on my Windows machine?
13624
One of the stated reasons for knowing assembler is that, on occasion, it can be employed to write code that will be more performant than writing that code in a higher-level language, C in particular.  However, I've also heard it stated many times that although that's not entirely false, the cases where assembler can actually be used to generate more performant code are both extremely rare and require expert knowledge of and experience with assembly.    This question doesn't even get into the fact that assembler instructions will be machine-specific and non-portable, or any of the other aspects of assembler.  There are plenty of good reasons for knowing assembly besides this one, of course, but this is meant to be a specific question soliciting examples and data, not an extended discourse on assembler versus higher-level languages.  Can anyone provide some specific examples of cases where assembly will be faster than well-written C code using a modern compiler, and can you support that claim with profiling evidence?  I am pretty confident these cases exist, but I really want to know exactly how esoteric these cases are, since it seems to be a point of some contention.
39320
Is there a way to get the path for the assembly in which the current code resides?  I do not want the path of the calling assembly, just the one containing the code.   Basically my unit test needs to read some xml test files which are located relative to the  dll.  I want the path to always resolve correctly regardless of whether the testing dll is run from TestDriven.NET, the MbUnit GUI or something else.  Edit: People seem to be misunderstanding what I'm asking.  My test library is located in say      C:\projects\myapplication\daotests\bin\Debug\daotests.dll   and I would like to get this path:     C:\projects\myapplication\daotests\bin\Debug\   The three suggestions so far fail me when I run from the MbUnit Gui:   Environment.CurrentDirectory gives c:\Program Files\MbUnit System.Reflection.Assembly.GetAssembly(typeof(DaoTests)).Location gives C:\Documents and Settings\george\Local Settings\Temp\ ....\DaoTests.dll System.Reflection.Assembly.GetExecutingAssembly().Location gives the same as the previous.