nop

Why does GCC on x86-64 insert a NOP inside of a function?

我的未来我决定 提交于 2021-02-07 12:29:19
问题 Given the following C function: void go(char *data) { char name[64]; strcpy(name, data); } GCC 5 and 6 on x86-64 compile (plain gcc -c -g -o followed by objdump ) this to: 0000000000000000 <go>: 0: 55 push %rbp 1: 48 89 e5 mov %rsp,%rbp 4: 48 83 ec 50 sub $0x50,%rsp 8: 48 89 7d b8 mov %rdi,-0x48(%rbp) c: 48 8b 55 b8 mov -0x48(%rbp),%rdx 10: 48 8d 45 c0 lea -0x40(%rbp),%rax 14: 48 89 d6 mov %rdx,%rsi 17: 48 89 c7 mov %rax,%rdi 1a: e8 00 00 00 00 callq 1f <go+0x1f> 1f: 90 nop 20: c9 leaveq 21:

为什么第3个包ack为1?

匆匆过客 提交于 2020-02-21 22:31:02
08:22:27.137358 IP node2.46772 > node1.websm: Flags [S], seq 2005546350, win 14600, options [mss 1460,sackOK,TS val 86899574 ecr 0,nop,wscale 7], length 0 08:22:27.137613 IP node1.websm > node2.46772: Flags [S.], seq 71170429, ack 2005546351, win 14480, options [mss 1460,sackOK,TS val 93251074 ecr 86899574,nop,wscale 6], length 0 08:22:27.137648 IP node2.46772 > node1.websm: Flags [.], ack 1, win 115, options [nop,nop,TS val 86899574 ecr 93251074], length 0 08:22:27.137922 IP node2.46772 > node1.websm: Flags [F.], seq 1, ack 1, win 115, options [nop,nop,TS val 86899575 ecr 93251074], length 0

How to obtain reliable Cortex M4 short delays

蓝咒 提交于 2020-02-06 04:54:34
问题 I am porting some code from an M3 to an M4 which uses 3 NOPs to provide a very short delay between serial output clock changes. The M3 instruction set defines the time for a NOP as 1 cycle. I notice that NOPs in the M4 do not necessarily delay any time at all. I am aware that I will need to disable compiler optimisation but I'm looking for a low level command that will give me reliable, repeatable times. In practice in this particular case the serial is used very occasionally and could be

NopCommerce 多数据库方案

无人久伴 提交于 2020-02-01 23:58:46
本文转自: http://www.cnblogs.com/YUTOUYUWEI/p/5538200.html 有时候一个项目需要连接多个数据库,以实现不同数据库的数据在同个项目的共享。 如果已经安装了nop,则需要在第二个数据库新建一个表,nop现在无法自动通过迁移来实现第二个或者更多数据库,所以这点需要我们手动去操作。 1、在SQLServer新建一个数据库,我这里新建的是TestDb,表为TestTable。 USE [TestDb] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[TestTable]( [Id] [int] IDENTITY(1,1) NOT NULL, [Name] [nvarchar](255) NOT NULL, [CreatedOnUtc] [datetime] NULL, CONSTRAINT [PK_TestTable] PRIMARY KEY CLUSTERED ( [Id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] )

MSF——Payload模块(二)

谁说胖子不能爱 提交于 2019-12-28 02:01:35
MSF系列: MSF——基本使用和Exploit模块(一) MSF——Payload模块(二) MSF——Meterpreter(三) MSF——信息收集(四) 一、exploit和payload exploit是指利用漏洞的一个过程和方法,最终的目的是为了执行payload ,payload才是真正实现我们攻击的代码(获得shell等等) 以缓冲区溢出为例,exploit模块告诉你在寄存器中要填充多少个字符,让寄存器下一条指令执行的代码位置跳转到我们的payload上 在使用exploit时,我们都是用 use 去使用的,在exploit模块中,我们可以 set 调用各种payload 如果我们不想使用exploit,而是直接使用payload,我们也可以直接用 use 使用一个payload 一样可以通过show options查看有哪些参数需要设置 这里的 RHOST是指受害机器只接受某个远程主机来连接它的4444端口(4444是受害机器开放的端口) ,限制了来源IP,我们这里可以不用设置。但是如果被其他人扫到这个端口,他们也可以连接上去获得shell。 二、直接使用payload 一般我们是在exploit中调用payload,如果想直接使用payload,可以使用 generate 命令来生成payload。 如下图所示

