freebsd-skq/usr.sbin
wpaul 07b632956a Add support for Windows/x86-64 binaries to Project Evil.
Ville-Pertti Keinonen (will at exomi dot comohmygodnospampleasekthx)
deserves a big thanks for submitting initial patches to make it
work. I have mangled his contributions appropriately.

The main gotcha with Windows/x86-64 is that Microsoft uses a different
calling convention than everyone else. The standard ABI requires using
6 registers for argument passing, with other arguments on the stack.
Microsoft uses only 4 registers, and requires the caller to leave room
on the stack for the register arguments incase the callee needs to
spill them. Unlike x86, where Microsoft uses a mix of _cdecl, _stdcall
and _fastcall, all routines on Windows/x86-64 uses the same convention.
This unfortunately means that all the functions we export to the
driver require an intermediate translation wrapper. Similarly, we have
to wrap all calls back into the driver binary itself.

The original patches provided macros to wrap every single routine at
compile time, providing a secondary jump table with a customized
wrapper for each exported routine. I decided to use a different approach:
the call wrapper for each function is created from a template at
runtime, and the routine to jump to is patched into the wrapper as
it is created. The subr_pe module has been modified to patch in the
wrapped function instead of the original. (On x86, the wrapping
routine is a no-op.)

There are some minor API differences that had to be accounted for:

- KeAcquireSpinLock() is a real function on amd64, not a macro wrapper
  around KfAcquireSpinLock()
- NdisFreeBuffer() is actually IoFreeMdl(). I had to change the whole
  NDIS_BUFFER API a bit to accomodate this.

Bugs fixed along the way:
- IoAllocateMdl() always returned NULL
- kern_windrv.c:windrv_unload() wasn't releasing private driver object
  extensions correctly (found thanks to memguard)

