x86-64

command 'gcc' failed with exit status 1 while installing cx_Oracle on windows 64 bit

允我心安 提交于 2019-12-24 13:51:19
问题 I'm trying to install cx_Oracle on my Windows 7 - 64 bit version. I previously had a question here about installing cx_Oracle on Windows and I solved the issue by myself; but it was a 32 bit version of Windows 7; here I faced a new problem installing it. I should mention that I deployed 64 bit version of MinGW and also Microsoft Visual Studio 2008 . For both I got command 'gcc' failed with exit status 1 . I tried easy_install cx_Oracle in Microsoft Visual Studio 2008 console and I got this

Avoiding 0xFF bytes in shellcode using CALL to read RIP?

拈花ヽ惹草 提交于 2019-12-24 12:20:05
问题 I'm trying to write a decoder stub and I'm running into a restriction on 0xFF as a bad character. I'm using the jmp-call-pop method to get the address of my encoded shellcode into a register. Here's the relevant snippet: 401012: e8 eb ff ff ff call 0x401002 It seems like call will always use 0xFF in its bytes. Is there another instruction that, when executed, will push rip onto the stack and jump to another section of code? I've tried just pushing the address onto the stack manually, but that

ASM call Printf

£可爱£侵袭症+ 提交于 2019-12-24 10:44:25
问题 movl %ebx, %esi movl $.LC1, %edi movl $0, %eax call printf I use the following asm code to print what is in EBX register. When I use movl $1,%eax int 0x80 and the echo $? I get the correct answer but segmentation fault in the first case. I am using the GNU Assembler and AT&T syntax. How can I fix this problem? 回答1: Judging by the code, you are probably in 64 bit mode (please confirm) in which case pointers are 64 bit in size. In a position-depended executable on Linux movl $.LC1, %edi is safe

Migrating code from snow leopard to mountain lion, make and linking errors with 'x86_64'

纵然是瞬间 提交于 2019-12-24 09:19:00
问题 I have a bunch of code that I frequently use which I bundle as a library (.a). Everything was working on my old macbookpro running snow leopard; but I've recently gotten a new laptop, and upgraded to mountain lion -- now I'm having lots of trouble building programs that worked before. At the moment, I'm trying to re-build that library, when I run my makefile, I get the error g++ -g -I/opt/local/include -L/opt/local/lib -M -MT './obj/TB_Numerical.o' TB_Numerical.cpp -MF obj/TB_Numerical.d make

What if accessing a non-existing physical address in X86 system?

拜拜、爱过 提交于 2019-12-24 07:48:36
问题 I am working on a Linux kernel module, which maps a physical address range to a process virtual address space, by playing with process's page tables. Then, I have a question in my head, what will happen if a PTE points to a non-existing physical address? For example, my X86 laptop has 8GB DRAM, and if a PTE has the value of 0x8000000400001227, will the CPU generate some exception for this invalid address accessing? I did a quick a test with that, but there is NOthing unusual happened, and I

use of -mcmodel=kernel flag in x86 platform

≯℡__Kan透↙ 提交于 2019-12-24 07:39:42
问题 I am trying to cross compile a device driver built for x86 architecture to arm platform. It got compiled without any errors, but I dont think whole features are available. So I checked the makefile and found this particular part. ifeq ($(ARCH),x86_64) EXTRA_CFLAGS += -mcmodel=kernel -mno-red-zone This is the only part that depends on architecture it seems. After some time on google, I found that -mcmodel=kernel is for kernel code model and -mno-red-zone is to avoid using red zone in memory

can multiprecision signed multiply be performed with imul instruction?

别等时光非礼了梦想. 提交于 2019-12-24 06:58:46
问题 I am writing a function library to provide all conventional operators and functions for signed-integer types s0128 , s0256 , s0512 , s1024 and floating-point types f0128 , f0256 , f0512 , f1024 . I am writing the s0128 , s0256 , s0512 , s1024 multiply routines now, but am getting erroneous results that confuse me. I assumed I could cascade multiplies with the 64-bit imul rcx instruction (that produces a 128-bit result in rdx:rax ) in the same way I could do the same with unsigned operands

How to determine where this address comes from on 64-bit macOS application

佐手、 提交于 2019-12-24 06:37:17
问题 So I'm currently debugging an issue, and trying to figure out how this could happen. Here is the assembly for a method in the obj-c runtime, called objc_msgsend() libobjc.A.dylib`objc_msgSend: 0x7fff9084a0c0 <+0>: testq %rdi, %rdi 0x7fff9084a0c3 <+3>: je 0x7fff9084a140 ; <+128> 0x7fff9084a0c6 <+6>: testb $0x1, %dil 0x7fff9084a0ca <+10>: jne 0x7fff9084a14b ; <+139> 0x7fff9084a0cd <+13>: movabsq $0x7ffffffffff8, %r11 0x7fff9084a0d7 <+23>: andq (%rdi), %r11 0x7fff9084a0da <+26>: movq %rsi, %r10

How to store array and pointer value inputs in assembly?

余生颓废 提交于 2019-12-24 05:59:55
问题 If a function has input of array and other type of value such as f(arr[],n,&a,&b) Then, how can I store the inputs? If I store them like pushq %rbp movq %rsp, %rbp pushq %rbp Then, what is the address of the inputs? I think 16(rbp)=n 24(rbp)=&a 32(rbp)=&b 40(rbp)... 40(rbp,n,8)=arr. Is it true? 回答1: The main 64-bit ABIs are Microsoft x64 Calling Convention SYS V ABI both use registers for the first four (4) arguments if they are of the class INTEGER . Pointers and integral types are of such

How to get `mov rdx, symbol` to move symbol value and not value at symbol's address in clang intel-syntax?

◇◆丶佛笑我妖孽 提交于 2019-12-24 03:45:10
问题 I have the following code which I'm using with clang on macOS: .intel_syntax noprefix .data hello: .ascii "Hello world\n" hello_len = . - hello .text .globl _main _main: mov rax, 0x2000004 mov rdi, 1 lea rsi, [rip + hello] mov rdx, hello_len # <------- syscall mov rax, 0x2000001 syscall While it looks like it should print "Hello World" and exit, it actually segfaults. It turns out it's because mov rdx, hello_len actually tries to move the value that is at address hello_len , not the value of