dos

What is the at sign (@) in a batch file and what does it do?

流过昼夜 提交于 2019-12-28 08:03:28
问题 One remotely familiar with windows/dos batch scripting will recognize this line: @echo off For many-many days, I was happy with the sentiment that the @ is how echo off is meant to be written at the top of the batch and that's it. However, recently I've came accross a line like this: @php foo bar and another line like this: @call \\network\folder\batch.bat This reinforced my suspicion that @ has more to it than just echo mode switching. However @ is not listed in the Windows XP: Command-line

DOS BAT file equivalent to Unix basename command?

廉价感情. 提交于 2019-12-28 05:35:56
问题 Is there an easy way to get to the basename (file name without extension) of a DOS file name using the DOS BAT command language? I agree: format c:\ is probably a good start, followed by a bootable Linux CD (assuming these antique machines have a CD reader - not a given). But let's pretend that we only have DOS... (That means: not Windows - not even Windows 3.1, let alone Windows 95, 98, NT, ME, XP, Vista, 7, etc.) 回答1: For command-line for /F %i in ("c:\foo\bar.txt") do @echo %~ni output:

System() calls in C++ and their roles in programming

家住魔仙堡 提交于 2019-12-28 04:04:34
问题 I've often heard that using system("PAUSE") is bad practice and to use std::cin.get() instead. Now my understanding of system calls is that they take a string which they enter into a system command line and talk with the OS, so PAUSE is a DOS command that pauses the output in the command window. I assume this works similarly with Mac and unix with different keywords, and using system calls is discouraged because of a lack of cross OS compatibility. (If I'm wrong with any of this, please

Is this code correct (Number plus number, then print the result)

◇◆丶佛笑我妖孽 提交于 2019-12-28 02:18:17
问题 I want to do something simple in assembly language. addition two numbers, and print the result on the screen. I did that code: .Model SMALL .Stack 100h .Code start: MOV ax, 10 ADD ax, 5 MOV ah, 02h INT 21h MOV ah, 01h INT 21h MOV ah, 4ch INT 21h end start After compile the code without any error, tells me a strange character . Modified: MOV dl, 10 ADD al,5 MOV dl, al MOV ah,02h INT 21h but still print a strange character I don't know what can I do to print number on the screen 回答1: Yes, you

DOS命令操作

你。 提交于 2019-12-27 17:49:12
文件复制 命令 ——copy 类型:内部 命令 格式:COPY <源文件> [目标文件] 说明: 1.源文件指定想要复制的文件来自哪里——[盘符1:][路径1][文件名1] 2.目标文件指定文件拷贝到何方——[盘符2:][路径2][文件名2] 3.如缺省盘符则为当前盘符;路径若为当前目录可缺省路径. 4.源文件名不能缺省,目标文件名缺省时表示拷贝后不改变文件名. 举例: 1.将A盘的PC.EXE拷贝到C盘的DOS目录下,文件名不变. 键入 COPY C :\123.TX T WINDOWS ;省略目标盘符与文件名. 屏幕显示反馈信息:一个文件被拷贝. 2.将C:\ WINDOWS 目录中的文件A.TXT拷贝到D盘的,将改名为B.TXT. C:\>COPY \ WINDOWS \A.TXT D:\B.TXT 3.将C:\ WINDOWS 目录中的所有.SYS文件拷贝到D盘的123目录下. C:\ WINDOWS >COPY *.SYS D :\123 4.由键盘输入建立新文件, 命令 格式为:COPY CON <文件名> 例:用COPY CON 命令 在C盘的BE目录下建立一个名为ABC.TXT的文件,文件内容为: I am glad to meet you. I am glad to meet you,too. 操作步骤如下: 输入内容,每一行最后回车,最后一行输入Ctrl

Jumping back 1000 lines