This has only been tested with the driver for the Broadcom 802.11g
chipset, which was the only Windows/x86-64 driver I could find.
2005-02-16 05:41:18 +00:00
..
ac Sort sections. 2005-01-18 20:02:45 +00:00
accton
acpi Note addition of MCFG support. 2005-02-14 16:32:32 +00:00
adduser In fullpath_from_shell(), move the nologin detection before the cat | while 2004-09-23 13:09:42 +00:00
amd Add knob NO_NIS (fka NO_YP_LIBC) and make world compileable when set. 2004-11-13 20:40:32 +00:00
ancontrol Expand *n't contractions. 2005-02-13 22:25:33 +00:00
apm Expand *n't contractions. 2005-02-13 22:25:33 +00:00
apmd Expand *n't contractions. 2005-02-13 22:25:33 +00:00
arlcontrol Use CFLAGS+=. 2005-02-09 10:35:28 +00:00
arp o Reorganize the previous delta to make it more style(9) compliant. 2005-01-24 17:01:48 +00:00
asf Sort sections. 2005-01-18 20:02:45 +00:00
atm Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
authpf
bluetooth Let bsd.prog.mk set SRCS and MAN to their default values. 2005-01-28 16:08:11 +00:00
boot0cfg Sort sections. 2005-01-18 20:02:45 +00:00
boot98cfg Sort sections. 2005-01-18 20:02:45 +00:00
bootparamd Pass -C to rpcgen. 2005-02-09 12:17:52 +00:00
bsnmpd who's -> whose 2005-02-13 23:23:30 +00:00
btxld Sort sections. 2005-01-18 20:02:45 +00:00
burncd Sort sections. 2005-01-18 20:02:45 +00:00
cdcontrol Sort sections. 2005-01-18 20:02:45 +00:00
chkgrp Sort sections. 2005-01-18 20:02:45 +00:00
chown Expand *n't contractions. 2005-02-13 22:25:33 +00:00
chroot
ckdist Sort sections. 2005-01-18 20:02:45 +00:00
config Bump the version number for the addition of devices / nodevices. 2005-02-10 15:16:25 +00:00
cron Fix parsing of '0' and non-alphanumerics in steps. Previously, an 2005-02-14 14:09:21 +00:00
crunch In crunchgen(1), when calling make(1), don't redirect stderr to stdout, 2005-01-20 10:49:03 +00:00
ctm Expand *n't contractions. 2005-02-13 22:25:33 +00:00
daemon Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
dconschat Remove unnecessary SRCS= where could be guessed directly by our 2005-01-27 14:52:47 +00:00
devinfo
digictl Sort sections. 2005-01-18 20:02:45 +00:00
diskinfo Sort sections. 2005-01-18 20:02:45 +00:00
dnssec-keygen Don't expose BIND libraries and their headers to the public by default, 2004-09-24 13:42:00 +00:00
dnssec-signzone Don't expose BIND libraries and their headers to the public by default, 2004-09-24 13:42:00 +00:00
editmap
edquota Sort sections. 2005-01-18 20:02:45 +00:00
eeprom Scheduled mdoc(7) sweep. 2005-01-11 11:47:22 +00:00
elf2exe Sort sections. 2005-01-18 20:02:45 +00:00
extattr
extattrctl Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
faithd Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
fdcontrol Cleanup usr.sbin/fd* so they can compile under WARNS=6. 2005-01-08 15:46:06 +00:00
fdformat One of the DIAGNOSTICS sections should be EXIT STATUS. 2005-01-18 09:17:49 +00:00
fdread Expand *n't contractions. 2005-02-13 22:25:33 +00:00
fdwrite Expand *n't contractions. 2005-02-13 22:25:33 +00:00
flowctl Remove code, inherited from ipacctctl, which sets socket to non-blocking 2005-02-06 14:00:57 +00:00
fwcontrol Sort sections. 2005-01-18 20:02:45 +00:00
getfmac Remove unnecessary SRCS= where could be guessed directly by our 2005-01-27 14:52:47 +00:00
getpmac Remove unnecessary SRCS= where could be guessed directly by our 2005-01-27 14:52:47 +00:00
gstat Remove unnecessary SRCS= where could be guessed directly by our 2005-01-27 14:52:47 +00:00
i4b Fixed xrefs. 2005-01-21 10:35:40 +00:00
ifmcstat Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
inetd Prefer C99's __func__ over GCC's __FUNCTION__. 2004-09-26 13:47:25 +00:00
iostat Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ip6addrctl Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
ipftest
ipresend
ipsend
iptest
IPXrouted
jail Add a new sysctl, "security.jail.chflags_allowed", which controls the 2005-02-08 21:31:11 +00:00
jexec
jls
kbdcontrol Sort sections. 2005-01-18 20:02:45 +00:00
kbdmap Let bsd.prog.mk set SRCS and MAN to their default values. 2005-01-28 16:08:11 +00:00
kernbb
keyserv The variable `ROOTKEY' has internal linkage in keyserv.c, don't declare it as 2005-02-10 09:09:18 +00:00
kgmon Sort sections. 2005-01-18 20:02:45 +00:00
kgzip Sort sections. 2005-01-18 20:02:45 +00:00
kldxref Explicitly pass in the relocation base and data offset into ef_reloc() 2004-08-28 19:31:10 +00:00
lastlogin
lpr Be more careful when doing el_parse() - only do it when el is 2005-02-15 10:23:01 +00:00
lptcontrol Remove useless mode argument to open(). 2005-01-25 14:25:18 +00:00
mailstats
mailwrapper Replaced afterinstall: with FILES. 2004-10-18 17:20:29 +00:00
makemap
manctl
memcontrol WARNS=6 cleanup. This includes: 2005-01-07 12:06:30 +00:00
mergemaster Expand contractions. 2005-02-13 23:45:54 +00:00
mixer
mld6query Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
mlxcontrol Sort sections. 2005-01-18 20:02:45 +00:00
mount_nwfs Expand *n't contractions. 2005-02-13 22:25:33 +00:00
mount_portalfs
mount_smbfs NOSHARED -> NO_SHARED 2004-12-21 09:59:45 +00:00
mountd Sort sections. 2005-01-18 20:02:45 +00:00
moused Sort sections. 2005-01-18 20:02:45 +00:00
mptable Expand *n't contractions. 2005-02-13 22:25:33 +00:00
mrouted Expand contractions. 2005-02-15 09:27:00 +00:00
mtest
mtree Expand *n't contractions. 2005-02-13 22:25:33 +00:00
named Previously I thought I was seeing a failure to install the .5 man pages 2004-09-27 03:55:03 +00:00
named-checkconf Fix up the man file installation for the new BIND 9 sources: 2004-09-26 06:36:11 +00:00
named-checkzone Don't expose BIND libraries and their headers to the public by default, 2004-09-24 13:42:00 +00:00
named.reload Switch from BIND 8 to BIND 9. 2004-09-21 19:01:48 +00:00
ndiscvt Add support for Windows/x86-64 binaries to Project Evil. 2005-02-16 05:41:18 +00:00
ndp Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
newsyslog Expand *n't contractions. 2005-02-13 22:25:33 +00:00
nfsd Bump the default maximum on nfsd processes from 20 to 256. Real-world 2005-01-23 21:34:00 +00:00
ngctl - Reduce the number of netgraph messages when listing 2005-02-09 16:17:33 +00:00
nghook Sort sections. 2005-01-18 20:02:45 +00:00
nologin Use __unused macro instead of a bare void for main(). 2005-01-04 20:07:12 +00:00
ntp Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ofwdump
pccard Expand *n't contractions. 2005-02-13 22:25:33 +00:00
pciconf
pcvt Expand contractions. 2005-02-13 23:45:54 +00:00
periodic Sort sections. 2005-01-18 20:02:45 +00:00
pkg_install Expand contractions. 2005-02-13 23:45:54 +00:00
pnpinfo Remove unnecessary SRCS= where could be guessed directly by our 2005-01-27 14:52:47 +00:00
ppp Be concerned about huge callback numbers by truncating them rather than 2005-02-15 10:59:54 +00:00
pppctl Expand *n't contractions. 2005-02-13 22:25:33 +00:00
pppd NOCRYPT -> NO_CRYPT 2004-12-21 10:16:04 +00:00
pppstats
praliases
procctl
pstat Sort sections. 2005-01-18 20:02:45 +00:00
pw The variable `arglist' has internal linkage in pw.c, don't declare it as extern 2005-02-10 09:05:27 +00:00
pwd_mkdb Turn K&R functions into prototypes. 2005-02-10 09:00:55 +00:00
quot Sort sections. 2005-01-18 20:02:45 +00:00
quotaon
rarpd Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
raycontrol Expand *n't contractions. 2005-02-13 22:25:33 +00:00
repquota Sort sections. 2005-01-18 20:02:45 +00:00
rip6query Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
rmt Sort sections. 2005-01-18 20:02:45 +00:00
rndc Previously I thought I was seeing a failure to install the .5 man pages 2004-09-27 03:55:03 +00:00
rndc-confgen Fix up the man file installation for the new BIND 9 sources: 2004-09-26 06:36:11 +00:00
route6d Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
rpc.lockd Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
rpc.statd Sort sections. 2005-01-18 20:02:45 +00:00
rpc.umntall Expand *n't contractions. 2005-02-13 22:25:33 +00:00
rpc.yppasswdd Expand contractions. 2005-02-13 23:45:54 +00:00
rpc.ypupdated Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
rpc.ypxfrd Expand *n't contractions. 2005-02-13 22:25:33 +00:00
rpcbind Sort sections. 2005-01-18 20:02:45 +00:00
rrenumd Expand contractions. 2005-02-15 09:27:00 +00:00
rtadvd Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
rtprio Sort sections. 2005-01-18 20:02:45 +00:00
rtsold Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
rwhod Fix most cases where the address of an int is passed to a function expecting a 2005-02-14 17:42:58 +00:00
sa Expand contractions. 2005-02-13 23:45:54 +00:00
sade Expand contractions. 2005-02-13 23:45:54 +00:00
sendmail NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
setfmac Remove unnecessary SRCS= where could be guessed directly by our 2005-01-27 14:52:47 +00:00
setkey Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
setpmac Remove unnecessary SRCS= where could be guessed directly by our 2005-01-27 14:52:47 +00:00
sicontrol Get debugging macros from sivar.h 2004-10-02 18:51:37 +00:00
sliplogin Sort sections. 2005-01-18 20:02:45 +00:00
slstat
smbmsg Sort sections. 2005-01-18 20:02:45 +00:00
spkrtest
spray
sysinstall Expand contractions. 2005-02-13 23:45:54 +00:00
syslogd Expand contractions. 2005-02-13 23:45:54 +00:00
tcpdchk NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
tcpdmatch NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
tcpdrop o Add handling of an IPv4-mapped IPv6 address. 2005-02-14 07:37:51 +00:00
tcpdump NOINET6 -> NO_INET6 2004-12-21 10:49:29 +00:00
timed Sort sections. 2005-01-18 20:02:45 +00:00
traceroute NOIPSEC -> TRACEROUTE_NO_IPSEC 2004-12-21 12:44:20 +00:00
traceroute6 Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
trpt Expand *n't contractions. 2005-02-13 22:25:33 +00:00
tzsetup Sort sections. 2005-01-18 20:02:45 +00:00
ugidfw Add prototypes and remove unused variables for WARNS=6 compliance. Add 2005-01-16 10:49:48 +00:00
usbd Sort sections. 2005-01-18 20:02:45 +00:00
usbdevs
vidcontrol WANRS=6 cleanup for vidcontrol(1): 2005-01-13 03:59:44 +00:00
vipw
vnconfig Start the dreaded NOFOO -> NO_FOO conversion. 2004-12-21 08:47:35 +00:00
watch Sort sections. 2005-01-18 20:02:45 +00:00
watchdogd Sort sections. 2005-01-18 20:02:45 +00:00
wicontrol Expand *n't contractions. 2005-02-13 22:25:33 +00:00
wlconfig
yp_mkdb Expand *n't contractions. 2005-02-13 22:25:33 +00:00
ypbind Expand *n't contractions. 2005-02-13 22:25:33 +00:00
yppoll
yppush Sort sections. 2005-01-18 20:02:45 +00:00
ypserv Expand contractions. 2005-02-13 23:45:54 +00:00
ypset Remove definition of struct dom_binding, it's non-standard C code and 2004-10-17 19:33:33 +00:00
zic Expand contractions. 2005-02-13 23:45:54 +00:00
zzz
Makefile o Implement net.inet.tcp.drop sysctl and userland part, tcpdrop(8) 2005-02-06 10:47:12 +00:00
Makefile.inc