English 中文(简体)
链接窗口档案x86_64 C++
原标题:linking .s files in windows x86_64 C++

I m 能够将我的轴心-x86_64.s连接起来,精干,但无法在窗子里使用cl,或从TDM中ld或ld。

装配文档具有AES_cbc_encodeion/decodeion from opensl的功能。 我不想使用其图书馆。 我只是想把它联系起来。 或者,我用手稿将档案转换成手法。

https://github.com/ opensl/opensl/blob/master/codeo/perlasm/x86_64-xlate.pl

当你建造露天灯时,该双管便服用,它基本上产生代号——x86_64.,然后被装成校正。 形成一个马质版本的问题在于,它增加了<条码>.notes.gnu.properties SEGMENT,在我称之为AES_set_ensecurity_key时,我最后删除并汇编了这些文本,但我的文体方案只是做了适当的工作。 我认为我正确地指出了这一点。 这里是男性方案

.data
ks DQ 32 DUP(0)                 ; used for aes_key struct = 60 ints = 240 bytes + int rounds = 244 bytes but rounded off to 256 anyway
OPENSSL_ia32cap_P DQ 2 DUP (0)   ; unsigned int OPENSSL_ia32cap_P[4];

key db 0E0h,0E6h,00Ch,086h,0F1h,010h,0F5h,03Ah,04Eh,065h,088h,079h,074h,0B1h,04Eh,03Dh,006h,022h,09Dh,0B9h,04Eh,026h,025h,0BEh,0D1h,018h,02Bh,056h,073h,0ABh,044h,0F3h,0

.code
include aes-x86_64.asm
externdef ExitProcess:proc


main proc

    sub rsp, 28h                    ;reserve stack space for called functions
    and rsp, 0fffffffffffffff0h     ;make sure stack 16-byte aligned 


    ; AES_set_encrypt_key(key, 256, &ks);
    xor rdx, rdx
    lea r8, ks
    mov rdx, 256
    lea rcx, key
    sub rsp, 20h
    call AES_set_encrypt_key

    exit:
    sub rsp, 20h
    call ExitProcess

main endp

end

the script is too long to paste here but here it is: this is the converted format with the masm syntax. the original is GAS

https://pastebin.pl/view/raw/c8b99bd8

i m 不能确定这一MASM syntax是否正确,而是汇编罚款,但只有删除其最后一部分时,才会这样做:

.text$  ENDS
".note.gnu.property"    SEGMENT

    DD  1f - 0f
    DD  4f - 1f
    DD  5
0::


DB  047h
DB  04eh
DB  055h
DB  0
1::

    DD  0c0000002h
    DD  3f - 2f
2::
    DD  3
3::

4::

".note.gnu.property"    ENDS

该职能未能恢复-1。 页: 1

最佳回答

由于所发表的评论意见,联系已经解决,但该守则并不发挥作用,因为整个GAS档案都是为支线撰写的。 我假定这是通用的,但在64轨道上,由于召集公约,不可能做到这一点。 因此,我想测试一下,如果在32个轨道上,它会发挥作用,因为无论制度如何,该守则都不受任何要求公约的约束,因为争论被推向了。

我用这个日子撰写了32秒的GAS方案,文件有32秒钟。 当我看到工作时,我把工作转移到窗户上,然后工作。 如果我想要,但最后我想在64个轨道上制定,那么我可以采用32个轨道方案,这样,我就不得不将守则转换为MASM。 我只得写上它接受在呼吁公约的窗口中的论点。

问题回答

法典的转换似乎有些错误。 <代码>_x86_64_AES_set_encode_key 标识为@abi-omnipotent 因此,它不应添加“窗口”的序号,但在你过去,我们可以清楚地看到:

_x86_64_AES_set_encrypt_key PROC PRIVATE
 mov QWORD PTR[8+rsp],rdi ;WIN64 prologue
 mov QWORD PTR[16+rsp],rsi
 mov rax,rsp
$L$SEH_begin__x86_64_AES_set_encrypt_key::
 mov rdi,rcx
 mov rsi,rdx
 mov rdx,r8
 mov rcx,r9
 mov r8,QWORD PTR[40+rsp]
 mov r9,QWORD PTR[48+rsp]

This piece of code incorrectly tries to move the arguments around from the windows convention to the sysv but that has already been done by the wrapper AES_set_encrypt_key.





相关问题
List of suspected Malicious patterns

I am doing an anti-virus project by disassembling its code and analyzing it. So I want a list of the Suspected Malicious pattern codes, so I can observe which is suspected and which is not? So I want ...

Prefetch for Intel Core 2 Duo

Has anyone had experience using prefetch instructions for the Core 2 Duo processor? I ve been using the (standard?) prefetch set (prefetchnta, prefetcht1, etc) with success for a series of P4 ...

How are mutex and lock structures implemented?

I understand the concept of locks, mutex and other synchronization structures, but how are they implemented? Are they provided by the OS, or are these structures dependent on special CPU instructions ...

Installing GNU Assembler in OSX

No matter how hard I google, I can t seem to find a (relatively) easy-to-follow instruction on how to install the GNU Assembler on a mac. I know I can use gcc -c (Apple Clang on a Mac) to assemble .s ...

8086 assembler,INT 16,2

I got stuck at this thing,I want to see if right shift button has been pressed,so I have this assambler code: mov ah,2 int 16h ;calling INT 16,2 - Read Keyboard Flags interrupt mov ah,...

Translate a FOR to assembler

I need to translate what is commented within the method, to assembler. I have a roughly idea, but can t. Anyone can help me please? Is for an Intel x32 architecture: int secuencia ( int n, ...

热门标签