Jump to content

Steve8x

Active Members
  • Posts

    181
  • Joined

  • Last visited

Everything posted by Steve8x

  1. Yeah I don't think I want to try that, nothing that makes the computer work hard is a good idea... I would probably just make a directx app, full screen it, then as tempnode has already done, disable the task manager so the process cant be closed... that would succesfully "lock" the machine without using system resources intensively... I was going to make something like that so my little cousins couldn't mess with my computer while I was away, and have a password to unlock it, but I never actually made it... I think I might give it a go... It would be sort of like internet cafe's have to prevent using the computer without paying for time ;)
  2. yeah as krandor said, php is a server sided scripting language... that means that the code is run on the server side! so say your running apache on your computer with php installed... when someone connects to your website, on a php page... your server computer is where the php code is executed from... it then spits out the html code to be displayed client side(in the persons browser)... Thats what I like about php... it enables you to have truly dynamic web pages! based on certain conditions in your php code you can have it generate different html code to be displayed... Lets think of an example. Imagine how tedious making a dictionary website would be if the person making it had to create each html page manually!! yikes! a page for every word would be ridiculous to make... So instead someone puts all the words and definitions in a mysql database (still I wouldn't want to do that even lol but its less tedious) then when someone types a word to get the definition of, the php code scans the database for the word, and if found creates the html code to display the word's definition... So its only 1 page, but with changing content... So for your idea of a worm in php, you would only be infecting your own computer... If there is a vulnerability in php someone could potentially exploit it to run code on your server machine... But even if there is, it would involve your page allowing people to submit data to the site, and as long as you sanitize any input you get (something that should be done anyway for a secure website) you'll be fine... lookup how to prevent SQL injection which is what people usually try to do to exploit a web page. removing the special characters from the posted data should be enough prevent any kind of code injection, as even assembly has [ and ]... without those brackets it would be difficult if not impossible to do anything, as you wouldn't be able to access memory locations easily... Anyways to be able to run code on someone's computer through a web browser, you would have to find some exploit within firefox, or IE or any sort of browser... maybe a buffer overflow or something ;) then like krandor said, some specially crafted javascript could allow you to run "arbitrary" code probably to download and execute a worm on their computer without the person even knowing what happened! I'm pretty sure its happened to me before a long time ago when firefox wasn't out, and I was using IE... Some website was using an exploit to download and execute a virus on the site's visitors... I ended up having to reformat as the virus fucked everything up... So yeah anyway if you do find an exploit. Do the right thing and submit it to the browser's developers so they can patch it up, so the exploit can't be used to infect people's computers!
  3. Sparda, I attempted this to see if it is true... I made a simple kernel mode driver which upon loading gets stuck in an infinite loop... Loading the driver with InstDrv, It doesn't "freeze" the whole computer, just the InstDrv program... I know it loaded because the DbgPrint upon loading... I am still able to type this while its still looping so its definately not frozen.. But I am up to 50% CPU usage.. I used a for(;;) loop compiled the driver with the WDK
  4. lol that post reminds me of a while ago when me and my friends were downtown! We stopped at a fast food place to eat, and we went through the drive through, there was this crazy girl at the drive through... She was all being loud and thinking my friend said something about her, and she was like what did you say? My friend was like nothing but she said I heard you... So anyway her co-worker came up and was like don't mind HIM He's very flamboyant!! lolz! Me and my friends couldn't believe it, the She was actually a guy! Yeah we decided that we would never go to that place again! only because that guy was very obnoxious and delayed us when we just wanted to get out of there ;) Yeah well anyway I'm fine with gay people as long as they leave me alone when I tell them I'm not gay! Although I do think gay marriage is taking it a little to far!
  5. Why not just download the ISO and burn it? Thats what I've done... I mean common everyones got a CD burner these days and a spare CD-R lying around! And with high speed internet you'll have a CD burned before the time it takes you to get to the store and back ;) Just download it, I don't care if you've got a 56k modem, it'll still be faster than waiting 3 weeks.
  6. Hey moonlit! you seem to be good with linux... Ok here's my situation... I recently (like a month ago) reformatted my two hard drives, I installed Windows XP on one of them and Ubuntu on the second hard drive... everything installed fine, and grub boot loader worked and everything! and I had a dual boot XP and linux working... Now what happened is I started hearing the 'click of death' and didn't realize it was bad at first... well I soon found out what that sound means... Anyways my drive that had XP on it, was turned into nothing more than a brick. good thing I have my data backed up... So I had to resize the linux drive so XP could fit on it... then I installed windows XP again on the linux drive, now heres where my problem is... XP overwrote the master boot record(I think thats what its called) Now my dual boot screen doesn't come up anymore, I tried searching the net for how to fix this... and I'm close but not quite there... I booted up with the ubuntu live cd, and opened a terminal... typed: step1: sudo grub step2: find /boot/grub/stage1 step3: root (hdX, X) step4: setup (hdX) still when booting without the CD windows boots right away the boot loader does not come up and allow me to boot to ubuntu... I haven't tried this in a while though, so I'm going to try it again right now... But any help is appreciated... ;) EDIT: OK I'm on ubuntu right now, booted from the live CD... Now when I attempt the above when I type "sudo grub" I get the grub prompt "grub>" then "find /boot/grub/stage1" gives me "(hd0, 5)" "root (hd0,5)" gives no error "setup (hd0)" gives me this: Checking if "/boot/grub/stage1" exists... yes Checking if "/boot/grub/stage2" exists... yes Checking if "/boot/grub/e2fs_stage1_5" exists... yes Running "embed /boot/grub/e2fs_stage1_5 (hd0)"... 16 sectors are embedded. succeeded Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded Done. now I will reboot and see if it works this time :) good news! When I booted up I did see the grub boot loader, which contained windows XP at the top, and ubuntu underneath! when I tried booting ubuntu though, I got "Error 17: failed to mount partition" (If i remembered correctly) but windows XP did boot and thats what I'm posting from now... I have a feeling I need to edit the menu.lst file... but what should I change? EDIT2: OK, it seems everything is going my way today! I solved the problem, and I am now in linux booted from hard disk! anyone else who has this same problem, do the above steps... then make sure your menu.lst file is correct from a live cd open it like "sudo gedit /media/disk-1/boot/grub/media.lst" but "disk-1" will most likely be different for you... find the lines like this: title Steve's Ubuntu Linux 8.04 root (hd0,5) kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=3617bb3f-1844-46e0-ac68-a563d052214a ro quiet splash initrd /boot/initrd.img-2.6.24-16-generic quiet title Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode) root (hd0,5) kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=3617bb3f-1844-46e0-ac68-a563d052214a ro single initrd /boot/initrd.img-2.6.24-16-generic title Ubuntu 8.04, memtest86+ root (hd0,5) kernel /boot/memtest86+.bin quiet and change the "(hd0,5)" 's into whatever you got from step 2 "find /boot/grub/stage1" and there you have it, how to make a dual boot work if you install linux before windows... Theres still one thing that I was trying to figure out before that would be cool... Does anyone know how to get the graphical bootloader screens working?
  7. "i can write good code in quickbasic in the microshaft os cuz its much awsome" ;) can I have my cookie now? @tempnode: What do you mean disable CTRL + ALT + DELETE? you weren't really specific... I think you probably mean you want to block the TASK MANAGER? Because that's all that pops up when I press it... If writing a driver to block keyboard input doesn't seem necessary to you, you could try something easier... Do you want to block a certain someone from seeing what processes are open? or do you just want to prevent a certain process from being terminated or what? here's one example, its a pretty lame way but it works... What it does is, whenever the task manager is opened, it immediately closes the window... It happens so fast a person can't even read anything in the window, you'll just see it open and close really fast... at start its on... when control + alt + x + f11 are all pressed simultaneously it toggles the functionality... so it lets you toggle on/off without restarting the computer and if you want to make it quit then press control + alt + x + f12 the only downside to this approach is the fact that it targets task manager in particular... any other task manager like program will run with no problems, which is why if you need a process to stay running and not be terminated then hiding a process is better than trying to disable task manager... since then it can't be terminated no matter what task manager program is used... 2.50 KB http://www.popeax.com/downloads/TMblocker.rar TMblocker.asm: ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« .486 ; create 32 bit code .model flat, stdcall ; 32 bit memory model option casemap :none ; case sensitive include \masm32\include\windows.inc include \masm32\include\masm32.inc include \masm32\include\gdi32.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\Comctl32.inc include \masm32\include\comdlg32.inc include \masm32\include\shell32.inc include \masm32\include\oleaut32.inc include \masm32\include\msvcrt.inc include \masm32\macros\macros.asm includelib \masm32\lib\masm32.lib includelib \masm32\lib\gdi32.lib includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\Comctl32.lib includelib \masm32\lib\comdlg32.lib includelib \masm32\lib\shell32.lib includelib \masm32\lib\oleaut32.lib includelib \masm32\lib\msvcrt.lib .data TMclass db '#32770',0 TMclass2 db 'SysTabControl32',0 TabCaption db 'Tab1',0 taskmgr dd 0 toggle db 01 .code start: call main invoke ExitProcess, 0 main proc @@: invoke Sleep, 10 .if [toggle] == 1 invoke FindWindow, addr TMclass, 0 mov [taskmgr], eax .if eax invoke FindWindowEx, [taskmgr], 0, addr TMclass2, addr TabCaption .if eax invoke PostMessage, [taskmgr], WM_CLOSE, 0, 0 .endif .endif .endif invoke GetKeyState, VK_CONTROL and al, 80h cmp al, 0 jz @b invoke GetKeyState, VK_MENU and al, 80h cmp al, 0 jz @b invoke GetKeyState, 58h; 'x' key and al, 80h cmp al, 0 jz @b invoke GetKeyState, VK_F11 and al, 80h .if al != 0 xor byte ptr [toggle], 1 invoke Sleep, 250 .endif invoke GetKeyState, VK_F12 and al, 80h cmp al, 0 jz @b ret main endp end start
  8. X3N, write a script? lol silly rabbit scripts are for kiddies! OK, I think I know what you mean... you want a program that can take a search string or "key word" as you put it, and then scan every single file in all directories and sub directories within a certain drive and if the string is found in a particular file then copy it to your usb stick... I thought it was a cool idea so I went ahead and made it... I call it FileSnatcher® I was going to code it in C++, but I wanted it to be as fast as possible so I had to code it in MASM32... It will recursively search through directories looking for files that meet the criteria(ill explain in a bit) and if a file meets it, it will be opened, read into memory, and scanned for the search string, and only if found will it be saved into the "SnatchedFiles" folder newly created in the same dir as the executable... it has no window and runs silently in the background, once it has completed the search entirely(may take a while depending on how many files are on the drive, and your filter settings[input.ini]) it will save a 'Finished.txt' log file which shows all the files that were found containing the string, and the file sizes and the paths they were at... Version 1.2 Updated Info Below the search string(s) do not have to be only 1 word it can be any string containing spaces or any characters... You specify multiple strings by putting a semicolon + space to separate them ("; ") do not write the semicolon for the last string example... string one; string 2; threeee; string 4; last one dont put the semicolon the file extensions work the same way REMEMBER the space after the ";" is important! If the format isn't exactly right, something will mess up! it works like this, you have to create an "input.ini" file... the program reads this file and uses the data in it to do the search... so lets just think of an example... lets say that I'm am looking for a copy of a file which contains the string "Test Answers" or "Test Results" and I know the file is contained on the C:\ drive and I know the file I'm looking for has the extension of ".doc" or ".txt" or ".pdf" and I know the file size is less than 100KB I would make my input.ini like this: C:\ 102400 .doc; .txt; .pdf test answers; test results this is the new order... The first line contains the drive, OR the path... always append the \ at the end for it to work properly ex. C:\sub\dir\ or C:\ (this currently doesn't allow mulitple like the extension and strings do) the second line is the max file size (in bytes) to open and scan for the string. the third line is the file extension(s) to search for... you can use multiple extensions exactly the same way as multiple strings... this must be either ".something" (example, ".txt", ".html", etc) this narrows the search down quite a bit if you know the file extension of the file you want to "snatch", since now you aren't searching through files you don't need to... if you want to search EVERY file extension however, you can by simply changing the first extension listed into " .* " the fourth line is the search strings line as explained above. just be sure to keep all the strings on this line for the format to be read correctly. the number of search strings + file extensions you can have depends on how long each string is... about 5000 characters worth of memory that could be used.. I think that should be enough! downloads updated to version 1.2! ;) binary download: http://www.popeax.com/downloads/FileSnatcher.rar source code of file snatcher + icon resource: http://www.popeax.com/downloads/FileSnatcherSource.rar Source Code: (compiles to 16 KB including icon) ; File Snatcher v1.2 -> Coded by Steve8x;) ; Now With CaSe InSeNSiTiVe SeArCh! ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« .486 ; create 32 bit code .model flat, stdcall ; 32 bit memory model option casemap :none ; case sensitive ; include files ; ~~~~~~~~~~~~~ include \masm32\include\windows.inc include \masm32\include\masm32.inc include \masm32\include\gdi32.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\Comctl32.inc include \masm32\include\comdlg32.inc include \masm32\include\shell32.inc include \masm32\include\oleaut32.inc include \masm32\include\dialogs.inc include \masm32\macros\macros.asm ; libraries ; ~~~~~~~~~ includelib \masm32\lib\masm32.lib includelib \masm32\lib\gdi32.lib includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\Comctl32.lib includelib \masm32\lib\comdlg32.lib includelib \masm32\lib\shell32.lib includelib \masm32\lib\oleaut32.lib GetString PROTO :DWORD, :DWORD WriteToLog PROTO :DWORD, :DWORD, :DWORD memcpy PROTO :DWORD, :DWORD, :DWORD scanbuffer PROTO :DWORD, :DWORD, :DWORD QuickScan PROTO :DWORD, :DWORD, :DWORD strcmp PROTO :DWORD, :DWORD Search PROTO :DWORD zeromem PROTO :DWORD, :DWORD .data stoplog dd 0 savelogpath dd 0 logoffset dd 0 logbuffer dd 0 buffer dd 0 searchstring dd 0 SSNum dd 0 path dd 0 ext dd 0 ENum dd 0 allext dd 0 maxfilesize dd 0 maxsize dd 0 saveto dd 0 saveto2 dd 0 atoi dd 0 BytesWritten dd 0 crtdll db 'crtdll.dll',0 savefolder db '\SnatchedFiles\',0 formatting db '%s\%s',0 WFD WIN32_FIND_DATA <sizeof WIN32_FIND_DATA> .data? info dd ? hInstance dd ? BytesRead dd ? fBuffer dd ? .code ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« start: mov hInstance, FUNC(GetModuleHandle, NULL) call main invoke ExitProcess, eax ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« main proc LOCAL fHandle:HANDLE invoke CreateFile, SADD("input.ini"), GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0 mov [info], eax .if eax == INVALID_HANDLE_VALUE; if input.ini doesn't exist then quit invoke MessageBox, 0, SADD("Create input.ini file first..."), 0, 0 invoke ExitProcess, 0 .endif ; crtdll.dll contains atoi - which converts a string into an integer invoke GetProcAddress, FUNC(LoadLibrary, addr crtdll), SADD("atoi") mov [atoi], eax invoke VirtualAlloc, 0, 5000, MEM_COMMIT, PAGE_READWRITE mov [searchstring], eax invoke VirtualAlloc, 0, 5000, MEM_COMMIT, PAGE_READWRITE mov [ext], eax invoke zeromem, [searchstring], 5000 mov [path], alloc$(260) mov [ext], alloc$(64) mov [maxfilesize], alloc$(32) mov [saveto], alloc$(260) mov [saveto2], alloc$(260) mov [logbuffer], alloc$(102400) mov [savelogpath], alloc$(260) mov [buffer], alloc$(3000) invoke ReadFile, [info], [buffer], 3000, addr BytesRead, 0 invoke CloseHandle, [info] ;Get path + extension + max size first! invoke GetString, [buffer], [path] invoke GetString, eax, [maxfilesize] push eax .while word ptr [eax] != 0A0Dh; count number of extensions .if word ptr [eax] == 203Bh inc [ENum] .endif inc eax .endw pop eax mov ecx, [ext] invoke GetString, eax, ecx mov ecx, [ENum] .while ecx > 0 invoke GetString, eax, edx dec ecx .endw push eax .while byte ptr [eax] != 0; count number of search strings .if word ptr [eax] == 203Bh inc [SSNum] .endif inc eax .endw pop eax mov ecx, [searchstring] invoke GetString, eax, ecx mov ecx, [SSNum] .while ecx > 0 invoke GetString, eax, edx dec ecx .endw push [maxfilesize] call dword ptr [atoi] mov [maxsize], eax invoke GetCurrentDirectory, 260, [saveto] invoke lstrlen, [saveto] invoke memcpy, [savelogpath], [saveto], eax strcat [saveto], addr savefolder invoke lstrlen, [saveto] invoke memcpy, [saveto2], [saveto], eax invoke CreateDirectory, [saveto], 0 invoke SetCurrentDirectory, [path] invoke strcmp, [ext], SADD(".*") mov [allext], eax invoke Search, [path]; recursive function! invoke wsprintf, [buffer], SADD("%s\%s"), [savelogpath], SADD("Finished.txt") invoke CreateFile, [buffer], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 mov [fHandle], eax .if eax invoke lstrlen, [logbuffer] invoke WriteFile, [fHandle], [logbuffer], eax, addr BytesWritten, 0 .endif invoke CloseHandle, [fHandle] free$(path) free$(ext) free$(maxfilesize) free$(saveto) free$(saveto2) free$(savelogpath) free$(logbuffer) free$(buffer) invoke VirtualFree, [searchstring], 0, MEM_RELEASE invoke VirtualFree, [ext], 0, MEM_RELEASE invoke FreeLibrary, addr crtdll invoke ExitProcess, 0 main endp WriteToLog proc string:DWORD, lbuffer:DWORD, writeoffset:DWORD;writes a string to the log buffer mov eax, [string] mov ecx, [lbuffer] add ecx, [writeoffset] WriteString: mov bl, [eax] mov [ecx], bl inc eax inc ecx cmp byte ptr [eax], 0 jnz WriteString sub ecx, [lbuffer] ret WriteToLog endp SearchFile proc file:DWORD, forcesave:DWORD; scans an entire file for a string within it LOCAL fHandle:HANDLE LOCAL fSize:DWORD ;LOCAL tempString:DWORD invoke CreateFile, [file], GENERIC_READ, FILE_SHARE_READ, 0, OPEN_EXISTING, 0, 0 mov [fHandle], eax .if eax == 0 ret .endif invoke GetFileSize, [fHandle], 0 mov [fSize], eax .if [fSize] == -1 ret .endif invoke VirtualAlloc, 0, [fSize], MEM_COMMIT, PAGE_READWRITE mov [fBuffer], eax ;stralloc 200 ;mov [tempString], eax .if [fSize] > 0 invoke ReadFile, [fHandle], [fBuffer], [fSize], addr BytesRead, 0 invoke CloseHandle, [fHandle] .endif ;debugging purposes leave commented unless debugging ;invoke wsprintf, [tempString], SADD("[%s] size = %i; bytesRead = %i"), addr WFD.cFileName, [fSize], [BytesRead] ;invoke OutputDebugString, [tempString] .if [forcesave] == 1; used to force save the file if the file name contains the search string .if [fSize] > 0 && [fBuffer] > 0 jmp Save .endif .endif mov eax, 539h .if [fSize] > 0 && [fBuffer] > 0 invoke scanbuffer, [fBuffer], [searchstring], [fSize];search entire file for search string(s) .if eax == 1 jmp Save .else jmp skip .endif .endif Save: invoke wsprintf, [saveto], SADD("%s%s"), [saveto2], addr WFD.cFileName; the path to dump the file to invoke CreateFile, [saveto], GENERIC_WRITE, 0, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0 mov [fHandle], eax .if eax invoke WriteFile, [fHandle], [fBuffer], [BytesRead], addr BytesWritten, 0 .endif invoke CloseHandle, [fHandle] .if [logoffset] > 102000; we don't want to crash the program because of access violation mov eax, [buffer] mov dword ptr [eax], 0A0Dh invoke WriteToLog, [buffer], [logbuffer], [logoffset] invoke WriteToLog, SADD("Log Ended Early, Larger than 100KB"), [logbuffer], ecx mov [stoplog], 1 .endif .if [stoplog] == 0 invoke wsprintf, [buffer], SADD("%s [%i] bytes @ "), addr WFD.cFileName, [BytesRead] invoke lstrlen, [logbuffer] invoke QuickScan, [logbuffer], [buffer], eax .if eax == 0 invoke WriteToLog, [buffer], [logbuffer], [logoffset] mov eax, [buffer] mov dword ptr [eax], 0A0Dh; new line invoke WriteToLog, [file], [logbuffer], ecx invoke WriteToLog, [buffer], [logbuffer], ecx mov [logoffset], ecx .endif .endif skip: invoke VirtualFree, [fBuffer], 0, MEM_RELEASE ret SearchFile endp GetStrAddress proc startaddy:DWORD mov edx, [startaddy] @@: inc edx cmp byte ptr [edx], 00 jnz @b inc edx ret GetStrAddress endp Search proc fpath:DWORD; search directories and all sub directories for files to search for the string inside! LOCAL hFind:HANDLE LOCAL pathbackup:DWORD LOCAL namelength:DWORD mov [pathbackup], alloc$(260) invoke memcpy, [pathbackup], [fpath], 260 invoke FindFirstFile, SADD("*.*"), addr WFD mov [hFind], eax .while eax invoke memcpy, [fpath], [pathbackup], 260 invoke wsprintf, [fpath], addr formatting, [fpath], addr WFD.cFileName invoke SetCurrentDirectory, [fpath] .if eax invoke strcmp, addr WFD.cFileName, SADD(".") cmp eax, 1 je skip invoke strcmp, addr WFD.cFileName, SADD("..") cmp eax, 1 je skip invoke Search, [fpath]; let the recursion begin in a sub directory! .endif invoke lstrlen, addr WFD.cFileName mov [namelength], eax mov ebx, [maxsize] .if [WFD.nFileSizeLow] < ebx .if [allext] == 0 ;invoke scanbuffer, addr WFD.cFileName, [ext], eax mov edx, [ext] invoke QuickScan, addr WFD.cFileName, edx, [namelength] test eax, eax jnz continue mov ecx, [ENum] .while ecx > 0 invoke GetStrAddress, edx invoke QuickScan, addr WFD.cFileName, edx, [namelength] test eax, eax jnz continue dec ecx .endw jmp skip .endif continue: invoke lstrlen, addr WFD.cFileName invoke scanbuffer, addr WFD.cFileName, [searchstring], eax .if eax == 1 invoke SearchFile, [fpath], 1 .endif invoke SearchFile, [fpath], 0 .endif skip: invoke FindNextFile, [hFind], addr WFD .endw invoke FindClose, [hFind] free$(pathbackup) ret Search endp strcmp proc string1:DWORD, string2:DWORD; compares two strings mov ebx, [string1] mov edx, [string2] CompareStrings: mov cl, [edx] cmp byte ptr [ebx], cl jne exitcmp .if byte ptr [edx] == 0 && byte ptr [ebx] == 0; strings are a match mov eax, 1 ret .endif inc ebx inc edx jmp CompareStrings exitcmp: xor eax, eax ret strcmp endp Alphabetical proc Char:DWORD; if the byte pointed to is a letter A-Z, a-z, then return the opposite mov eax, [Char]; pointer to byte mov cl, [eax] .if byte ptr [eax] >= 41h && byte ptr [eax] <= 5Ah; its an uppercase letter xor cl, 20h; convert to lowercase ret .elseif byte ptr [eax] >= 61h && byte ptr [eax] <= 7Ah; its a lowercase letter xor cl, 20h; convert to uppercase ret .else;the byte is not a letter xor ecx, ecx ret .endif Alphabetical endp QuickScan proc buff:DWORD, sstr:DWORD, bsize:DWORD push edx push ecx invoke lstrlen, [sstr] mov edx, eax mov edi, [buff] mov esi, [sstr] mov ecx, [bsize] quickloop: push esi sub esi, edx .if esi == [sstr] jmp found .endif pop esi mov al, [edi] .if al == [esi] inc edi inc esi dec ecx jmp quickloop .endif .if ecx > 0 inc edi dec ecx mov esi, [sstr] jmp quickloop .endif notfound: pop ecx pop edx xor eax, eax ret found: pop ecx pop edx mov eax, 1 ret QuickScan endp scanbuffer proc membuffer:DWORD, searchfor:DWORD, bsize:DWORD; case insensitive search for strings in buffer LOCAL stringOffset:DWORD LOCAL bufferOffset:DWORD LOCAL stringsize:DWORD LOCAL buff:DWORD stralloc 250 mov [buff], eax mov [stringOffset], 0 mov [bufferOffset], 0 invoke lstrlen, [searchfor] mov [stringsize], eax push [SSNum] ScanLoop: mov eax, [membuffer] add eax, [bufferOffset] mov ebx, [searchfor] add ebx, [stringOffset] ;pushad ;invoke wsprintf, [buff], SADD("buffer = [%s] searchstring = [%s] SSNum = %i "), eax, ebx, [SSNum] ;invoke OutputDebugString, [buff] ;popad mov edx, [stringsize] .if [stringOffset] == edx pop [SSNum] mov eax, 1 ret .endif mov edx, [bsize] .if [bufferOffset] == edx .if [SSNum] > 0 dec [SSNum] add ebx, [stringsize] add ebx, 1 mov [searchfor], ebx invoke lstrlen, [searchfor] mov [stringsize], eax mov [stringOffset], 0 mov [bufferOffset], 0 jmp ScanLoop .endif pop [SSNum] xor eax, eax ret .endif mov dl, [ebx] .if [eax] == dl; character is a match inc [bufferOffset] inc [stringOffset] ;pushad ;invoke wsprintf, [buff], SADD("buffer = [%s] searchstring = [%s] SSNum = %i "), eax, ebx, [SSNum] ;invoke OutputDebugString, [buff] ;popad jmp ScanLoop .endif push eax invoke Alphabetical, ebx; if its a letter convert lowercase to uppercase / vice versa pop eax ;ecx > 0 means the byte is a letter! .if ecx > 0 .if [eax] == cl inc [bufferOffset] inc [stringOffset] ;pushad ;invoke wsprintf, [buff], SADD("buffer = [%s] searchstring = [%s] SSNum = %i "), eax, ebx, [SSNum] ;invoke OutputDebugString, [buff] ;popad jmp ScanLoop .endif .endif mov [stringOffset], 0 inc [bufferOffset] jmp ScanLoop scanbuffer endp GetString proc buff:DWORD, string:DWORD;grabs strings from a buffer push ecx mov edx, [string]; address of string mov eax, [buff]; address of buffer CopyString: .if word ptr [eax] == 203Bh mov word ptr [edx], 00 add edx, 1 jmp exitfunc .endif .if word ptr [eax] == 0A0Dh mov byte ptr [edx], 00 add edx, 1 jmp exitfunc .endif cmp dword ptr [eax], 0; end of data in buffer reached je exitfunc mov cl, [eax] mov [edx], cl inc eax inc edx jmp CopyString exitfunc: pop ecx add eax, 2 ret GetString endp memcpy proc dest:DWORD, src:DWORD, bSize:DWORD pushad mov esi, [src] mov edi, [dest] mov ecx, [bSize] rep movsb popad ret memcpy endp zeromem proc addy:DWORD, memsize:DWORD push eax push ecx mov eax, [addy] mov ecx, [memsize] @@: mov byte ptr [eax], 00 inc eax dec ecx cmp ecx, 00 jnz @b pop ecx pop eax ret zeromem endp end start test it out let me know how it works for you, it worked pretty good on my computer! ;) its faster than making the same thing in c++ or another language...
  9. Yeah javascript is not going to work, its client sided anyway, the user would be able to modify the log file... anyway you didn't really make it that clear what your trying to do? what is your guide? I'm guessing your providing links that the user can click on and use them to help him finish whatever "test" or whatever they are doing. and so you want to record/log all of the 'help' pages they use to complete the test... its very simple in php... heres an example script which saves the pages clicked on into a log file in a folder... is more than 1 person going to be doing this test at a time? that makes a difference.. is a text log file going to be good enough? or should you go with a mysql database? well the example is for text file logging for now... <?php $TotalPages = 30; $self = $_SERVER['PHP_SELF']; //the url to this script $ip = $_SERVER['REMOTE_ADDR']; // ip address of user $currentdir = realpath("."); // get current directory $currentdir = str_replace("\\", "/", $currentdir); $saveto = "$currentdir/$ip"; // append IP address to path mkdir($saveto); // make the directory $saveto = "$saveto/log.txt"; // append 'log.txt' so it saves the log into the correct directory // keep in mind cookies have to be dealt with before the <html> tag if($_GET['testended'] == 1 && isset($_COOKIE['testsession'])) // user clicked im finish link { $cookiedata = $_COOKIE['testsession']; // grab data from cookie list($ipaddy, $starttime) = split('-', $cookiedata); // separate it into two variables setcookie("testsession", "", time()-3600); // delete the cookie by making it expire $f = fopen($saveto, 'a'); // open the log file with the correct path $time = date("h:i:s A"); // get current time $totaltime = time() - $starttime; // total time elapsed between start and end in seconds $totaltime = $totaltime / 60; // convert to minutes $fmtstring = "[$ipaddy] Session lasted $totaltime minutes, and ended at $time\r\n"; fwrite($f, $fmtstring); fclose($f); echo "<center><h1> Test Over!<br> it took you $totaltime minutes</h1>"; exit(); } else if(!isset($_COOKIE['testsession'])) // cookie doesn't exist so start the session { $starttime = time(); $cookiedata = "$ip-$starttime"; //cookie contains ip address of user and start time separated by a "-" setcookie("testsession", $cookiedata, time()+3600); // set cookie to expire in 1 hour(3600 seconds) $f = fopen($saveto, 'a'); // open the log file and append to the end of it $time = date("h:i:s A"); $fmtstring = "\r\n[$ip] Session started at $time\r\n"; fwrite($f, $fmtstring); fclose($f); } ?> <html> <head><title>Example Link Logger</title></head> <body><center> <?php if(isset($_GET['Page'])) // if the user clicked on a page { $page = $_GET['Page']; // get page number from url $f = fopen($saveto, 'a'); $time = date("h:i:s A"); $fmtstring = "[$ip] went to page $page at $time\r\n"; fwrite($f, $fmtstring); // writes the $fmtstring to the log fclose($f); echo "<meta http-equiv='refresh' content='0;url=$self'>"; // reloads the page immediately } else { for($i = 1; $i <= $TotalPages; $i++) // creates page links to click on(just for example purposes) { $pagex = "$i "; echo "<a href='$self?Page=$i' target='NewWindow'>$pagex</a>"; } echo "<p><a href='$self?testended=1'>Im Finished!</a>"; // deletes the cookie and ends the session } ?> </center> </body> </html> heres how my log file looked after clicking some pages, then clicking im finished(i did it twice) saved to the where the php file was \192.168.1.2\log.txt [192.168.1.2] Session started at 10:36:46 AM [192.168.1.2] went to page 1 at 10:36:57 AM [192.168.1.2] went to page 2 at 10:37:02 AM [192.168.1.2] went to page 18 at 10:37:09 AM [192.168.1.2] went to page 29 at 10:37:12 AM [192.168.1.2] went to page 30 at 10:37:12 AM [192.168.1.2] Session lasted 0.73333333333333 minutes, and ended at 10:37:30 AM [192.168.1.2] Session started at 10:37:43 AM [192.168.1.2] went to page 6 at 10:37:45 AM [192.168.1.2] went to page 14 at 10:37:48 AM [192.168.1.2] went to page 25 at 10:37:50 AM [192.168.1.2] went to page 17 at 10:39:48 AM [192.168.1.2] Session lasted 2.0833333333333 minutes, and ended at 10:39:48 AM this is just an example to build off of and is not complete... I would make it create the folders and save the log file to them using a persons name instead of the ip address/ since you can tell who is who easier... create an edit box and grab the persons name before creating the cookie... and to make it actually go to the pages, you could either, use some javascript to make the a window popup and goto the page(must disable popup blocker) or use frames, create all the links that you want to guide people with in 1 frame, then the page to view in another frame, when a page is clicked record it, then make the view frame goto the page... another thing you might want to consider is using a mysql database instead of text files, I think it would make it a little easier, but thats just me... ;) and rab's session idea is a good idea too, I haven't thought of that
  10. OK guys, I had to take some time to think about it! I think I thought of a good challenge. OK here goes... Programming Language: C++ or Java or ANYTHING! I don't care at this point! ;) Program: CLIENT->SERVER application Must Have: It must make use of sockets, ex. WINSOCK (which is what I'm using) Winner: best functioning server and client Time: 4 weeks I recommend making two separate executables. 1 being the client, the second being the server... it just makes more sense that way I think... For example, a chat program could be a client server app... one person runs the server, a second runs the client... the client would have to know the server computers IP address and port the server is listening on, then they could connect and send a message to the server, the server would receive the message and be able to send a message back to the client! but it can really be anything, as long as data is transferred across the pipes of the internet through sockets, it qualifies... If anyone thinks its too difficult, just say you want to see an example source code, and I will post my program which I'm working on currently (but ill finish soon) But the cache is if I post my example, no one will be able to make the program I post, so if I post an example chat program (not saying that's what it is) you'll have to make something else! You can however use the example as a guide for your program, and learn from it... If anyone has worked with sockets in linux, that would be cool if you'd post, even better would be a linux server/client which communicated with a windows server/client... there probably isn't winsock in linux but theres gotta be something similar... I'm interested in cross-platform development, but not sure how to start coding for linux as all i know up until now is WINAPI... Also when your testing your app (over the net) be sure to port forward whatever port you make your server listen on or else the client wont be able to connect, so just keep that in mind... ;) Challenge Starts NOW! :D
  11. I guess your using a console app, since the name of it is the path... console apps have that behaviour! for setting the title of a console window use: SetConsoleTitle("MyApp"); for example...
  12. Thats totally bogus! they have no right to install there b$ software on your computer without your consent!! not that you would ever give it for that crap! its like a virus almost! how would they like it if we installed software on their computers?... all to protect there stupid game? lol... trying to prevent piracy like this? its only going to INCREASE IT! when will they ever learn piracy will be around for eternity wherever there is security theres always a way around it! they just need to realize some people are going to pirate, and most people will actually buy it, they have to cut there losses, and respect the people that actually buy their game! If there game is really worth the money people will pay for it! but not if it comes with rootkit's and viruses! ;)
  13. Hey, I made this program for myself, but I thought other people might think its useful as well so I thought I'd post it and share it... Its called Gho$t because it makes windows disappear! well not forever! you can bring them back at anytime... Features: *hides up to 32 windows(not that youll ever need that many but I just like to make it high) *Start up with windows option - makes it start when the computer starts, you'll likely want the next option with it *Start hidden - when it starts when the computer starts the window wont show up it will be hidden to start with *Encrypted Password Protect - If the secret hotkey isn't enough just pick a password and enable it, it will encrypt the password using a basic encryption method and when you unhide the window you will need to enter the password to get to the main GUI You can either type in all or part of a window name, and it will enumerate all windows and hide the window if found... If it has been hidden by the program it adds the window's title and handle, into an array for storage... as you can see in the window title between the [] it shows you how many windows the program has hidden... in the picture above there was two windows hidden when I took it... on the main GUI pressing enter while focus is on the edit box is the same as pressing Ok! To unhide a window that you've hidden either type in all or part of the window name, and click undo(or press tab) or you can clear the edit box and click undo/press tab and it will unhide the windows you've hidden in the order you've hidden them in reversed... (in case you forget some titles) In the options menu you can make it start up with windows, I use that option + start hidden, so when my computer starts its window is hidden, and can only appear by pressing the secret hotkey CTRL + ALT + G to set password protection , from the options menu, type a password in the box, and then tick the "Password Protection" checkbox. You will see the encrypted form of the password in the box which is now locked... next time you unhide the window with the hotkey, you'll see the password window, pressing enter while the edit box is in focus is the same as pressing OK! It won't let you get to the main GUI unless the password is correct, useful just for extra security in case someone might figure out the hotkey ctrl + alt + g they still wont be able to figure out what the program actually does... The password typed in is encrypted the same as your saved password, and compared, only if they are the same will it go to the next screen! Yeah its a weak encryption and its easy to bypass even without the password, by knowing the registry key where program data is stored, but its likely to be good enough for this program... although I would like any suggestions for a better encryption method, and maybe I was thinking instead of storing the password + program data in the registry, to do it in a more secret location, but then again it wouldn't matter anyone with a debugger would be able to find out quickly... So It all depends on how smart the people using your computer are whether this simple password protection will be strong enough or not... for me it is... I find it very annoying when I'm running a game server or something and I don't want the window to be closed and someone who uses my computer will just close the window on me not caring about my windows... So I just hide them when I'm away and they'll never be closed on me! :) Lets see how fast someone can decrypt this password ;) :: :: v1.1 - there was a small bug that allowed the last window hidden to be unhidden without entering a password simply by pressing tab at the password screen! I fixed it now... let me know if you find any bugs... ;) downloads updated: Binary: http://popeax.com/downloads/Ghost.zip http://rapidshare.com/files/123497364/Ghost.zip.html Source Code: (MSVC++ 2008 project) http://popeax.com/downloads/GhostSource.zip http://rapidshare.com/files/123497456/GhostSource.zip.html Ghost.cpp Source Code: (it will compile by it self it just wont have an icon or xp theme support) // Ghost v1.1 - by Steve8x // small bug fix #include <windows.h> #include <stdio.h> #ifndef WS_EX_LAYERED #define WS_EX_LAYERED 0×00080000 #endif typedef BOOL (CALLBACK* SETLAYEREDWINDOWATTRIBUTES)(HWND, COLORREF, BYTE, DWORD); HWND CreateEditEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id); HWND CreateButtonEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id); HWND CreateCheckEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id); HWND CreateTextEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id); HINSTANCE hInst; HWND hWnd, OhWnd, phWnd, EditBox, StartUpChk, SHChk, PWprotect, PW, PWbox; HKEY hk; DWORD BufSize = 256; char WndTitle[256]; char WndText[64]; char HideWnd[64]; char exePath[256]; char Password[32]; char Password2[32]; int id = 0, enablepw = 0, ShowHide = 0, hideGUI = 0; struct HiddenWindows { HWND handle; char name[256]; }; HiddenWindows Windows[32]; // youll never hide 32 windows but its good to be covered void AlphaBlend() // sets window transparency { SETLAYEREDWINDOWATTRIBUTES pSetLayered; HMODULE u32 = LoadLibraryA("user32.dll"); pSetLayered = (SETLAYEREDWINDOWATTRIBUTES)GetProcAddress(u32, "SetLayeredWindowAttributes"); pSetLayered(hWnd, 0, 170, LWA_ALPHA); FreeLibrary(u32); } void movsb(void* dst, void* src, int bSize) // ASM movsb == Faster than memcpy { _asm { pushad mov esi, [src] mov edi, [dst] mov ecx, [bSize] rep movsb popad } } BOOL CALLBACK SearchWnd(HWND h, LPARAM lParam) { int i = 0, sSize = 0; ZeroMemory(&WndTitle, 256); GetWindowTextA(h, WndTitle, 256); sSize = lstrlenA(WndTitle); // convert string to lowercase while (i < sSize) { char up = WndTitle[i]; up = tolower(up); WndTitle[i] = up; i++; } if(strstr(WndTitle, HideWnd)) { ZeroMemory(Windows[id].name, 256); //OutputDebugStringA("Window Hidden!"); Windows[id].handle = h; movsb(Windows[id].name, WndTitle, sSize+1); ShowWindow(Windows[id].handle, SW_HIDE); id++; return FALSE; } return TRUE; } void GrabSearchString() { int sSize = 0, i = 0; ZeroMemory(&HideWnd, 64); GetWindowTextA(EditBox, HideWnd, 64); sSize = lstrlenA(HideWnd); // convert string to lowercase while (i < sSize) { char up = HideWnd[i]; up = tolower(up); HideWnd[i] = up; i++; } } bool Hide() { GrabSearchString(); if(id == 32) { //OutputDebugStringA("Maximum Number Of Hidden Windows Reached!"); return 0; } if(HideWnd[0] == 0) { //nothing typed in box so do nothing return 0; } for(int x = 0; x < id; x++) // if window already hidden do nothing { if(strstr(Windows[x].name, HideWnd)) { //OutputDebugStringA("Window Already Hidden!"); return 0; } } //Enumerate all windows and hide if found EnumWindows(SearchWnd, 0); sprintf_s(WndText, 64, "Gho$t [%i]", id); SetWindowTextA(hWnd, WndText); return 1; } bool UnHide() { GrabSearchString(); if(HideWnd[0] == 0) // unhide last entry { if(id == 0) return 0; ShowWindow(Windows[id-1].handle, SW_MINIMIZE); Windows[id-1].handle = 0; ZeroMemory(&Windows[id-1].name, 256); id--; sprintf_s(WndText, 64, "Gho$t [%i]", id); SetWindowTextA(hWnd, WndText); //OutputDebugStringA("Window Unhidden!"); return 1; } for(int x = 0; x < id; x++) // check hidden windows { if(strstr(Windows[x].name, HideWnd)) { ShowWindow(Windows[x].handle, SW_MINIMIZE); // keep array tightly packed // if we delete an entry from somewhere // then copy the last entry to its place if(id > 0) { Windows[x].handle = 0; ZeroMemory(&Windows[x].name, 256); Windows[x] = Windows[id-1]; id--; } sprintf_s(WndText, 64, "Gho$t [%i]", id); SetWindowTextA(hWnd, WndText); //OutputDebugStringA("Window Unhidden!"); return 1; } } // window has not been hidden by this program //OutputDebugStringA("Window Not Hidden!"); return 0; } void EncryptPassword(char passw[32]) // lol { int pSize = lstrlenA(passw); for(int c = 0; c < pSize; c++) { passw[c] += 137; } } void AddToStartupWithHide() { char Path[256]; HKEY hak5; RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_ALL_ACCESS, &hak5); GetModuleFileNameA(GetModuleHandle(0), Path, sizeof(Path)); strcat_s(Path, " -hide"); int pathSize = lstrlenA(Path); RegSetValueExA(hak5, "Ghost", 0, REG_SZ, (const unsigned char*)Path, pathSize); RegCloseKey(hak5); } LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_COMMAND: if(wParam == 420) // Ok! Hide(); if(wParam == 421) // Undo UnHide(); if(wParam == 422) // Options ShowWindow(OhWnd, SW_SHOWNORMAL); break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } LRESULT CALLBACK PWWndProc(HWND h, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_COMMAND: if(wParam == 423) // OK! { GetWindowTextA(PWbox, Password2, 32); EncryptPassword(Password2); if(strcmp(Password, Password2) == 0) { hideGUI = 1; ShowWindow(phWnd, SW_HIDE); ShowWindow(hWnd, SW_SHOWNORMAL); ShowHide = 0; } else { SetWindowTextA(phWnd, "INVALID PW!"); FlashWindow(phWnd, 1); } } break; case WM_CLOSE: ShowWindow(phWnd, SW_HIDE); ShowHide = 0; break; default: return DefWindowProc(h, message, wParam, lParam); } return 0; } LRESULT CALLBACK OptionsWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_COMMAND: if(wParam == 500) // start with windows checkbox { LRESULT startwithwindows = SendMessage(StartUpChk, BM_GETCHECK, 0, 0); RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_ALL_ACCESS, &hk); if(startwithwindows == BST_CHECKED) { GetModuleFileNameA(GetModuleHandle(0), exePath, sizeof(exePath)); int pathSize = lstrlenA(exePath); RegSetValueExA(hk, "Ghost", 0, REG_SZ, (const unsigned char*)exePath, pathSize); EnableWindow(SHChk, 1); RegCloseKey(hk); } else { RegDeleteValueA(hk, "Ghost"); EnableWindow(SHChk, 0); SendMessage(SHChk, BM_SETCHECK, 0, 0); RegCloseKey(hk); RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Steve8x\\Ghost",0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hk, 0); DWORD yes = 0; RegSetValueExA(hk, "StartHidden", 0, REG_DWORD, (BYTE*)&yes, sizeof(yes)); RegCloseKey(hk); } } if(wParam == 501) // start hidden checkbox { LRESULT starthidden = SendMessage(SHChk, BM_GETCHECK, 0, 0); RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Steve8x\\Ghost",0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hk, 0); if(starthidden == BST_CHECKED) { DWORD yes = 1; RegSetValueExA(hk, "StartHidden", 0, REG_DWORD, (BYTE*)&yes, sizeof(yes)); AddToStartupWithHide(); } else { DWORD yes = 0; RegSetValueExA(hk, "StartHidden", 0, REG_DWORD, (BYTE*)&yes, sizeof(yes)); } RegCloseKey(hk); } if(wParam == 502) // password protect checkbox { ZeroMemory(&Password, 32); GetWindowTextA(PW, Password, 32); RegCreateKeyExA(HKEY_LOCAL_MACHINE, "Software\\Steve8x\\Ghost",0, 0, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, 0, &hk, 0); LRESULT pwprotect = SendMessage(PWprotect, BM_GETCHECK, 0, 0); if(pwprotect == BST_UNCHECKED) { DWORD yes = 0; RegSetValueExA(hk, "PasswordProtect", 0, REG_DWORD, (BYTE*)&yes, sizeof(yes)); SetWindowTextA(PW, ""); EnableWindow(PW, 1); enablepw = 0; ShowHide = 1; break; } if(Password[0] == 0) { SendMessage(PWprotect, BM_SETCHECK, 0, 0); MessageBoxA(0, "You Need To Enter A Password First!", "!", 0); break; } if(pwprotect == BST_CHECKED) { EncryptPassword(Password); SetWindowTextA(PW, Password); DWORD yes = 1; RegSetValueExA(hk, "PasswordProtect", 0, REG_DWORD, (BYTE*)&yes, sizeof(yes)); RegSetValueExA(hk, "Password", 0, REG_SZ, (BYTE*)Password, sizeof(Password)); EnableWindow(PW, 0); enablepw = 1; } RegCloseKey(hk); } break; case WM_CLOSE: ShowWindow(OhWnd, SW_HIDE); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } void HotkeyHandler(void* nCmdShow) { // so that if its hidden on start it will unhide at the first hotkey press / vice versa ShowHide = *(int*)nCmdShow; for(;; Sleep(10)) { // CTRL + ALT + G if((GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000) && (GetKeyState(0x47) < 0)) { _asm xor [ShowHide], 1 if(enablepw == 1 && hideGUI == 1) { ShowWindow(phWnd, ShowHide); ShowWindow(hWnd, 0); SetWindowTextA(PWbox, ""); SetWindowTextA(phWnd, "Password:"); SetForegroundWindow(phWnd); } else if(enablepw == 1 && hideGUI == 0) { hideGUI = 1; ShowWindow(hWnd, ShowHide); } else if(enablepw == 0) { ShowWindow(hWnd, ShowHide); } Sleep(200); } } } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int WndWidth = 170, WndHeight = 80, ScreenPosX, ScreenPosY; hInst = hInstance; WNDCLASSEX wc; MSG Msg; wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(101)); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = (HBRUSH)GetStockObject(DEFAULT_PALETTE); wc.lpszMenuName = NULL; wc.lpszClassName = L"Ghost_Class"; wc.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(101)); RegisterClassEx(&wc); wc.lpszClassName = L"Ghost_Options_Class"; wc.lpfnWndProc = OptionsWndProc; RegisterClassEx(&wc); wc.lpszClassName = L"Ghost_PW_Class"; wc.lpfnWndProc = PWWndProc; RegisterClassEx(&wc); int ScreenWidth = GetSystemMetrics(SM_CXSCREEN); int ScreenHeight = GetSystemMetrics(SM_CYSCREEN); ScreenPosX = (ScreenWidth / 2) - WndWidth; ScreenPosY = (ScreenHeight / 2) - WndHeight; hWnd = CreateWindowExA(WS_EX_LAYERED, "Ghost_Class", "Gho$t", WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPSIBLINGS, ScreenPosX, ScreenPosY, WndWidth, WndHeight, 0, 0, hInstance, 0); OhWnd = CreateWindowExA(0, "Ghost_Options_Class", "Gho$t Options", WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPSIBLINGS, (ScreenPosX+50), (ScreenPosY+20), WndWidth, 168, 0, 0, hInstance, 0); phWnd = CreateWindowExA(0, "Ghost_PW_Class", "Password:", WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_CLIPSIBLINGS, ScreenPosX, ScreenPosY, WndWidth, (WndHeight-4), 0, 0, hInstance, 0); // Main Window Controls EditBox = CreateEditEx(hWnd, 0, 2, 2, 158, 25, 300); CreateButtonEx(hWnd, "Ok!", 1, 30, 50, 22, 420); CreateButtonEx(hWnd, "Undo", 51, 30, 50, 22, 421); CreateButtonEx(hWnd, "Options", 101, 30, 60, 22, 422); //Options Window Controls StartUpChk = CreateCheckEx(OhWnd, "Start With Windows", 2, 2, 160, 25, 500); SHChk = CreateCheckEx(OhWnd, "Start Hidden", 2, 27, 160, 25, 501); PWprotect = CreateCheckEx(OhWnd, "Password Protect", 2, 52, 160, 25, 502); CreateTextEx(OhWnd, "Password:", 2, 77, 160, 20, 600); PW = CreateEditEx(OhWnd, 0, 2, 95, 160, 25, 301); CreateTextEx(OhWnd, "Coded By Steve8x", 2, 122, 160, 25, 601); //Password Window Controls PWbox = CreateEditEx(phWnd, 0, 2, 2, 160, 25, 302); CreateButtonEx(phWnd, "OK!", 55, 28, 50, 22, 423); RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_READ, &hk); RegQueryValueExA(hk, "Ghost", 0, 0, (LPBYTE)exePath, &BufSize); if(exePath[1] == 0x3A) // 0x3A == ":" { SendMessage(StartUpChk, BM_SETCHECK, 1, 0); EnableWindow(SHChk, 1); } else { EnableWindow(SHChk, 0); } RegCloseKey(hk); DWORD vSize = 4, pSize = 32, StartHidden = 0, PWpro = 0; RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Steve8x\\Ghost", 0, KEY_READ, &hk); RegQueryValueExA(hk, "StartHidden", 0, 0, (LPBYTE)&StartHidden, &vSize); RegQueryValueExA(hk, "PasswordProtect", 0, 0, (LPBYTE)&PWpro, &vSize); RegQueryValueExA(hk, "Password", 0, 0, (LPBYTE)&Password, &pSize); RegCloseKey(hk); if(StartHidden == 1) { SendMessage(SHChk, BM_SETCHECK, 1, 0); } if(PWpro == 1) { SendMessage(PWprotect, BM_SETCHECK, 1, 0); SetWindowTextA(PW, Password); EnableWindow(PW, 0); enablepw = 1; } if(_strcmpi(lpCmdLine, "-hide") == 0) // start hidden { nCmdShow = SW_HIDE; } if(enablepw == 1) { hideGUI = 1; ShowWindow(phWnd, nCmdShow); SetFocus(PWbox); } else { ShowWindow(hWnd, nCmdShow); SetFocus(EditBox); } UpdateWindow(hWnd); AlphaBlend(); CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&HotkeyHandler, (void*)&nCmdShow, 0, 0); while(GetMessage(&Msg, NULL, 0, 0) > 0) { if(Msg.message == WM_KEYDOWN) { if(Msg.wParam == VK_RETURN) { if(PWbox == GetFocus()) // if enter is pressed on password box then hit OK! { SendMessageA(phWnd, WM_COMMAND, 423, 0); } if(EditBox == GetFocus()) // if enter is pressed on main GUI's edit box then hit Ok! { SendMessageA(hWnd, WM_COMMAND, 420, 0); } } if(Msg.wParam == VK_TAB) { if(EditBox == GetFocus()) // if tab is pressed on main GUI's edit box then hit undo button { SendMessageA(hWnd, WM_COMMAND, 421, 0); } } } TranslateMessage(&Msg); DispatchMessage(&Msg); } return Msg.wParam; } HWND CreateButtonEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(0, "BUTTON", Text, WS_CHILD | WS_VISIBLE | WS_TABSTOP, x, y, wd, ht, h, (HMENU)id, hInst, 0); } HWND CreateEditEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", Text, ES_WANTRETURN | ES_NOHIDESEL | WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | WS_TABSTOP, x, y, wd, ht, h, (HMENU)id, hInst, 0); } HWND CreateCheckEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(0, "BUTTON", Text, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, x, y, wd, ht, h, (HMENU)id, hInst, 0); } HWND CreateTextEx(HWND h, char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(0, "STATIC", Text, WS_CHILD | WS_VISIBLE | SS_LEFT, x, y, wd, ht, h, (HMENU)id, hInst, 0); }
  14. I picked no!!! Not to be a tree hugger or anything here but common guys we need to save the trees! this thread reminds of this video lol I definitely would not want to be getting a bible length bill every month! especially from at&t! :P
  15. I think the software your refering to is space monger... I used that before and its pretty cool... say you've got tons of space taken up on your hard drive and you want to clear some off to keep space usage down... I know sometimes its really hard to find whats taking up all the space!! so just use space monger and it graphically shows you what's taking up the biggest space so you can decide if you don't need it to just delete it, or backup elsewhere... http://www.sixty-five.cc/sm/ As for your speed issue, I know tons of programs like to make themselves start up with the computer, which is gay... lots of programs all trying to start up at the same time is obviously going to slow down the start up quite a bit! I like to keep almost no start up programs by removing the entries to the registry key's that hold startup progam data also the start menu has a folder called startup which can have processes to start in there too... Remove everything pretty much except essentials, for example in my startup I only have my graphics card's program, apache web server, and the basic windows services (minus messenger and ones described below) thats all, makes a nice fast startup... also another reason why a computer can start up slow and you'll notice the start menu+taskbar are not accessible for a while when starting up windows, this is caused by the "SSDP Discovery Service", which enables support for Universal Plug and Play Devices it basically trys to find UPnP devices on startup slowing everything down, if you don't need that then set it to disabled in services through administrative tools also since your disabling that you might as well disable "Universal Plug and Play Device Host" as well because it depends on the "SSDP Discovery Service" Also how much ram do you have that goes into play as well... I have 4 gigs and sometimes it doesn't even seem like enough! lol I can't wait until computers have 100 gigs of ram! :) tons and tons of ram + fast processor ===== FAST COMPUTER (unless running vista lol so vista is a no-no!) If your computer is still slow, maybe a good ol' reformat will fix it? it always does it for me!
  16. Steve8x

    Arp Poising

    Well I was just watching the WPA PSK cracking episode, and I think you need the mad wifi drivers and on the website it says your wireless card needs to have an Atheros chipset... heres a link: http://madwifi.org/wiki/Compatibility I was going to try cracking WPA but my wifi device is USB and it says mad wifi doesn't support USB devices... So Im not sure if I can still do it without having a laptop with a wifi card... maybe theres a way
  17. Name: Steve Favorite game: CS Source && Astrosmash [from intellevision] Favorite OS: Windows(but I'll never downgrade to vista), 2nd: Linux Nationality: American Gender: Male Age: 18 Height: 8x™ Status: Inside your kernel Build: Windows XP Service Pack 2 Build 2082 Favorite Artist: DJ Eternity Chicago Favorite movie: Ferris Bueller's Day Off Favorite actress: Natalie Portman ;) Favorite Comedian: Jay Leno Hobbies: Programming/Coding; NON MFC C++; MASM32; PHP; Web Site Design, Graphic Design, Photoshop CS3, Clubbing, Partying, Driving :P but not in that order lol Car: 2000 Monte Carlo Occupation: Self Employed lol at Robin he's trying to sell drugs over the interwebs!!!
  18. Hello! I know theres still plenty of time left, but I'm going to submit my alarm clock application early! ;) Yeah I was a bit reluctant to do it at first because an alarm clock seemed like kind of a boring project, but I started doing it anyway because I wanted to win the challenge! :) and It actually was sorta fun to make! It seems like the trend so far is with console app's, console apps are cool but I love making GUI's even more, so thats where I went with this challenge Heres what it looks like: As you can see I shaped the window like the clock image is shaped! pretty neat eh? It surpasses both requirements, not only does it display the time, and date, it also has not 1, but 3 set able alarms... You can use the default.mp3 that comes with it as the alarm, or copy one of your favorite mp3's into the folder to use as the alarm...(just remember to turn your PC volume on full blast if you want it to wake you up!) And I actually tested it to make sure it works! I made it yesterday... so last night, I set 1 of the alarms and turned my volume up, then went to sleep! and sure enough in the morning I was awoken to hear a song that I like playing at a loud volume! :) You can make it start up with windows simply by checking the checkbox... (it adds it self to the registry at a key that I know of which makes programs start on startup, read over the source to learn it if you don't already know) Once you pick an alarm time you like, or 2, or 3, then just press "Save Alarms" button, but don't forget to turn the ones you want on before pressing save, else they wont be saved as on, but they will still work... the edit box can be used to display an mp3 song you have saved, or save a new one, press the load button to see whats currently saved... or you can press test alarm and it loads it as well, but also plays the mp3... One thing is that an mp3 can't have any spaces in it for some reason, even though I get the full string it still wont play because of the space(s)... If anyone knows why that is or how to fix that bug, it would be cool but for now just make your mp3's with no spaces... its not case sensitive though Has a hideme feature, Press CONTROL + ALT + A to hide/unhide the window, so no one can close it on you, and you've still got your alarm going in the background! still shows up on task manager though! because its a GUI, the source code wont compile all on its own, you need other files with it, a bitmap and icon, window region data that defines the shape of the window, a manifest file for the xp themed buttons and other controls so you'll have to download the full project to be able to compile it! oh and I almost forgot its coded in Microsoft Visual C++ 2008! so you'll likely need that to compile it! Well I hope you enjoy reading my source code! and may GUI programming be with you! :) downloads directly off my apache web server binary: http://www.popeax.com/downloads/StevesAlarmClock.zip source: http://www.popeax.com/downloads/AlarmclockSRC.zip rapidshare downloads binary: http://rapidshare.com/files/122868573/Stev...mClock.zip.html source: http://rapidshare.com/files/122868294/AlarmclockSRC.zip.html the main source code, you still need other data to compile though! // AlarmClock Coded By Steve8x! // Pure Win32 API! SCREW MFC!!! #include <windows.h> #include <fstream> #include <iostream> #include <stdio.h> #include <time.h> #include <string> #include <mmsystem.h> #include "RegionData.h" // holds binary for the window shape #pragma comment(lib, "winmm.lib") // for mp3 playback using namespace std; //Prototypes void AlarmThread(void); HWND CreateButtonEx(char Text[64], int x, int y, int wd, int ht, int id); HWND CreateEditEx(char Text[64], int x, int y, int wd, int ht, int id); HWND CreateTextEx(char Text[64], int x, int y, int wd, int ht, int id); HWND CreateCheckEx(char Text[64], int x, int y, int wd, int ht, int id); HWND CreateDropDownEx(char Text[64], int x, int y, int wd, int ht, int id); SYSTEMTIME st; HINSTANCE hInst; HRGN WndRgn; HWND hWnd, hDate, hTime, hSet, hStartUp, hAMPM, hAMPM2, hAMPM3, hHour, hHour2, hHour3, hMinute, hMinute2, hMinute3, hCheck, hCheck2, hCheck3; HWND hTest, hMp3, hLoad; HKEY hk; int ThreadRunning = 0, Stop = 0, alarm1, alarm2, alarm3; bool AMPM = 0; // AM = 0, PM = 1 char exePath[256]; char CurrentDate[64]; char CurrentTime[32]; const char* AMorPM[] = {"AM", "PM"}; const char* HoursList[] = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"}; const char* MinutesList[] = {"00", "10", "20", "30", "40", "50"}; DWORD BufSize = 256; LRESULT hourz, minutez, pmz, startwithwindows; char HOUR[3]; char MINUTE[3]; char AMPMZ[3]; char AlarmMp3[256]; void SetBoxes(HWND h, HWND m, HWND ampm) // sets the drop down boxes values to reflect your already saved alarms { for(int x = 0; x < 12; x++) { if(strcmp(HOUR, HoursList[x]) == 0) { SendMessageA(h, CB_SETCURSEL, x, 0); break; } } for(int x = 0; x < 6; x++) { if(strcmp(MINUTE, MinutesList[x]) == 0) { SendMessageA(m, CB_SETCURSEL, x, 0); break; } } if(strcmp(AMPMZ, "AM") == 0) SendMessageA(ampm, CB_SETCURSEL, 0, 0); // AM else SendMessageA(ampm, CB_SETCURSEL, 1, 0); // PM } void ReadMp3() { ifstream alarms("alarms.ini"); if(alarms.is_open()) { alarms.getline(AlarmMp3, sizeof(AlarmMp3)); } alarms.close(); } void ReadAlarms() { char alarmON[2]; ifstream alarms("alarms.ini"); if(alarms.is_open()) { alarms.getline(AlarmMp3, sizeof(AlarmMp3)); alarms >> HOUR >> MINUTE >> AMPMZ >> alarmON; SetBoxes(hHour, hMinute, hAMPM); if(strcmp((const char*)alarmON, "1") == 0) { alarm1 = 1; SendMessageA(hCheck, BM_SETCHECK, 1, 0); SendMessageA(hCheck, WM_SETTEXT, 0, (LPARAM)"ON"); } else { alarm1 = 0; SendMessageA(hCheck, BM_SETCHECK, 0, 0); SendMessageA(hCheck, WM_SETTEXT, 0, (LPARAM)"OFF"); } alarms >> HOUR >> MINUTE >> AMPMZ >> alarmON; SetBoxes(hHour2, hMinute2, hAMPM2); if(strcmp((const char*)alarmON, "1") == 0) { alarm2 = 1; SendMessageA(hCheck2, BM_SETCHECK, 1, 0); SendMessageA(hCheck2, WM_SETTEXT, 0, (LPARAM)"ON"); } else { alarm2 = 0; SendMessageA(hCheck2, BM_SETCHECK, 0, 0); SendMessageA(hCheck2, WM_SETTEXT, 0, (LPARAM)"OFF"); } alarms >> HOUR >> MINUTE >> AMPMZ >> alarmON; SetBoxes(hHour3, hMinute3, hAMPM3); if(strcmp((const char*)alarmON, "1") == 0) { alarm3 = 1; SendMessageA(hCheck3, BM_SETCHECK, 1, 0); SendMessageA(hCheck3, WM_SETTEXT, 0, (LPARAM)"ON"); } else { alarm3 = 0; SendMessageA(hCheck3, BM_SETCHECK, 0, 0); SendMessageA(hCheck3, WM_SETTEXT, 0, (LPARAM)"OFF"); } } alarms.close(); } void SetAlarms() { hourz = SendMessage(hHour, CB_GETCURSEL, 0, 0); minutez = SendMessage(hMinute, CB_GETCURSEL, 0, 0); pmz = SendMessage(hAMPM, CB_GETCURSEL, 0, 0); GetWindowTextA(hMp3, AlarmMp3, 256); if(AlarmMp3[0] == 0) // if nothings is typed in the box read from file { ReadMp3(); SendMessageA(hMp3, WM_SETTEXT, 0, (LPARAM)&AlarmMp3); } ofstream alarms("alarms.ini"); if(strstr(AlarmMp3, ".mp3") == 0) // if theres no .mp3 file saved use default alarms << "Default.mp3" << "\n"; else alarms << AlarmMp3 << "\n"; alarms << HoursList[hourz] << "\n" << MinutesList[minutez] << "\n" << AMorPM[pmz] << "\n"; if(alarm1 == 1) alarms << "1\n"; else alarms << "0\n"; hourz = SendMessage(hHour2, CB_GETCURSEL, 0, 0); minutez = SendMessage(hMinute2, CB_GETCURSEL, 0, 0); pmz = SendMessage(hAMPM2, CB_GETCURSEL, 0, 0); alarms << HoursList[hourz] << "\n" << MinutesList[minutez] << "\n" << AMorPM[pmz] << "\n"; if(alarm2 == 1) alarms << "1\n"; else alarms << "0\n"; hourz = SendMessage(hHour3, CB_GETCURSEL, 0, 0); minutez = SendMessage(hMinute3, CB_GETCURSEL, 0, 0); pmz = SendMessage(hAMPM3, CB_GETCURSEL, 0, 0); alarms << HoursList[hourz] << "\n" << MinutesList[minutez] << "\n" << AMorPM[pmz] << "\n"; if(alarm3 == 1) alarms << "1\n"; else alarms << "0\n"; alarms.close(); } LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_CREATE: // Sets the custom window shape WndRgn = ExtCreateRegion(0, sizeof(RegionData), (RGNDATA*)&RegionData); SetWindowRgn(hwnd, WndRgn, TRUE); break; case WM_COMMAND: if(wParam == 420) // user pressed "X" button to quit goto QUIT; if(wParam == 421) // user pressed "SET ALARMS" which saves alarm data + Mp3 { SetAlarms(); } if(wParam == 422) // "TEST ALARM" pressed loads the mp3 only and test plays it { ReadMp3(); SendMessageA(hMp3, WM_SETTEXT, 0, (LPARAM)&AlarmMp3); if(Stop == 0) { Stop = 1; SendMessageA(hTest, WM_SETTEXT, 0, (LPARAM)"STOP"); if(ThreadRunning == 0) CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&AlarmThread, 0, 0, 0); } else if(Stop == 1) { Stop = 2; SendMessageA(hTest, WM_SETTEXT, 0, (LPARAM)"TEST ALARM"); string AlarmSound(AlarmMp3); string Close = "close " + AlarmSound; mciSendStringA(Close.c_str(), 0, 0, 0); } } // doing it when initializing the program freezes it for some reason until you click, very annoying bug // So we just have to press load for now (if you previously saved a custom mp3) // TEST ALARM button will work as well to load it... if(wParam == 423) // Load - Loads the Saved Mp3 into edit box { ReadMp3(); SendMessageA(hMp3, WM_SETTEXT, 0, (LPARAM)&AlarmMp3); } if(wParam == 700) // user toggled alarm 1 { _asm xor [alarm1], 1 // toggle; if alarm1 == 1, it now equals zero, or vise versa if(alarm1 == 1) SendMessageA(hCheck, WM_SETTEXT, 0, (LPARAM)"ON"); else SendMessageA(hCheck, WM_SETTEXT, 0, (LPARAM)"OFF"); } if(wParam == 701) // user toggled alarm 2 { _asm xor [alarm2], 1 if(alarm2 == 1) SendMessageA(hCheck2, WM_SETTEXT, 0, (LPARAM)"ON"); else SendMessageA(hCheck2, WM_SETTEXT, 0, (LPARAM)"OFF"); } if(wParam == 702) // user toggled alarm 3 { _asm xor [alarm3], 1 if(alarm3 == 1) SendMessageA(hCheck3, WM_SETTEXT, 0, (LPARAM)"ON"); else SendMessageA(hCheck3, WM_SETTEXT, 0, (LPARAM)"OFF"); } if(wParam == 703) // user toggled start with windows checkbox { startwithwindows = SendMessage(hStartUp, BM_GETCHECK, 0, 0); RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_ALL_ACCESS, &hk); if(startwithwindows == BST_CHECKED) { GetModuleFileNameA(GetModuleHandle(0), exePath, sizeof(exePath)); int pathSize = lstrlenA(exePath); RegSetValueExA(hk, "AlarmClock", 0, REG_SZ, (const unsigned char*)exePath, pathSize); } else { RegDeleteValueA(hk, "AlarmClock"); } RegCloseKey(hk); } case WM_LBUTTONDOWN: // so that the window is moveable SendMessage(hwnd, WM_NCLBUTTONDOWN, HTCAPTION, lParam); break; case WM_RBUTTONDOWN: // minimize with right click ShowWindow(hWnd, SW_MINIMIZE); break; case WM_CLOSE: DestroyWindow(hwnd); break; case WM_DESTROY: QUIT: PostQuitMessage(0); break; default: return DefWindowProc(hwnd, msg, wParam, lParam); } return 0; } void Movsb(void* dst, void* src, int bSize) // ASM movsb == Faster than memcpy { _asm { pushad mov esi, [src] mov edi, [dst] mov ecx, [bSize] rep movsb popad } } void GetDayAndMonth(WORD day, WORD month) { char WeekDay[10]; char Month[10]; char Day[10]; ZeroMemory(WeekDay, 10); ZeroMemory(Month, 10); ZeroMemory(Day, 10); ZeroMemory(CurrentDate, sizeof(CurrentDate)); switch(day) // wDayOfWeek { case 0: Movsb(&WeekDay, "Sunday,", 7); break; case 1: Movsb(&WeekDay, "Monday,", 7); break; case 2: Movsb(&WeekDay, "Tuesday,", 8); break; case 3: Movsb(&WeekDay, "Wednesday,", 10); break; case 4: Movsb(&WeekDay, "Thursday,", 9); break; case 5: Movsb(&WeekDay, "Friday,", 7); break; case 6: Movsb(&WeekDay, "Saturday,", 9); break; } switch(month) // wMonth { case 1: Movsb(&Month, "January", 7); break; case 2: Movsb(&Month, "February", 8); break; case 3: Movsb(&Month, "March", 5); break; case 4: Movsb(&Month, "April", 5); break; case 5: Movsb(&Month, "May", 3); break; case 6: Movsb(&Month, "June", 4); break; case 7: Movsb(&Month, "July", 4); break; case 8: Movsb(&Month, "August", 6); break; case 9: Movsb(&Month, "September", 9); break; case 10: Movsb(&Month, "October", 7); break; case 11: Movsb(&Month, "November", 8); break; case 12: Movsb(&Month, "December", 8); break; } sprintf_s(Day, sizeof(Day), " %u", st.wDay); strcat_s(CurrentDate, WeekDay); strcat_s(CurrentDate, " "); strcat_s(CurrentDate, Month); strcat_s(CurrentDate, Day); /* // LOL the way I did it first before I realized I could just strcat, silly me... for(int x = 0; x < sizeof(CurrentDate); x++) { if(WeekDay[x] == 0) { CurrentDate[x] = 0x20; // 0x20 = space theOffset = x + 1; x = 0; for(int c = theOffset; c < sizeof(CurrentDate); c++) { if(Month[x] == 0) { theOffset = c; break; } CurrentDate[c] = Month[x]; x++; } break; } CurrentDate[x] = WeekDay[x]; } char* dest = (char*)&CurrentDate + theOffset; Movsb((void*)dest, (void*)&Day, theSize); */ } void AlarmThread() // plays an mp3 file { ThreadRunning = 1; int count = 0; SendMessageA(hTest, WM_SETTEXT, 0, (LPARAM)"STOP"); ReadMp3(); SendMessageA(hMp3, WM_SETTEXT, 0, (LPARAM)&AlarmMp3); string AlarmSound(AlarmMp3); string Open = "open \"" + AlarmSound + "\" type mpegvideo alias " + AlarmSound; string Play = "play " + AlarmSound + " from 0"; string Close = "close " + AlarmSound; mciSendStringA(Open.c_str(), 0, 0, 0); for(;; Sleep(10)) { if(count > 0) count --; if(count == 0) { mciSendStringA(Play.c_str(), 0, 0, 0); count = 0x555; } if(strcmp(AlarmMp3, "Default.mp3") != 0) { count = 1337; } if(Stop == 2) { Stop = 0; mciSendStringA(Close.c_str(), 0, 0, 0); break; } } ThreadRunning = 0; ExitThread(0); } void MainThread() // displays time, checks for alarms { // third byte is for null termination char hour[3]; char minute[3]; char second[3]; for(;; Sleep(50)) { GetLocalTime(&st); GetDayAndMonth(st.wDayOfWeek, st.wMonth); ZeroMemory(CurrentTime, sizeof(CurrentTime)); _strtime_s(CurrentTime); // separate hours, minutes, and seconds from string // 2 chars = 2 bytes = 1 word // I love type casting :) *(WORD*)hour = *(WORD*)CurrentTime; *(WORD*)minute = *(WORD*)((unsigned int)CurrentTime + 3); *(WORD*)second = *(WORD*)((unsigned int)CurrentTime + 6); hour[2] = 0; // terminate those strings :) minute[2] = 0; second[2] = 0; int hournumber = atoi(hour); // convert hour string into number so we can check for AM or PM if(hournumber > 12) { AMPM = 1; // PM hournumber -= 12; sprintf_s(CurrentTime, sizeof(CurrentTime), "%u:%s:%s PM", hournumber, minute, second); } else if(hournumber == 00) // strangely 12 o' clock AM is 00 o' clock LOL, so fix it { hournumber = 12; sprintf_s(CurrentTime, sizeof(CurrentTime), "%u:%s:%s AM", hournumber, minute, second); } else if(hournumber == 12) // also very wierdly 12 PM shows up as AM so we must fix that too! { AMPM = 1; sprintf_s(CurrentTime, sizeof(CurrentTime), "%u:%s:%s PM", hournumber, minute, second); } else { AMPM = 0; sprintf_s(CurrentTime, sizeof(CurrentTime), "%s:%s:%s AM", hour, minute, second); } SendMessageA(hDate, WM_SETTEXT, 0, (LPARAM)&CurrentDate); SendMessageA(hTime, WM_SETTEXT, 0, (LPARAM)&CurrentTime); // convert hour number back into string so we can check if its time to set off an alarm char hourString[3]; sprintf_s(hourString, sizeof(hourString), "%i", hournumber); if(alarm1 == 1) { hourz = SendMessage(hHour, CB_GETCURSEL, 0, 0); minutez = SendMessage(hMinute, CB_GETCURSEL, 0, 0); pmz = SendMessage(hAMPM, CB_GETCURSEL, 0, 0); if((LRESULT)AMPM == pmz) { if((strcmp(hourString, HoursList[hourz]) == 0) && (strcmp(minute, MinutesList[minutez]) == 0)) { if(ThreadRunning == 0) { //ReadAlarms(); alarm1 = 0; SetAlarms(); ReadAlarms(); Stop = 1; CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&AlarmThread, 0, 0, 0); } } } } if(alarm2 == 1) { hourz = SendMessage(hHour2, CB_GETCURSEL, 0, 0); minutez = SendMessage(hMinute2, CB_GETCURSEL, 0, 0); pmz = SendMessage(hAMPM2, CB_GETCURSEL, 0, 0); if((LRESULT)AMPM == pmz) { if((strcmp(hourString, HoursList[hourz]) == 0) && (strcmp(minute, MinutesList[minutez]) == 0)) { if(ThreadRunning == 0) { //ReadAlarms(); alarm2 = 0; SetAlarms(); ReadAlarms(); Stop = 1; CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&AlarmThread, 0, 0, 0); } } } } if(alarm3 == 1) { hourz = SendMessage(hHour3, CB_GETCURSEL, 0, 0); minutez = SendMessage(hMinute3, CB_GETCURSEL, 0, 0); pmz = SendMessage(hAMPM3, CB_GETCURSEL, 0, 0); if((LRESULT)AMPM == pmz) { if((strcmp(hourString, HoursList[hourz]) == 0) && (strcmp(minute, MinutesList[minutez]) == 0)) { if(ThreadRunning == 0) { //ReadAlarms(); alarm3 = 0; SetAlarms(); ReadAlarms(); Stop = 1; CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&AlarmThread, 0, 0, 0); } } } } } } void HotkeyHandler() // hides/unhides window on CTRL + ALT + A { int ShowOrHide = 1; for(;; Sleep(10)) // you need sleeps in indefinate loops for non 100% CPU usage { if((GetKeyState(VK_CONTROL) & 0x8000) && (GetKeyState(VK_MENU) & 0x8000) && (GetKeyState(0x41) < 0)) { //SW_SHOWNORMAL = 1, SW_HIDE = 0 _asm xor [ShowOrHide], 1 // toggle 1, 0 ShowWindow(hWnd, ShowOrHide); if(ShowOrHide == 1) SetForegroundWindow(hWnd); Sleep(250); // so 1 key press wont hide and show it } } } int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int ClockWidth = 331, ClockHeight = 429, ScreenPosX, ScreenPosY; HBITMAP ClockBMP; HBRUSH ClockBrush; hInst = hInstance; ClockBMP = LoadBitmap(hInstance, MAKEINTRESOURCE(102)); ClockBrush = CreatePatternBrush(ClockBMP); WNDCLASSEX wc; MSG Msg; wc.cbSize = sizeof(WNDCLASSEX); wc.style = 0; wc.lpfnWndProc = WndProc; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hInstance = hInstance; wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(101)); wc.hCursor = LoadCursor(NULL, IDC_ARROW); wc.hbrBackground = ClockBrush; wc.lpszMenuName = NULL; wc.lpszClassName = L"AlarmClock_Class"; wc.hIconSm = LoadIcon(hInstance, MAKEINTRESOURCE(101)); RegisterClassEx(&wc); int ScreenWidth = GetSystemMetrics(SM_CXSCREEN); int ScreenHeight = GetSystemMetrics(SM_CYSCREEN); ScreenPosX = (ScreenWidth / 2) - ClockWidth; ScreenPosY = (ScreenHeight / 2) - ClockHeight; // Even though WS_MINIMIZEBOX doesn't get displayed it lets you minimize by clicking the tab on task bar hWnd = CreateWindowExA(WS_EX_LEFT, "AlarmClock_Class", "$teve's Alarm Clock", WS_POPUP | WS_MINIMIZEBOX, ScreenPosX, ScreenPosY, ClockWidth, ClockHeight, NULL, NULL, hInstance, NULL); CreateButtonEx("X", 260, 60, 20, 15, 420); hDate = CreateTextEx(CurrentDate, 90, 140, 150, 20, 500); hTime = CreateTextEx(CurrentTime, 120, 161, 90, 20, 501); CreateTextEx("Alarm 1:", 35, 210, 60, 24, 502); CreateTextEx("Alarm 2:", 35, 240, 60, 24, 503); CreateTextEx("Alarm 3:", 35, 270, 60, 24, 504); hTest = CreateButtonEx("TEST ALARM", 55, 182, 100, 24, 422); hSet = CreateButtonEx("SAVE ALARMS", 165, 182, 100, 24, 421); //Alarm 1 hHour = CreateDropDownEx(0, 100, 210, 45, 300, 600); hMinute = CreateDropDownEx(0, 145, 210, 45, 300, 601); hAMPM = CreateDropDownEx(0, 190, 210, 60, 100, 602); hCheck = CreateCheckEx("OFF", 250, 210, 48, 25, 700); //Alarm2 hHour2 = CreateDropDownEx(0, 100, 240, 45, 300, 603); hMinute2 = CreateDropDownEx(0, 145, 240, 45, 300, 604); hAMPM2 = CreateDropDownEx(0, 190, 240, 60, 100, 605); hCheck2 = CreateCheckEx("OFF", 250, 240, 48, 25, 701); //Alarm3 hHour3 = CreateDropDownEx(0, 100, 270, 45, 300, 606); hMinute3 = CreateDropDownEx(0, 145, 270, 45, 300, 607); hAMPM3 = CreateDropDownEx(0, 190, 270, 60, 100, 608); hCheck3 = CreateCheckEx("OFF", 250, 270, 48, 25, 702); hLoad = CreateButtonEx("Load", 215, 300, 50, 25, 423); hMp3 = CreateEditEx(0, 70, 300, 135, 22, 900); hStartUp = CreateCheckEx("Start With Windows", 90, 340, 150, 25, 703); // Fill List Boxes With Strings for(int i = 0; i < 12; i++) { SendMessageA(hHour, CB_ADDSTRING, 0, (LPARAM)HoursList[i]); SendMessageA(hHour2, CB_ADDSTRING, 0, (LPARAM)HoursList[i]); SendMessageA(hHour3, CB_ADDSTRING, 0, (LPARAM)HoursList[i]); } SendMessageA(hHour, CB_SETCURSEL, 0, 0); SendMessageA(hHour2, CB_SETCURSEL, 0, 0); SendMessageA(hHour3, CB_SETCURSEL, 0, 0); for(int i = 0; i < 6; i++) { SendMessageA(hMinute, CB_ADDSTRING, 0, (LPARAM)MinutesList[i]); SendMessageA(hMinute2, CB_ADDSTRING, 0, (LPARAM)MinutesList[i]); SendMessageA(hMinute3, CB_ADDSTRING, 0, (LPARAM)MinutesList[i]); } SendMessageA(hMinute, CB_SETCURSEL, 0, 0); SendMessageA(hMinute2, CB_SETCURSEL, 0, 0); SendMessageA(hMinute3, CB_SETCURSEL, 0, 0); SendMessageA(hAMPM, CB_ADDSTRING, 0, (LPARAM)AMorPM[0]); SendMessageA(hAMPM, CB_ADDSTRING, 0, (LPARAM)AMorPM[1]); SendMessageA(hAMPM, CB_SETCURSEL, 0, 0); SendMessageA(hAMPM2, CB_ADDSTRING, 0, (LPARAM)AMorPM[0]); SendMessageA(hAMPM2, CB_ADDSTRING, 0, (LPARAM)AMorPM[1]); SendMessageA(hAMPM2, CB_SETCURSEL, 0, 0); SendMessageA(hAMPM3, CB_ADDSTRING, 0, (LPARAM)AMorPM[0]); SendMessageA(hAMPM3, CB_ADDSTRING, 0, (LPARAM)AMorPM[1]); SendMessageA(hAMPM3, CB_SETCURSEL, 0, 0); ReadAlarms(); RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Windows\\CurrentVersion\\Run", 0, KEY_READ, &hk); RegQueryValueExA(hk, "AlarmClock", 0, 0, (LPBYTE)exePath, &BufSize); if(exePath[1] == 0x3A) // 0x3A == ":" which means its been added to the registry already { SendMessage(hStartUp, BM_SETCHECK, 1, 0); } RegCloseKey(hk); ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&MainThread, 0, 0, 0); CreateThread(0, 0, (LPTHREAD_START_ROUTINE)&HotkeyHandler, 0, 0, 0); // Message Pump while(GetMessage(&Msg, NULL, 0, 0) > 0) { TranslateMessage(&Msg); DispatchMessage(&Msg); } return Msg.wParam; } // I like to use functions like these to make the code above more readable HWND CreateButtonEx(char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(0, "BUTTON", Text, WS_CHILD | WS_VISIBLE, x, y, wd, ht, hWnd, (HMENU)id, hInst, 0); } HWND CreateEditEx(char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(WS_EX_CLIENTEDGE, "EDIT", Text, WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_NOHIDESEL | WS_TABSTOP, x, y, wd, ht, hWnd, (HMENU)id, hInst, 0); } HWND CreateTextEx(char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(WS_EX_STATICEDGE, "STATIC", Text, WS_CHILD | WS_VISIBLE | SS_LEFT, x, y, wd, ht, hWnd, (HMENU)id, hInst, 0); } HWND CreateCheckEx(char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(0, "BUTTON", Text, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, x, y, wd, ht, hWnd, (HMENU)id, hInst, 0); } HWND CreateDropDownEx(char Text[64], int x, int y, int wd, int ht, int id) { return CreateWindowExA(0, "COMBOBOX", Text, WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | CBS_HASSTRINGS, x, y, wd, ht, hWnd, (HMENU)id, hInst, 0); } Man I love c++ :P
  19. Thats a cool idea! I like it, theres only one flaw to it though... It requires you to be listening to music in order for the image to change... So if you stopped listening to music it would show the last song you listened to until you listen to something else... Instead I like the idea of a randomly changing image, on its own without having to listen to music or have any interaction on your part... I know one person who has this sort of thing on his signature, it has his name in a cool image that changes to a random set of images that have the same name with different backgrounds and such... It's really neat as he has a different signature every time you refresh the page... I was trying to think of ways to accomplish this, one idea I had is to make a program that runs in the background of my computer and every second that goes by, it overwrites my signature image, with 1 from a set of images to display... that way every refresh of a page, will produce a different signature image... the way works pretty good as you can see my signature changes every second, between 6 different images Is there anyway to embed an image on a website, and then when your webserver gets a request for that image to send image data from a set of images instead of the person only getting that 1 image? theres gotta be a way... the only way I can think of maybe is modifying apache's source code so that when someone requests a particular image (the one you want to randomize) generate a random number between 1 and the number of images you have to display, and then send that image data... its a thought! :) I'll post the source code to the image rotator if anyone wants it... its written in MASM32 for low memory usage and maximum performance.. EDIT: okay 1 second is too often I changed to every two seconds now... ok whatever I'll just post it anyway... but I wont post the binary only the source so you'll have to compile it yourself! You'll have to change a couple things anyway to customize it for you... It has a hide feature, press CONTROL + ALT + I all at the same time to hide/unhide the window of the program, this way you don't have to look at it the whole time while letting it do its job It will also add it self to the registry to start with windows if desired, just change RegistryAdd to 0 if you don't want that... Change the "YourName.png" to whatever the name of the image is that you embed on a website Change the "Img\YourName%u.png" to whatever the name of the images you want rotated are.. Example for me i have "Steve8x.png" located in the same folder on my webserver as the imgRotate.exe then I have a folder named "Img" in there, and inside that folder I have "Steve1.png", "Steve2.png", "Steve3.png" etc... Pretty simple to use... heres the code :) its only 4KB when compiled ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« .486 ; create 32 bit code .model flat, stdcall; 32 bit memory model option casemap :none; case sensitive ; include files ; ~~~~~~~~~~~~~ include \masm32\include\windows.inc include \masm32\include\masm32.inc include \masm32\include\gdi32.inc include \masm32\include\user32.inc include \masm32\include\kernel32.inc include \masm32\include\Comctl32.inc include \masm32\include\comdlg32.inc include \masm32\include\shell32.inc include \masm32\include\oleaut32.inc include \masm32\include\dialogs.inc include \masm32\include\advapi32.inc include \masm32\macros\macros.asm ; libraries ; ~~~~~~~~~ includelib \masm32\lib\masm32.lib includelib \masm32\lib\gdi32.lib includelib \masm32\lib\user32.lib includelib \masm32\lib\kernel32.lib includelib \masm32\lib\Comctl32.lib includelib \masm32\lib\comdlg32.lib includelib \masm32\lib\shell32.lib includelib \masm32\lib\oleaut32.lib includelib \masm32\lib\advapi32.lib DlgProc PROTO :DWORD, :DWORD, :DWORD, :DWORD ; Easy Registry Functions For Strings SetRegKeysz PROTO :DWORD, :DWORD, :DWORD, :DWORD GetRegKeysz PROTO :DWORD, :DWORD, :DWORD, :DWORD .data RegistryAdd db 1; change this to zero if you don't want it to start up with windows FileName dd 0 EXEpath dd 0 OvrWrite db 'YourName.png',0; change this to the image you want to overwrite SaveName db 'Img\YourName%u.png',0; change this to the images you want rotated, leave the %u rKey db 'SOFTWARE\Microsoft\Windows\CurrentVersion\Run',0 imgNum dd 01 bufSize db 255 .data? hWnd dd ? hInstance dd ? pathLength dd ? .code ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« start: mov hInstance, FUNC(GetModuleHandle,NULL) call main invoke ExitProcess,eax ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« main proc Dialog "MASM Image Rotater", \ ; caption "MS Sans Serif",10, \ ; font,pointsize WS_OVERLAPPED or \ ; styles for WS_SYSMENU or DS_CENTER, \; dialog window 2, \ ; number of controls 50,50,98,30, \ ; x y co-ordinates 1024 ; memory buffer size DlgButton "Quit",WS_TABSTOP, 62, 2, 30, 13, IDCANCEL DlgStatic "Coded By Steve8x", SS_LEFT, 2, 5, 60, 9, 100 CallModalDialog hInstance,0,DlgProc,NULL ret main endp ImgRotate proc stralloc 256 mov [FileName], eax stralloc 255 mov [EXEpath], eax invoke GetRegKeysz, [EXEpath], addr rKey, SADD("ImgRotator"), addr bufSize mov eax, [EXEpath] .if (byte ptr [eax+1] != ':') && ([RegistryAdd] == 1); then it hasn't been added to the registry yet and you want it invoke GetModuleFileNameA, FUNC(GetModuleHandle, 0), [EXEpath], 255 invoke lstrlen, [EXEpath] mov [pathLength], eax invoke SetRegKeysz, [EXEpath], addr rKey, SADD("ImgRotator"), [pathLength] .endif strfree EXEpath ForeverLoop: .if byte ptr [imgNum] == 7; change this to the number of images you have plus 1 mov byte ptr [imgNum], 1 .endif pushad invoke wsprintf, [FileName], addr SaveName, [imgNum] ;invoke OutputDebugStringA, [FileName]; for debug purposes popad invoke CopyFile, [FileName], addr OvrWrite, FALSE add [imgNum], 1 invoke Sleep, 2000 jmp ForeverLoop ImgRotate endp HotkeyHandler proc LOCAL showhide:DWORD mov [showhide], 1 HandleKey: invoke Sleep, 10; For Anti-Lag / NON 100% CPU usage, you should already know this invoke GetKeyState, VK_CONTROL; CONTROL key and al, 80h cmp al, 0 jz HandleKey invoke GetKeyState, VK_MENU; ALT key and al, 80h cmp al, 0 jz HandleKey invoke GetKeyState, 49h; I key and al, 80h cmp al, 0 jz HandleKey ; If all keys CTRL + ALT + I are simultaneously pressed the execution will reach here xor [showhide], 1 ; 1 = SW_SHOWNORMAL, 0 = SW_HIDE invoke ShowWindow, [hWnd], [showhide]; If showhide == 1 it will show the window, 0 it will hide it;) invoke Sleep, 250; so it wont hide/unhide really quickly, if you don't know what i mean try it without jmp HandleKey HotkeyHandler endp ; ««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««« DlgProc proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD Switch uMsg Case WM_INITDIALOG invoke CreateThread, 0, 0, addr HotkeyHandler, 0, 0, 0 invoke CreateThread, 0, 0, addr ImgRotate, 0, 0, 0 invoke SendMessage, [hWin], WM_SETICON, 1, FUNC(LoadIcon, NULL, IDI_WARNING) m2m hWnd, hWin return 1 Case WM_COMMAND .if wParam == IDCANCEL jmp quit_dialog .endif Case WM_CLOSE quit_dialog: strfree FileName invoke EndDialog,hWin,0 EndSw return 0 DlgProc endp ; ------------------------------------------------------------------------- SetRegKeysz PROC lpszString:DWORD, lpszKeyName:DWORD, lpszValueName:DWORD, dwStringLength LOCAL Disp :DWORD LOCAL pKey :DWORD invoke RegCreateKeyEx, HKEY_LOCAL_MACHINE, lpszKeyName, NULL, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, addr pKey, addr Disp .if eax == ERROR_SUCCESS invoke RegSetValueEx, pKey, lpszValueName, NULL, REG_SZ, lpszString, dwStringLength invoke RegCloseKey, pKey .endif ret SetRegKeysz ENDP ; ------------------------------------------------------------------------- GetRegKeysz PROC lpszBuffer:DWORD, lpszKeyName:DWORD, lpszValueName:DWORD, dwStringLength:DWORD LOCAL TType :DWORD LOCAL pKey :DWORD mov TType, REG_SZ invoke RegCreateKeyEx, HKEY_LOCAL_MACHINE, lpszKeyName, NULL, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, addr pKey, addr TType .if eax == ERROR_SUCCESS mov eax, REG_DWORD mov [TType], eax invoke RegQueryValueEx, pKey, lpszValueName, NULL, ADDR TType, lpszBuffer, dwStringLength invoke RegCloseKey, pKey .endif ret GetRegKeysz ENDP end start
  20. You scowl at my post? there isn't anything wrong with my code! right? *Steve8x Smiles
  21. Well maybe I'm just so in love with C++ that I wont mess around with VB(a downgrade) or even C#(because to me it looks kinda like VB) and I despise VB syntax... Yes but you do agree that VB teaches bad practices so thats something we can agree upon... But to anyone out there messing around with VB, DO WORRY IF THE PC ITS SUPPOSED TO RUN ON LACKS "MSVBVM60.DLL" mwhahahaha :)
  22. LOL notice the number of views for this thread, no I didn't edit the image thats just what it was! a fluke!
  23. Well you didn't specify what your are coding in, if its VB you should change to something more powerful! like C++ for example! MASM32 also excellent choice :) I strongly hate VB with a passion, its some str8 up script kiddie shit! learn a real language and stop messing around... VB can't create more than a fancy GUI which does practically nothing... so if thats what intrigues you learn Win32 API and draw your windows with code, RegisterClassEx, CreateWindowEx, its easier than it seems at first, and you'll enjoy making GUI applications much more when you understand the little details behind it... Well I write my C++ programs with Microsoft Visual C++ 2008 And yes on my old computer any program I made with 2008 would not run! I solved the problem by installing the Microsoft Visual C++ 2008 Redistributable Package! available for download directly from Microsoft link: http://www.microsoft.com/downloads/details...;displaylang=en
  24. Yes nicatronTg is exactly right! you don't need source code to run a binary executable... lolz dejay or whatever your name is, you are 100% wrong!!! why on earth would you need source code to embed binary data in an executable program of your own? nicatronTg I thought you were going to post an example program? I guess you forgot! well I'll do it... okay I whipped up this program in 5 minutes! its really simple, I use this method all the time when making my directx games, I like to embed the textures and sounds and all that good stuff within the executable file it self that way I dont leave things in a folder somewhere for someone to mess with... its all hidden inside the games executable where noobs wont even mess with... I use Hex Workshop to take a file's bytes and format it in an unsigned char array that is ready to copy and paste right into your source code(I like to make a header file to store the binary data as it is a huge array even with a small file, so instead of making the main source code a difficult to scroll through file I just put it in a header file and keep my source code file clean) in hex workshop goto Edit->select all, then Edit->Copy As-> C Source In this example I will be using calc.exe just to demonstrate exactly how easy this is... Im using Microsoft Visual C++ 2008 by the way(you might have to modify it slightly to work for other compilers) Ok I have created a blank console project(I hate the precompiled header) then added a .cpp called "ExeInExe.cpp" then I wrote this code: yeah I just had to post because DJ said it was not possible without source code LOL !! :P #include <windows.h> // all required headers #include <stdio.h> #include <fstream> #include <iostream> #include "CalcData.h" // where the binary data for "calc.exe" is stored using namespace std; char EXEfile[256]; // will hold the path to the executable to run once extracted from this console executable int main() { SetConsoleTitleA("Steves Embed File Into Executable Example"); system("color 0A"); GetSystemDirectoryA(EXEfile, 256); // get system dir to hide exe file ex. C:\WINDOWS\system32 strcat_s(EXEfile, "\\secret"); // append our secret dir CreateDirectoryA(EXEfile, 0); // create the folder strcat_s(EXEfile, "\\EmbeddedCalc.exe"); // concatenate file name to it so we save the exe into this new folder ofstream EXE(EXEfile, ios::binary); // create the file at the specified secret path ios::binary for binary data EXE.write((char*)&Calc, sizeof(Calc)); // write the calc binary data to the file EXE.close(); // save and close the file cout << "Saved EXE file to: " << EXEfile << "\n"; // print out where it was saved to console cout << "Running exported exe file in\n\n"; for(int x = 3; x > 0; x--) // count down 3 2 1 RUN!!! // count down to execution { cout << x << "...\n"; Sleep(1000); } // finally use shellexecute to execute the file, better than system() ShellExecuteA(0, "open", EXEfile, 0, 0, SW_SHOWNORMAL); // or you could use SW_HIDE to create the window hidden hehe! :) cout << "\n\n\n\n"; system("pause"); return 0; } CalcData.h is way to big to post here so ive gone ahead and uploaded the whole project to this link: http://rapidshare.com/files/122239169/ExeInExe.rar.html or you can just use hex workshop and make it yourself from calc, and change the name of the unsigned char array to "Calc" Thats how its done :)
×
×
  • Create New...