PackETH: ethernet packet generator
It can generate any raw packet.
Download from:
http://packeth.sourceforge.net/
http://sourceforge.net/projects/packeth/
The default file is for Windows, and Linux version need to Click on Browser all link
Install:
cd to packet directory
./configure
make
sudo make install
Usage:
Run it as root
Define packet header, payload, and interface, and click send
Monday, June 25, 2012
Friday, June 8, 2012
How to Limit the Amount of Memory Available to OS
Linux:
set the mem=2000m as the boot arguments, then the Linux only use first 2000MB memory. If the total RAM is 2G, it reserves 48MB.
http://fengweizhang.blogspot.com/2012/06/boot-arguments-on-linux.html
Windows:
Add line
MaxPhyPage=0x7D000
at [386enh] section of C:\WINDOWS\system.ini
0x7D000 * 4KB = 2000MB
http://support.microsoft.com/kb/181862
set the mem=2000m as the boot arguments, then the Linux only use first 2000MB memory. If the total RAM is 2G, it reserves 48MB.
http://fengweizhang.blogspot.com/2012/06/boot-arguments-on-linux.html
Windows:
Add line
MaxPhyPage=0x7D000
at [386enh] section of C:\WINDOWS\system.ini
0x7D000 * 4KB = 2000MB
http://support.microsoft.com/kb/181862
Boot Arguments on Linux
http://tldp.org/HOWTO/BootPrompt-HOWTO-3.html
The next (and hardly used) purpose is to specify
The original BIOS call defined in the PC specification that returns the amount of installed memory was only designed to be able to report up to 64MB. (Yes, another lack of foresight, just like the 1024 cylinder disks... sigh.) Linux uses this BIOS call at boot to determine how much memory is installed. A newer specification (e820) allows the BIOS to get this right on most machines nowadays. If you have more than 64MB of RAM installed on an older machine, you can use this boot argument to tell Linux how much memory you have. Here is a quote from Linus on the usage of the
``The kernel will accept any `mem=xx' parameter you give it, and if it turns out that you lied to it, it will crash horribly sooner or later. The parameter indicates the highest addressable RAM address, so `mem=0x1000000' means you have 16MB of memory, for example. For a 96MB machine this would be `mem=0x6000000'. If you tell Linux that it has more memory than it actually does have, bad things will happen: maybe not at once, but surely eventually.''
Note that the argument does not have to be in hex, and the suffixes `k' and `M' (case insensitive) can be used to specify kilobytes and Megabytes, respectively. (A `k' will cause a 10 bit shift on your value, and a `M' will cause a 20 bit shift.) A typical example for a 128MB machine would be "
In some cases, the memory reported via e820 can also be wrong, and so the
for a 1GB machine with the usual 384k of ISA memory mapped I/O space excluded from use.
The `mem=' Argument
This argument has several purposes: The original purpose was to specify the amount of installed memory (or a value less than that if you wanted to limit the amount of memory available to linux).The next (and hardly used) purpose is to specify
mem=nopentium which tells the Linux kernel to not use the 4MB page table performance feature. If you want to use it for both purposes, use a separate mem= for each one.The original BIOS call defined in the PC specification that returns the amount of installed memory was only designed to be able to report up to 64MB. (Yes, another lack of foresight, just like the 1024 cylinder disks... sigh.) Linux uses this BIOS call at boot to determine how much memory is installed. A newer specification (e820) allows the BIOS to get this right on most machines nowadays. If you have more than 64MB of RAM installed on an older machine, you can use this boot argument to tell Linux how much memory you have. Here is a quote from Linus on the usage of the
mem= parameter.``The kernel will accept any `mem=xx' parameter you give it, and if it turns out that you lied to it, it will crash horribly sooner or later. The parameter indicates the highest addressable RAM address, so `mem=0x1000000' means you have 16MB of memory, for example. For a 96MB machine this would be `mem=0x6000000'. If you tell Linux that it has more memory than it actually does have, bad things will happen: maybe not at once, but surely eventually.''
Note that the argument does not have to be in hex, and the suffixes `k' and `M' (case insensitive) can be used to specify kilobytes and Megabytes, respectively. (A `k' will cause a 10 bit shift on your value, and a `M' will cause a 20 bit shift.) A typical example for a 128MB machine would be "
mem=128m".In some cases, the memory reported via e820 can also be wrong, and so the
mem=exactmap was added. You use this in conjunction with specifying an exact memory map, such as:mem=exactmap mem=640K@0 mem=1023M@1M
for a 1GB machine with the usual 384k of ISA memory mapped I/O space excluded from use.
Friday, May 18, 2012
Backup by using rsync in Linux and Windows
In Linux: man rsync
rsync -r ../WorkSpace username@servername:/home/username/backup-machine
rsync -r ../WorkSpace username@servername:/home/username/backup-machine
In Windows, you can use cygwin
1. Install cygwin
2. search rsync, and install rsync package
3. run rsync
rsync -r /cygdrive/c username@servername:/home/username/back-windows
Modify Executable in Windows
1. Download Hex Editor: HxD
http://download.cnet.com/HxD-Hex-Editor/3000-2352_4-10891068.html
2. Open the Executable by using HxD
3. Go the executable place you want to modify
For example (nasm format) :
66 BA 2F 05 : mov dx, 0x52f
66 EE : out dx, al
http://download.cnet.com/HxD-Hex-Editor/3000-2352_4-10891068.html
2. Open the Executable by using HxD
3. Go the executable place you want to modify
For example (nasm format) :
66 BA 2F 05 : mov dx, 0x52f
66 EE : out dx, al
Thursday, May 17, 2012
Assembly in Windows
1. Compiler: MASM
download: http://www.masm32.com/
install it
it has an masm editor
it use NASM assembly, please use pcasm for reference
http://www.drpaulcarter.com/pcasm/
But it doesn't have the IO instruction in the book
2. Start with hello world program
include \masm32\include\masm32rt.inc
.data
MyTitle db "ASM is Fun!",0
MyText db "I hope you're learning!",0
.codestart:
push 0
push offset MyTitle
push offset MyTextpush 0
call MessageBoxA
call ExitProcess
end start
URL: http://computertech.createmybb3.com/showthread.php?tid=105
http://www.youtube.com/watch?v=gklpZIVuTBY
3. Write your own program
.386
.model flat,stdcall
.code
start
mov dx, 1327
out dx, ax
end start
This program write port 0x52f It looks like MASM cannot use hex because I get compile error.
4. Run the Program
AllowIo.exe WritePort.exe /a
write to port in Windows, please see my another article
http://fengweizhang.blogspot.com/2012/04/user-program-write-to-io-ports-on.html
download: http://www.masm32.com/
install it
it has an masm editor
it use NASM assembly, please use pcasm for reference
http://www.drpaulcarter.com/pcasm/
But it doesn't have the IO instruction in the book
2. Start with hello world program
include \masm32\include\masm32rt.inc
.data
MyTitle db "ASM is Fun!",0
MyText db "I hope you're learning!",0
.codestart:
push 0
push offset MyTitle
push offset MyTextpush 0
call MessageBoxA
call ExitProcess
end start
URL: http://computertech.createmybb3.com/showthread.php?tid=105
http://www.youtube.com/watch?v=gklpZIVuTBY
3. Write your own program
.386
.model flat,stdcall
.code
start
mov dx, 1327
out dx, ax
end start
This program write port 0x52f It looks like MASM cannot use hex because I get compile error.
4. Run the Program
AllowIo.exe WritePort.exe /a
write to port in Windows, please see my another article
http://fengweizhang.blogspot.com/2012/04/user-program-write-to-io-ports-on.html
Subscribe to:
Posts (Atom)