Processor Instruction Cycle Execution Time

佐手、 提交于 2019-12-18 16:55:56
问题 My guess is that the __no_operation() intrinsic (ARM) instruction should take 1/(168 MHz) to execute, provided that each NOP executes in one clock cycle, which I would like to verify via documentation. Is there a standard location for information regarding the instruction cycle execution time for a processor? I am trying to determine how long an STM32f407IGh6 processor should take to execute a NOP instruction running at 168 MHz. Some processors require multiple oscillations per instruction

GCC NOPs being compiled away

眉间皱痕 提交于 2019-12-14 04:18:24
问题 Venturing out of my usual VC++ realm into the world of GCC (via MINGW32). Trying to create a Windows PE that consists largely of NOPs, ala: for(i = 0; i < 1000; i++) { asm("nop"); } But either I'm using the wrong syntax or the compiler is optimising through them because those NOPs don't survive the compilation process. I'm using the -O0 flag, otherwise defaults. Any ideas on how I can coax the compiler into leaving the NOPs intact? 回答1: Are you expecting it to unroll the loop in to 1000 nop s

Dummy command in windows cmd

余生长醉 提交于 2019-12-10 12:40:08
问题 In linux we have a makefile: $(foreach A,a b,echo $(A) &&) true It works and echos a b Now we want to port it to Windows. The shortest command I've found for Windows that does nothing: if 0==1 0 So the makefile example will look like $(foreach A,a b,echo $(A) &&) if 0==1 0 Is there any dummy command in Windows in box (that really does nothing)? Or any nice hack? 回答1: The rem command does nothing. 回答2: The call command without any argument does nothing and has no collateral effect as rem has.

一次关于tcpdump的使用心得

和自甴很熟 提交于 2019-12-09 13:34:24
一次关于tcpdump的使用心得 公司出现我们service 错误,我之前一直是用wireshark 比较多的。 但是linux 只有tcpdump,于是我就使用tcpdump 我们的user-service是8810,于是我输入 sudo tcpdump -vv -i eth1 src port 8810||dst port 8810 tcp -i 是网卡 src port 是源端口 dst port 是目的端口 但是这时候没有数据 于是我又加了-A sudo tcpdump -A -vv -i eth1 src port 8810||dst port 8810 tcp 出现了数据 12:40:09.764585 IP (tos 0x0, ttl 64, id 61424, offset 0, flags [DF], proto TCP (6), length 148) testvm-102.8810 > 192.168.255.101.52028: Flags [P.], cksum 0x80a4 (incorrect -> 0x5c44), seq 2707:2803, ack 647, win 294, options [nop,nop,TS val 181844277 ecr 2681762457], length 96 E.....@.@..U...f...e"j.<]

Why does gcc output machine code have nop instructions

。_饼干妹妹 提交于 2019-12-08 14:50:33
问题 Everytime I do an objdump -d I always see the asm code with batches of nop instructions (instructions that do nothing) For example take this same program: #include <stdio.h> #include <math.h> int main() { printf("Hello World!\n"); printf("cos: %f\n", cos(1)); return 1; } The objdump for exampe has 2 nops at the end of the entry point 0000000000400450 <_start>: 400450: 31 ed xor %ebp,%ebp 400452: 49 89 d1 mov %rdx,%r9 400455: 5e pop %rsi 400456: 48 89 e2 mov %rsp,%rdx 400459: 48 83 e4 f0 and