痞子三分冷 提交于 2019-12-27 04:48:43
问题 I was trying to make a code, that when you're at the very end, it will ask you if you want to try again. If you press 'y', then it will jump back a 1000 lines, right at the beginning of the program. Well obviously, it didn't work out, as I got the error "jump relative out of range". So I made jumps every 50 lines, having a total of 20 jumps, like start: . s20: jmp start . . . s2: jmp s3 . s1: jmp s2 . jmp s1 Now after doing that, I ran the program, and when I pressed 'y', TASM kind of froze.

Jumping back 1000 lines

爱⌒轻易说出口 提交于 2019-12-27 04:48:05
问题 I was trying to make a code, that when you're at the very end, it will ask you if you want to try again. If you press 'y', then it will jump back a 1000 lines, right at the beginning of the program. Well obviously, it didn't work out, as I got the error "jump relative out of range". So I made jumps every 50 lines, having a total of 20 jumps, like start: . s20: jmp start . . . s2: jmp s3 . s1: jmp s2 . jmp s1 Now after doing that, I ran the program, and when I pressed 'y', TASM kind of froze.

Dos攻击和校网渗透

依然范特西╮ 提交于 2019-12-26 15:48:13
为了证明我还活着,话不多说 Dos攻击脚本(这是一个sockstrees Dos脚本) 1 #-*- coding:utf-8 -*- 2 from scapy.all import * 3 from time import sleep 4 import thread 5 import logging 6 import os 7 import signal 8 import sys 9 10 from scapy.layers.inet import IP,TCP 11 12 logging.getLogger("scapy.runtime").setLevel(logging.ERROR) 13 14 if len(sys.argv) != 4: 15 print("用法: ./sock_stress.py [目标IP] [端口] [线程数]") 16 print("举例: ./scok_stress.py [1.1.1.1] 20 ##攻击端口处于开放状态") 17 sys.exit() 18 19 target = str(sys.argv[1]) 20 dstport = int(sys.argv[2]) 21 threads = int(sys.argv[3]) 22 23 ##攻击函数 24 def sock_stress(target,dstport): 25

PE文件结构

こ雲淡風輕ζ 提交于 2019-12-26 11:22:36
PE,即移植的执行体。在Windows平台下,所有的可执行文件(包括EXE文件、DLL文件、SYS文件、COM文件)均使用PE文件结构。使用PE文件结构的可执行文件也成为PE文件。Windows系统下的可执行文件中包含着各种数据,包括代码、数据、资源等。虽然windows系统下的可执行文件包含如此众多的类型数据,但其存放都是有序的、结构化的、完全依赖于PE文件结构对各种数据的管理。 1.MZ头部是真正的DOS头部,其开始的两个字节为"MZ",该部分用于程序在DOS系统下的加载,它的结构被定义为IMAGE_DOS_HEADER,DOS头是为了该可执行程序可以兼容DOS系统。通常情况下,Win32的PE程序不能在DOS下运行,因此保留了这样一个简单的DOS程序用于提醒:不能运行于DOS程序下。 (1)struct IMAGE_DOS_HEADER{ WORD e_magic //这两个字节保存"MZ" ........... ........... //中间的成员不常用省略 LONG e_lfanew //这是最后一个成员 保存PE头部的位置 2.PE头保存着Windows系统加载可执行文件的重要信息。PE头部有IMAGE_NT_HEADERS(包含PE标识符,文件头IMAGE_FILE_HEADER、可选头IMAGE_OPTIONAL_HEADER。)定义

Windows Command line get date

ε祈祈猫儿з 提交于 2019-12-25 18:42:17
问题 I have to execute a program.exe that generate me reports for a range of dates, I call the program.exe in a command line but i have to set two argument ( current date and current_date-6days ) when I call it : c:\program.exe current_date current_date-6 (date before 6 days) i found that this command gives me the current date : 28-06-2013 %date:~0,2%-%date:~-7,2%-%date:~-4,4% but I can't get the current_date -6 (means the date 6 days before) i have also to let the user choose the range of date he