Code Sample |
Tree: Directory of . 12/23/2004 09:33 AM 122 autorun.inf 12/23/2004 10:22 AM <DIR> isolinux 12/23/2004 09:29 AM <DIR> KNOPPIX 12/23/2004 09:40 AM <DIR> qemu Directory of ./isolinux 12/14/2004 11:55 PM 2,048 boot.cat 07/25/2004 03:13 AM 110 boot.msg 11/30/2004 12:49 AM 1,592 f2 11/30/2004 12:52 AM 796 f3 07/25/2004 03:13 AM 256 german.kbd 12/23/2004 10:27 AM 9,404 isolinux.bin 12/08/2004 04:27 AM 1,993 isolinux.cfg 08/15/2004 01:31 AM 994,807 linux24 07/25/2004 03:50 AM 7,367 logo.16 12/23/2004 10:02 AM 790,567 minirt24.gz Directory of ./KNOPPIX 12/14/2004 11:55 PM 50,158,212 KNOPPIX Directory of ./qemu 07/11/2004 03:20 AM 65,536 bios.bin 11/14/2004 03:55 PM 512 linux_boot.bin 12/04/2004 05:49 PM 237,568 qemu.exe 06/14/2004 03:15 PM 100,864 SDL.dll 07/11/2004 03:20 AM 30,852 vgabios-cirrus.bin 18 File(s) 52,402,606 bytes |
Code Sample |
ISO size: 12/23/2004 10:27 AM 52,498,432 dsl-0.9.1-em.iso (50.066M) |
Code Sample |
listing of autorun.inf: [autorun] open=qemu\qemu.exe -kernel boot/isolinux/linux24 -initrd boot/isolinux/minirt24.gz -hda KNOPPIX/KNOPPIX -L qemu |
Code Sample |
listing of pertinant lines of linuxrc # last ditch - try to mount KNOPPIX ci file from /dev/hda if test -n "$FOUND_KNOPPIX" then else echo "${BLUE}Assuming you're running from QEMU${NORMAL}" echo "${BLUE}Performing last-ditch effort to use ${MAGENTA}/dev/hda${BLUE}...${NORMAL}" # try to mount /dev/hda as a cloop echo "0" > /proc/sys/kernel/printk # hey look, I figured out how to hide errors! $INSMOD modules/cloop.o file=/dev/hda >/dev/null 2>&1 if mount -t iso9660 /dev/cloop /KNOPPIX >/dev/null 2>&1 then FOUND_KNOPPIX="/dev/hda" echo "${GREEN}Success!${NORMAL}" else # try one more time, this time directly trying to mount /dev/hda # this is weird, 'cos it shouldn't work, but usually seems to. if mount -t iso9660 /dev/hda /KNOPPIX >/dev/null 2>&1 then FOUND_KNOPPIX="/dev/hda" echo "${GREEN}Success!${NORMAL}" else echo "${RED}Failed..." fi fi fi |
Code Sample |
Changes to linuxrc: ------LINE 529, inserting 27 lines: # last ditch - try to mount KNOPPIX ci file from /dev/hda if test -n "$FOUND_KNOPPIX" then else QEMU="" echo echo "${BLUE}Guess you're running from QEMU${NORMAL}" echo "${BLUE}Performing last-ditch effort to get KNOPPIX image${NORMAL}" # try to mount /dev/hda as a cloop echo "0" > /proc/sys/kernel/printk $INSMOD modules/cloop.o file=/dev/hda >/dev/null 2>&1 if mount -t iso9660 /dev/cloop /KNOPPIX >/dev/null 2>&1 then FOUND_KNOPPIX="/dev/hda" QEMU="TRUE" echo "${GREEN}Success!${NORMAL}" else # try one more time, this time directly trying to mount /dev/hda if mount -t iso9660 /dev/hda /KNOPPIX >/dev/null 2>&1 then FOUND_KNOPPIX="/dev/hda" QEMU="TRUE" echo "${GREEN}Success!${NORMAL}" else echo "${RED}Failed..." fi fi fi ------LINE 673, replacing 8 lines: rm -rf /etc/ftpusers /etc/passwd /etc/shadow /etc/shadow- /etc/group \ /etc/ppp /etc/isdn /etc/ssh /etc/ioctl.save \ /etc/inittab /etc/network /etc/sudoers \ /etc/init /etc/localtime /etc/dhcpc /etc/pnm2ppa.conf /etc/hosts 2>/dev/null cp -a /KNOPPIX/etc/ftpusers /KNOPPIX/etc/passwd /KNOPPIX/etc/shadow /KNOPPIX/etc/shadow- /KNOPPIX/etc/group \ /KNOPPIX/etc/ppp /KNOPPIX/etc/isdn /KNOPPIX/etc/ssh \ /KNOPPIX/etc/inittab /KNOPPIX/etc/network /KNOPPIX/etc/sudoers \ /KNOPPIX/sbin/init /KNOPPIX/etc/dhcpc /KNOPPIX/etc/hosts /etc/ 2>/dev/null ------LINE 689, inserting 10 lines # Hey, we're in QEMU! Let's get all cozy with the host, shall we? if test -n "$QEMU" then HNAME=$(echo $CMDLINE | /usr/bin/tr ' ' '\n' | /bin/sed -n '/sysname=/s/.*=//p' | /usr/bin/tail -1) HIP=$(echo $CMDLINE | /usr/bin/tr ' ' '\n' | /bin/sed -n '/sysip=/s/.*=//p' | /usr/bin/tail -1) echo echo "${BLUE}QEMU Host is ${MAGENTA}${HNAME}${BLUE} at IP ${MAGENTA}${HIP}${NORMAL}" echo "${HIP} ${HNAME}" >> /etc/hosts echo "${HIP} syshost" >>/etc/hosts fi |
Code Sample |
Listing of rq.c #include <winsock.h> #include <shellapi.h> int doit(); int doit(char* res) { WSADATA wsaData; if (WSAStartup(MAKEWORD(1, 1), &wsaData) != 0) { return 255; } int i=0; char ac[80]; char ip[16]; if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR) { printf("Error %d when getting local host name\r\n", WSAGetLastError()); return 1; } struct hostent *phe = gethostbyname(ac); if (phe == 0) { printf("Yow! Bad host lookup!\r\n"); return 1; } struct in_addr addr; memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr)); sprintf(res, "sysname=%s sysip=%s", ac, inet_ntoa(addr)); WSACleanup(); return 0; } int main(int argc, char *argv[]) { char hostip[95]; char* temp; int retval = doit(hostip); temp=malloc(1024); sprintf(temp, "-kernel isolinux/linux24 -initrd isolinux/minirt24.gz -hda KNOPPIX/KNOPPIX -L qemu -append \"sb=0x220,5,1,5 vga=789 %s\"", &hostip[0]); ShellExecute(NULL, NULL, "qemu/qemu.exe", temp, NULL, SW_SHOW); free(temp); return retval; } |
Code Sample |
gcc -O2 rq.c -o rq.exe -lshell32 -lwsock32 strip rq.exe upx -9 rq.exe |
Code Sample |
listing of autorun.inf [autorun] open=rq.exe |