Administrator Tools - Delphijustin industries https://delphijustin.biz Making use out of things! Thu, 14 Oct 2021 01:46:30 +0000 en-US hourly 1 https://wordpress.org/?v=6.2.9 https://delphijustin.biz/wp-content/uploads/2025/10/cropped-dongwa-192-32x32.png Administrator Tools - Delphijustin industries https://delphijustin.biz 32 32 Offline, online and reconnect tool https://delphijustin.biz/offline-online-and-reconnect-tool/?utm_source=rss&utm_medium=rss&utm_campaign=offline-online-and-reconnect-tool https://delphijustin.biz/offline-online-and-reconnect-tool/#respond Fri, 10 Sep 2021 00:50:22 +0000 https://delphijustin.biz/?p=3867 This tool checks the internet connection to see what Internet Provider your using. Good for VPNs and getting your server back online. You can use reconnect.bat file to help fix network problems or alert you when you lost connection or your ISP Name has changed. To make your batch detect first open your command prompt …

The post Offline, online and reconnect tool first appeared on Delphijustin industries.

]]>
This tool checks the internet connection to see what Internet Provider your using. Good for VPNs and getting your server back online. You can use reconnect.bat file to help fix network problems or alert you when you lost connection or your ISP Name has changed. To make your batch detect first open your command prompt and find the folder where you downloaded reconnect.exe then type the following:

reconnect.exe /info

It will then give you the set of parameters that will be passed to the batch file for that connection. With that being known you can open the batch file up in Notepad and follow the instructions there. Although ip-api.com limits the number of request to 45 per minute, it is still better than the older ones in the past.

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

The post Offline, online and reconnect tool first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/offline-online-and-reconnect-tool/feed/ 0
Text file converter https://delphijustin.biz/text-file-converter/?utm_source=rss&utm_medium=rss&utm_campaign=text-file-converter https://delphijustin.biz/text-file-converter/#respond Wed, 10 Feb 2021 15:05:23 +0000 https://delphijustin.biz/?p=2737 This tool allows you to convert text files from one to another, making them compatible with different programs and operating systems. Linux most likely uses UTF-8 and Windows uses ANSI

The post Text file converter first appeared on Delphijustin industries.

]]>
This tool allows you to convert text files from one to another, making them compatible with different programs and operating systems.

Linux most likely uses UTF-8 and Windows uses ANSI

program convtext;

{$APPTYPE CONSOLE}
//source code for convtext
{$R *.res}
{$RESOURCE CONVTEXT-RES.RES}
uses
  System.SysUtils,
  windows,
  classes;

var sl:tstringlist;
hf1,hf2:thandle;
function typeStr(stype:string):Tencoding;
begin
  if comparetext('ansi',stype)=0 then
  result:=tencoding.ANSI else
  if comparetext('ascii',stype)=0 then
  result:=tencoding.ASCII else
  if comparetext('unicode',stype)=0 then
  result:=tencoding.Unicode else
  if comparetext('utf-7',stype)=0 then
  result:=tencoding.UTF7 else
  if comparetext('utf-8',stype)=0 then
  result:=tencoding.UTF8 else
  raise Exception.Create('Unknown Format Specified');
end;

begin
  try
  if paramcount<3 then
  begin
    writeln('Changes the encoding of a text file');
    writeln('Usage: ',extractfilename(paramstr(0)),
    ' input_file output_flle [in_format] out_format');
    writeln('Supported Formats:');
    writeln('ANSI');
    writeln('ASCII');
    writeln('Unicode');
    writeln('UTF-7');
    writeln('UTF-8');
    writeln;
    write('Press enter to quit...');
    readln;
    exitprocess(0);
  end;
  sl:=tstringlist.Create;
  if paramcount=4 then
  sl.LoadFromFile(paramstr(1),TypeStr(paramstr(3)))else
  sl.LoadFromFile(paramstr(1));
  sl.SaveToFile(paramstr(2),typestr(paramstr(paramcount)));
  writeln(syserrormessage(0));
  hf1:=createfile(pchar(paramstr(1)),generic_read,0,nil,open_existing,
  file_attribute_normal,0);
  hf2:=createfile(pchar(paramstr(2)),generic_read,0,nil,open_existing,
  file_attribute_normal,0);
  writeln('Original filesize: ',getfilesize(hf1,nil),' bytes');
  writeln('Converted filesize: ',getfilesize(hf2,nil),' bytes');
  writeln('Converted Percentage: ',round(100*(getfilesize(hf2,nil)/getfilesize(hf1,nil))),'%');
  closehandle(hf1);
  closehandle(hf2);
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

The post Text file converter first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/text-file-converter/feed/ 0
Search Nanny https://delphijustin.biz/search-nanny/?utm_source=rss&utm_medium=rss&utm_campaign=search-nanny https://delphijustin.biz/search-nanny/#respond Thu, 04 Feb 2021 21:20:27 +0000 https://delphijustin.biz/?p=2682 This tool allows you to force safe search on Google, Bing,DuckDuckGo and YouTube. It even has a website blocker. It should even work on linux systems via wine. You can set it up through the network via network drive. Export ALSO MAKE SURE TO RUN AS ADMINISTRATOR.

The post Search Nanny first appeared on Delphijustin industries.

]]>
This tool allows you to force safe search on Google, Bing,DuckDuckGo and YouTube. It even has a website blocker. It should even work on linux systems via wine. You can set it up through the network via network drive. Export

ALSO MAKE SURE TO RUN AS ADMINISTRATOR.

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

The post Search Nanny first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/search-nanny/feed/ 0
ExecOnce https://delphijustin.biz/execonce/?utm_source=rss&utm_medium=rss&utm_campaign=execonce https://delphijustin.biz/execonce/#respond Tue, 26 Jan 2021 23:19:02 +0000 https://delphijustin.biz/?p=2610 This tool executes a batch script once during the whole time the computer is on. It can limit one instance running at a time. Check the process ID in the registry to see if it is still running. All Keys that are used for telling if it should spawn a new process are volatile, meaning …

The post ExecOnce first appeared on Delphijustin industries.

]]>
This tool executes a batch script once during the whole time the computer is on. It can limit one instance running at a time. Check the process ID in the registry to see if it is still running. All Keys that are used for telling if it should spawn a new process are volatile, meaning they are in memory not on the HDD. This tool works on Windows XP or higher or Server 2003 or higher. This tool is great for Citrix users and Terminal server users, where the startup apps can execute more than once. For server programs(like UnrealIRCd) where it creates a TCP/UDP port(yeah this could be a problem with putting it in startup and have two people under the same account logon).

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

To see how to use it just open it with no parameters

The post ExecOnce first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/execonce/feed/ 0
QInstall An alternative to Windows uninstaller https://delphijustin.biz/qinstall-an-alternative-to-windows-uninstaller/?utm_source=rss&utm_medium=rss&utm_campaign=qinstall-an-alternative-to-windows-uninstaller https://delphijustin.biz/qinstall-an-alternative-to-windows-uninstaller/#comments Wed, 04 Dec 2019 03:55:35 +0000 https://delphijustin.biz/?p=793 This tool allows you to uninstall programs as well as see when they were installed. It lets you search through the apps. It can remove files left over by the program. It can clean clean the uninstall registry key. To see how to use it just open the exe file.

The post QInstall An alternative to Windows uninstaller first appeared on Delphijustin industries.

]]>
This tool allows you to uninstall programs as well as see when they were installed. It lets you search through the apps. It can remove files left over by the program. It can clean clean the uninstall registry key.

To see how to use it just open the exe file.

QInstall query on Pale Moon
program qinstall;

{$apptype console}
{$RESOURCE QINSTALL-32.RES}
uses
  SysUtils,filectrl,
  windows,shellapi,
  Classes;
const KiloBytes=1.0;
MegaBytes=1024*kilobytes;
GigaBytes=1024*megabytes;
ERROR_REGOPENKEY='RegOpenKey: %s';
prompt_yesno='Type yes or no: ';
filesize_fmt='#,##0.000';
reg_installdir='InstallLocation';
error_regdeletekey='RegDeleteKey: %s';
error_regqueryvalueex='RegQueryValueEx: %s';
var uninstallkey:hkey;
appcount:dword;
ftUninstall:filetime;
Command_Switch:String;
stinfo:systemtime;
err:longint;

function FormatLanguage(lpLang:pchar):string;
var langs:tstringlist;
begin
langs:=tstringlist.Create;
langs.CommaText:=stringreplace(lpLang,';',',',[rfReplaceall]);
result:=langs[0];
langs.Free;
end;

function GetLanguageID(lang:word):string;
var hklangs:hkey;
rs:dword;
langsz:array[0..4]of char;
language:array[0..128]of char;
begin
rs:=129;
regopenkey(hkey_classes_root,'MIME\Database\Rfc1766',hklangs);
regqueryvalueex(hklangs,Strpcopy(langsz,inttohex(lang,4)),nil,nil,@language,@rs);
regclosekey(hklangs);result:=formatlanguage(language);
end;

function FormatRegValue(const RegName:string;data:array of byte;
DataType:dword):String;
var x,y:extended;
lpdw:pdword;
lpStr:pchar;
metric:char;
begin
lpdw:=@data[0];
lpstr:=@data[0];
result:=regname+':';
if lowercase(regname)='estimatedsize'then begin x:=lpdw^;metric:='K';y:=x;
if x>=megabytes then begin y:=x/megabytes;metric:='M';end;
if x>=gigabytes then begin y:=x/gigabytes;metric:='G';end;
result:=result+formatfloat(filesize_fmt,y)+#32+Metric+'B';
end else if lowercase(regname)='language'then result:=result+GetLanguageID(lpdw^)
else case datatype of
reg_sz,reg_expand_sz:result:=regname+':'+strpas(lpstr);
reg_dword:result:=regname+':'+inttostr(lpdw^);
end;
end;

procedure listsoftware;
var i,j:integer;
st:systemtime;
hkapp:hkey;
ftinstalled:filetime;
progname,vname:array[0..max_path]of char;
value:array[0..2048]of byte;
vcount,typ,rs,ns:dword;
begin
for i:=0to appcount-1do
begin
regenumkey(uninstallkey,i,progname,max_path);
if(pos(lowercase(paramstr(2)),lowercase(progname))>0)or(paramcount=1)then begin
writeln('AppName:',progname);
regopenkey(uninstallkey,progname,hkapp);
regqueryinfokey(hkapp,nil,nil,nil,nil,nil,nil,@vcount,nil,nil,nil,@ftinstalled);
filetimetosystemtime(ftinstalled,st);
writeln('Program installed: ',datetimetostr(systemtimetodatetime(st)));
for j:=0to vcount-1 do begin ns:=max_path;rs:=2048;regenumvalue(hkapp,j,vname,ns,
nil,@typ,@value,@rs);writeln(formatregvalue(vname,value,typ));end;
regclosekey(hkapp);writeln;
end;
end;
end;

procedure uninstallinfo;
begin
writeln('Last Install/Uninstall: ',datetimetostr(systemtimetodatetime(stinfo)));
writeln('There are ',formatfloat('#,###',appcount),' programs installed');
end;

function execString(commandline:pchar):longint;
var urlexec:shellexecuteinfo;
confirm:string;
label badconfirm,skipconfirm;
begin
result:=0;
if lowercase(paramstr(4))='/yes'then confirm:='yes';
if confirm='yes' then goto skipconfirm;
badconfirm:write(prompt_yesno);
readln(confirm);
if(confirm<>'yes')and(confirm<>'no')then goto badconfirm;
if confirm='no'then exit;
skipconfirm:
result:=winexec(commandline,sw_show);
if result<32 then begin zeromemory(@urlexec,sizeof(urlexec));urlexec.cbSize:=
sizeof(urlexec);urlexec.fMask:=see_mask_nocloseprocess or see_mask_flag_no_ui;
result:=33;urlexec.lpFile:=commandline;urlexec.nShow:=sw_show;
if not shellexecuteex(@urlexec)then begin result:=urlexec.hInstApp;exit;end;
waitforsingleobject(urlexec.hprocess,infinite);closehandle(urlexec.hProcess);
end;
end;

function removetree(const Dir:string):longint;
var comspec,params:array[0..max_path+15]of char;
shellexec:shellexecuteinfo;
begin
getenvironmentvariable('ComSpec',comspec,max_path+15);
zeromemory(@shellexec,sizeof(shellexec));
shellexec.cbsize:=sizeof(shellexec);
shellexec.lpfile:=comspec;
shellexec.lpparameters:=strplcopy(params,'/C RD /S /Q "'+dir+'"',max_path+15);
shellexec.fMask:=see_mask_nocloseprocess or see_mask_no_console or
SEE_MASK_FLAG_NO_UI;
shellexec.nShow:=sw_show;
result:=33;
if not shellexecuteex(@shellexec)then begin result:=shellexec.hInstApp;exit;end;
waitforsingleobject(shellexec.hprocess,infinite);
closehandle(shellexec.hProcess);
end;

procedure RemoveFiles;
var confirm:string;
installdir,progname:array[0..max_path]of char;
rs:dword;
hkapp:hkey;
err:longint;
label badconfirm1,skipwarning;
begin
if paramcount<2 then raise exception.Create('Need more parameters');
err:=regopenkey(uninstallkey,strplcopy(progname,paramstr(2),max_path),hkapp);
if err<>error_success then raise exception.CreateFmt(Error_regopenkey,[
syserrormessage(err)]);
rs:=max_path+1;
err:=regqueryvalueex(hkapp,reg_installdir,nil,nil,@installdir,@rs);
if err<>error_success then raise exception.CreateFmt(ERROR_REGQUERYVALUEEX,[
syserrormessage(err)]);
if uppercase(paramstr(3))='/YES'then confirm:='yes';
if confirm='yes'then goto skipwarning;
writeln('Warning you are about to delete everything in "',installdir,'" continue?');
badconfirm1:
write(prompt_yesno);readln(confirm);confirm:=lowercase(confirm);
skipwarning:
case confirm[1] of
'y':begin removetree(installdir);regclosekey(hkapp);err:=regdeletekey(
uninstallkey,progname);if err<>error_success then writeln(error_regdeletekey,
syserrormessage(err));exit;end;
'n':writeln('Deletion canceled');
end;
regclosekey(hkapp);
end;

procedure cleanregistry;
var szPath,progname:array[0..max_path]of char;
hkapp:hkey;
rs:dword;
i:integer;
err:longint;
begin
for I:=0to appcount-1do begin regenumkey(uninstallkey,i,progname,max_path);
strcopy(szpath,'');rs:=max_path+1;regopenkey(uninstallkey,progname,hkapp);
regqueryvalueex(hkapp,reg_installdir,nil,nil,@szpath,@rs);regclosekey(hkapp);
if(strlen(szPath)>0)and(not directoryexists(szpath))then begin err:=regdeletekey(
uninstallkey,progname);if err<>error_success then writeln('Found:',progname,' - ',
syserrormessage(err));
end;
end;
end;

procedure searchexec;
var hkapp:hkey;
progname,cmdline1,cmdline2,szName:array[0..max_path]of char;
typ,err,rs:dword;
i:integer;
begin
if paramcount<3then raise Exception.Create('Need search_text and method strings');
strpcopy(szName,paramstr(2));
for i:=0to appcount-1do begin regenumkey(uninstallkey,i,progname,max_path);
if pos(lowercase(paramstr(3)),lowercase(progname))>0then begin writeln('Found:',
progname);
err:=regopenkey(uninstallkey,progname,hkapp);
if err<>error_success then raise exception.CreateFmt(error_regopenkey,[
syserrormessage(err)]);
rs:=max_path+1;
err:=regqueryvalueex(hkapp,szname,nil,@typ,@cmdline1,@rs);
if err<>error_success then begin regclosekey(hkapp);raise exception.CreateFmt(
error_regqueryvalueex,[syserrormessage(err)]);end;
case typ of
reg_sz:strcopy(cmdline2,cmdline1);
reg_expand_sz:expandenvironmentstrings(cmdline1,cmdline2,max_path);
else raise
exception.CreateFmt('The value "%s" is not a REG_SZ or REG_EXPAND_SZ value',[
paramstr(2)]);
end;//case end
err:=execstring(cmdline2);
if(err<33)and(err>0)then writeln('ExecError:',syserrormessage(err));
regclosekey(hkapp);
end;
end;
end;

begin
if paramcount=0then begin
writeln('Usage: ',extractfilename(paramstr(0)),' [/LIST "seach_text"] [/EXEC "method" "search_text" [/YES]] [/REM "appname" [/YES]] [/CLEAN] [/INFO]');
writeln('Parameters:');
writeln('/LIST         Lists software that is installed on here. The next parameter is the optional search text.');
writeln('/EXEC         Executes a string found in the app that matches ["search_text"]');
writeln('method string can be QuietUninstallString,UninstallString,URLInfoAbout,HelpLink,URLUpdateInfo, or Readme');
writeln('/CLEAN        Removes any uninstaller registry information left over by an uninstalled program.');
writeln('/INFO         Shows last install/uninstall information');
writeln('/REM          Remove the directory of files left over. This should be used only when the program fails to uninstall. To uninstall a program use /EXEC command switch with "UninstallString" as the method');
writeln('/YES          Automatically use yes option on prompts');
write('Press enter to return...');readln;exitprocess(0);
end;
try
err:=regopenkey(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall',uninstallkey);
if err<>error_success then raise exception.CreateFmt(error_regopenkey,[
syserrormessage(err)]);
err:=regqueryinfokey(uninstallkey,nil,nil,nil,@appcount,nil,nil,nil,nil,nil,nil,
@ftuninstall);filetimetosystemtime(ftuninstall,stinfo);
if err<>error_success then raise exception.CreateFmt('RegQueryInfoKey: %s',[
syserrormessage(err)]);
command_switch:=uppercase(paramstr(1));
if '/LIST'=command_switch then listsoftware else
if '/INFO'=command_switch then uninstallinfo else
if '/EXEC'=command_switch then searchexec else
if '/REM'=command_switch then removefiles else
if '/CLEAN'=command_switch then cleanregistry else
writeln('Unknown command "',paramstr(1),'"');
except on e:exception do writeln(e.message);end;
regclosekey(uninstallkey);
end.

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

The post QInstall An alternative to Windows uninstaller first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/qinstall-an-alternative-to-windows-uninstaller/feed/ 56
WinKill – Program killing tool https://delphijustin.biz/winkill-program-killing-tool/?utm_source=rss&utm_medium=rss&utm_campaign=winkill-program-killing-tool https://delphijustin.biz/winkill-program-killing-tool/#respond Mon, 11 Nov 2019 22:11:58 +0000 https://delphijustin.biz/?p=769 This tool allows you to easily end a non-responsive program. Or a whole truckload of them running at once. This tool works by specifying anything that should be contained in window text and/or classname. You can specify the /NR switch to only kill not responding programs. It’s just like Linux’s xkill command.

The post WinKill – Program killing tool first appeared on Delphijustin industries.

]]>
This tool allows you to easily end a non-responsive program. Or a whole truckload of them running at once. This tool works by specifying anything that should be contained in window text and/or classname. You can specify the /NR switch to only kill not responding programs. It’s just like Linux’s xkill command.

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

The post WinKill – Program killing tool first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/winkill-program-killing-tool/feed/ 0
Window Hacker https://delphijustin.biz/window-hacker/?utm_source=rss&utm_medium=rss&utm_campaign=window-hacker https://delphijustin.biz/window-hacker/#comments Thu, 20 Jun 2019 17:58:52 +0000 https://delphijustin.biz/?p=209 This program is a great tool to have. It allows you to take control of window controls and their handles. This is like Spy++ but free. Theres a dll that allows you to control a window from a batch file just use rundll32 with it like   rundll32 libwndhack.dll,CloseHWND search_query rundll32 libwndhack.dll,ShowHWND search_query rundll32 libwndhack.dll,ClickButton …

The post Window Hacker first appeared on Delphijustin industries.

]]>

This program is a great tool to have. It allows you to take control of

window controls and their handles. This is like Spy++ but free. Theres

a dll that allows you to control a window from a batch file just use

rundll32 with it like

 

rundll32 libwndhack.dll,CloseHWND search_query

rundll32 libwndhack.dll,ShowHWND search_query

rundll32 libwndhack.dll,ClickButton search_query

rundll32 libwndhack.dll,EnableHWND search_query

rundll32 libwndhack.dll,DisableHWND search_query

 

The search_query is the string that will be searched for.

 

Here’s a screenshot of the program:

wndhacker.jpg

 

            More tools and apps avaliable at

                  www.delphijustin.biz

 

unit wndhackUnit1;
{$RESOURCE wndhack32.res}
interface
//Main window unit
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Menus, StdCtrls, ExtCtrls,shellapi, ComCtrls, ScktComp, Spin;

type
  TWNDHacker = class(TForm)
    Panel1: TPanel;
    Label1: TLabel;
    HWNDEdit: TEdit;
    Label2: TLabel;
    Button1: TButton;
    Label3: TLabel;
    cname: TEdit;
    WNDEn: TCheckBox;
    WNDV: TCheckBox;
    Label4: TLabel;
    WNDTxt: TMemo;
    MainMenu1: TMainMenu;
    UpdateList1: TMenuItem;
    HWNDIcon: TPaintBox;
    GroupBox1: TGroupBox;
    ComboBox1: TComboBox;
    Label5: TLabel;
    Label6: TLabel;
    Edit1: TEdit;
    Label7: TLabel;
    Edit2: TEdit;
    Button2: TButton;
    CheckBox1: TCheckBox;
    Button3: TButton;
    Label8: TLabel;
    Memo1: TMemo;
    Label9: TLabel;
    Edit3: TEdit;
    Label10: TLabel;
    Edit4: TEdit;
    ListBox1: TListBox;
    Label11: TLabel;
    Edit5: TEdit;
    Label12: TLabel;
    Edit6: TEdit;
    GroupBox2: TGroupBox;
    Label13: TLabel;
    ComboBox2: TComboBox;
    CheckBox2: TCheckBox;
    Button4: TButton;
    Help1: TMenuItem;
    AboutWindowHacker1: TMenuItem;
    HWNDP: TComboBox;
    ComboBox3: TComboBox;
    Label14: TLabel;
    Tools1: TMenuItem;
    FindWindow1: TMenuItem;
    FindDialog1: TFindDialog;
    OpenDialog1: TOpenDialog;
    MouseFollower1: TMenuItem;
    Timer1: TTimer;
    StatusBar1: TStatusBar;
    ViewAtomTable1: TMenuItem;
    PopupMenu1: TPopupMenu;
    SaveIcon1: TMenuItem;
    LoadIcon1: TMenuItem;
    Cancel1: TMenuItem;
    SaveDialog1: TSaveDialog;
    RestoreWindow1: TMenuItem;
    ShowWindow1: TMenuItem;
    GetWindowLong1: TMenuItem;
    Label15: TLabel;
    SpinEdit1: TSpinEdit;
    Label16: TLabel;
    SpinEdit2: TSpinEdit;
    Label17: TLabel;
    SpinEdit3: TSpinEdit;
    SpinEdit4: TSpinEdit;
    Label18: TLabel;
    Button5: TButton;
    CheckBox3: TCheckBox;
    FindWindowEx1: TMenuItem;
    procedure UpdateList1Click(Sender: TObject);
    procedure ListBox1Click(Sender: TObject);
    procedure HWNDIconPaint(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure WNDVClick(Sender: TObject);
    procedure WNDEnClick(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
    procedure Label12Click(Sender: TObject);
    procedure ComboBox2Change(Sender: TObject);
    procedure Label2Click(Sender: TObject);
    procedure AboutWindowHacker1Click(Sender: TObject);
    procedure FindDialog1Find(Sender: TObject);
    procedure FindWindow1Click(Sender: TObject);
    procedure MouseFollower1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure ViewAtomTable1Click(Sender: TObject);
    procedure SaveIcon1Click(Sender: TObject);
    procedure HWNDIconClick(Sender: TObject);
    procedure RestoreWindow1Click(Sender: TObject);
    procedure LoadIcon1Click(Sender: TObject);
    procedure ShowWindow1Click(Sender: TObject);
    procedure GetWindowLong1Click(Sender: TObject);
    procedure Button5Click(Sender: TObject);
    procedure FindWindowEx1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
{  THWNDPPacket=record  Reserved for Remote controllu

  op:integer;
  Handle:hwnd;
  classname,windowname:array[0..255]of ansichar;
  msg,startms,cms:dword;
  wparam,lparam:lparam;
  Return:LRESULT;
  end;           }
  function GetConsoleWindow:hwnd;stdcall;external 'kernel32.dll';
var
  WNDHacker: TWNDHacker;
  hico:hicon;
  nochange:boolean;
  searchres,msgs,winstyles,shows,gwl:tstringlist;
  childenum:tlist;
implementation

{$R *.DFM}

uses wndhackunit2;

function EnumHWND(hw:hwnd;lp:lparam):bool;stdcall;
var cname,wtxt:array[0..1024] of char;
pid:dword;
begin
getwindowtext(hw,wtxt,1025);
getclassname(hw,cname,1025);
result:=true;
 GEtWindowThreadProcessId(hw,@pid);
 if pid=getcurrentprocessid then exit;
wndhacker.ListBox1.Items.AddObject(StrPas(CName)+','+strpas(wtxt),TObject(hw));
wndhacker.HWNDP.Items.Add('$'+inttohex(hw,0));
if lp=0 then
enumchildwindows(hw,@enumhwnd,1);
end;

procedure TWNDHacker.UpdateList1Click(Sender: TObject);
begin
listbox1.Items.Clear;
childenum.Clear;
hwndp.Items.Clear;
listbox1.Items.AddObject('HWND_DESKTOP',TObject(getdesktopwindow));
enumwindows(@enumhwnd,0);
end;

procedure AddConsts(combo:tcombobox; slConsts:tstringlist);
var i:integer;
begin
for i:=0 to slConsts.Count-1 do
if StrToInt64Def(slconsts.values[slconsts.names[i]],-1)>-1 then
combo.Items.Add(slConsts.names[i]);
end;

procedure TWNDHacker.ListBox1Click(Sender: TObject);
var classname:array[0..255] of char;
windowtxt:pchar;
wtlen:integer;
r:trect;
dwprocess:dword;
begin
nochange:=true;
HWNDEdit.Text:='$'+IntToHex(HWnd(listbox1.items.objects[listbox1.ItemIndex]),0);
hwndp.Text:='$'+inttohex(getparent(hwnd(listbox1.items.objects[listbox1.ItemIndex])),0);
hico:=GetClassLong(hwnd(ListBox1.items.objects[listbox1.itemindex]),GCL_HICON);
if hico=0 then
hico:=GetClassLong(getparent(hwnd(listbox1.items.objects[listbox1.itemindex])),
gcl_hicon);
if hico=0then hico:=loadicon(0,IDI_APPLICATION);
drawicon(hwndicon.canvas.handle,0,0,hico);
edit5.Text:='$'+inttohex(globalfindatom(classname),4);
edit3.Text:=inttostr(GetWindowThreadProcessID(strtoint(hwndedit.text),
@dwprocess));
edit4.Text:=inttostr(dwprocess);
edit6.Text:=IntTohex(getwindowlong(strtoint(hwndedit.text),gwl_style),8)+'-'+
inttohex(getwindowlong(strtoint(hwndedit.text),gwl_exstyle),8);
getclassname(hwnd(listbox1.items.objects[listbox1.itemindex]),classname,256);
cname.Text:=strpas(classname);
Wtlen:=GetWindowTextLength(hwnd(listbox1.items.objects[listbox1.itemindex]))+1;
windowtxt:=stralloc(wtlen);
GetWindowText(hwnd(listbox1.items.objects[listbox1.itemindex]),windowtxt,wtlen);
wnden.Checked:= iswindowenabled(hwnd(listbox1.items.objects[listbox1.ItemIndex]));
wndv.Checked:= iswindowvisible(hwnd(listbox1.items.objects[listbox1.itemindex]));
wndtxt.Text:=strpas(windowtxt);
strdispose(windowtxt);
getwindowrect(strtoint(hwndedit.text),r);
spinedit1.Value:=r.Bottom;
spinedit2.Value:=r.Right;
spinedit3.Value:=r.Top;
spinedit4.Value:=r.Left;
nochange:=false;
end;

procedure TWNDHacker.HWNDIconPaint(Sender: TObject);
begin
drawicon(HWNDIcon.Canvas.handle,0,0,hico);
end;

procedure TWNDHacker.FormCreate(Sender: TObject);
var i:integer;
msgr:tresourcestream;
stylesr,showr,gwlr:tresourcestream;
begin
searchres:=tstringlist.Create;
shows:=tstringlist.Create;
showr:=tresourcestream.Create(hinstance,'SHOW','TXT');
shows.LoadFromStream(showr);
showr.Free;
gwlr:=tresourcestream.Create(hinstance,'GWL','TXT');
gwl:=tstringlist.Create;
gwl.LoadFromStream(gwlr);
gwlr.Free;
childenum:=tlist.Create;
combobox3.ItemIndex:=0;
hico:=loadicon(0,IDI_APPLICATION);
msgr:=tresourcestream.Create(hinstance,'MESSAGES','TXT');
msgs:=tstringlist.Create;
msgs.LoadFromStream(msgr);
msgr.Free;
stylesr:=tresourcestream.Create(hinstance,'WINSTYLES','TXT');
winstyles:=tstringlist.Create;
winstyles.LoadFromStream(stylesr);
stylesr.Free;
addconsts(combobox2,winstyles);
for i:= 0 to msgs.Count-1 do
if(msgs.Names[i]<>'') and(strscan(pchar(msgs[i]),'{')=nil) then
combobox1.Items.Add(msgs.Names[i]);
application.Title:=caption;
UpdateList1.Click;
end;

procedure TWNDHacker.Button1Click(Sender: TObject);
begin
windows.SetParent(strtoint(hwndedit.text),strtoint(hwndp.text));
end;

procedure MyWndMsgProc(hw:hwnd;msg:uint;Startms:DWORD;lres:lresult);stdcall;
begin
wndhacker.Memo1.Lines.Add(IntToHex(hw,0)+' replied within '+inttostr(
gettickcount-startms)+'ms, returned '+inttohex(lres,0));
end;

procedure TWNDHacker.Button2Click(Sender: TObject);
var b:boolean;
hw:hwnd;
res:lresult;
begin
b:=true;
res:=0;
memo1.Clear;
if not checkbox1.Checked then
hw:=strtoint(hwndedit.text)else hw:=hwnd_broadcast;
case combobox3.ItemIndex of
0:b:=sendmessagecallback(hw,strtointdef(msgs.values[combobox1.text],
registerwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),
strtoint(edit2.text),@mywndmsgproc,gettickcount);
1:b:=PostMessage(hw,strtointdef(msgs.values[combobox1.text],
registerwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),
strtoint(edit2.text));
2:res:=defwindowproc(hw,strtointdef(msgs.values[combobox1.text],
registerwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),strtoint(
edit2.text));
3:res:=sendmessage(hw,strtointdef(msgs.values[combobox1.text],
registerwindowmessage(pchar(combobox1.text))),strtoint(edit1.text),strtoint(
edit2.text));
end;
if not b then
messagebox(handle,pchar(syserrormessage(getlasterror)),'Window Hacker',mb_iconerror);
if res<>0 then memo1.Text :='Returned with '+inttohex(res,0);
end;

procedure TWNDHacker.WNDVClick(Sender: TObject);
begin
if nochange then exit;
if wndv.Checked then
showwindow(strtoint(hwndedit.text),sw_show)else
showwindow(strtoint(hwndedit.Text),sw_hide);

end;

procedure TWNDHacker.WNDEnClick(Sender: TObject);
begin
if nochange then exit;
enablewindow(strtoint(hwndedit.text),wnden.checked);

end;

procedure TWNDHacker.Button3Click(Sender: TObject);
begin
setwindowtext(strtoint(hwndedit.text),pchar(wndtxt.text));
end;

procedure TWNDHacker.Button4Click(Sender: TObject);
var hw:hwnd;
x:integer;
begin
hw:=strtoint(hwndedit.text);
if winstyles.Values[combobox2.Text]<>''then
x:=Strtoint(winstyles.values[combobox2.text])else
x:=strtoint(combobox2.text);
if pos('_EX_',Uppercase(combobox2.text))>0 then
begin
if checkbox2.Checked then
setwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) or x)else
setwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) and(not x));
end else begin
if checkbox2.Checked then
setwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) or x)else
setwindowlong(hw,gwl_exstyle,getwindowlong(hw,gwl_exstyle) and(not x));
end;
end;

procedure TWNDHacker.Label12Click(Sender: TObject);
var s:string;
I,x:integer;
y:longint;
begin
s:='The window has the following styles set:'+#13#10;
for i:=0to combobox2.Items.Count-1 do
begin
if pos('_EX_',combobox2.Items[i])>0 then
x:= gwl_exstyle else x:=gwl_style;
y:= strtoint(winstyles.values[ combobox2.items[i]]);
if y and GetWindowLong(StrToInt(hwndedit.text),x)=y then
s:=s+combobox2.Items[i]+#13#10;
end;
Messagebox(handle,pchar(s),'Window Hacker',0);
end;

procedure TWNDHacker.ComboBox2Change(Sender: TObject);
var x:integer;
begin
if strtoint64def(Combobox2.text,-1)>-1 then
x:=strtoint(combobox2.text) else
if combobox2.Items.IndexOf(combobox2.text)>-1 then
x:=strtoint(winstyles.values[combobox2.Text]);
if pos('_EX_',Uppercase(combobox2.text))=0 then
checkbox2.Checked:=(GetWindowLong(strtoint(hwndedit.Text),gwl_style) and x=x)else
checkbox2.Checked:=(GetWindowLong(strtoint(hwndedit.Text),gwl_exstyle) and x=x);
end;

procedure TWNDHacker.Label2Click(Sender: TObject);
var classn:array[0..1024]of char;
wtxt:pchar;
wtxtlen:integer;
begin
wtxtlen:=1+getwindowtextlength(strtoint(hwndp.Text));
wtxt:=stralloc(wtxtlen);
getwindowtext(strtoint(hwndp.text),wtxt,wtxtlen);
getclassname(strtoint(hwndp.text),classn,1025);
messagebox(handle,PChar('Window Text: '+strpas(wtxt)+#13#10+
                        'Class Name: '+strpas(classn)),
'Window Hacker',0);
strdispose(wtxt);
end;

procedure TWNDHacker.AboutWindowHacker1Click(Sender: TObject);
var hexe:thandle;
compiletime:tfiletime;
t:tdatetime;
st:tsystemtime;
begin
hexe:=createfile(PChar(application.exename),generic_read,file_share_read or
file_share_write,nil,open_existing,file_attribute_normal,0);
getfiletime(hexe,nil,nil,@compiletime);
closehandle(hexe);
filetimetosystemtime(compiletime,st);
t:=encodedate(st.wyear,st.wmonth,st.wday)+encodetime(st.whour,st.wminute,st.wsecond,0);
messagebox(handle,pchar('Window Hacker v1.0 By Justin Roeder'+#13#10+
                        'Compiled on: '+DateTimeToStr(t))
,'About Window Hacker',0);
end;

procedure TWNDHacker.FindDialog1Find(Sender: TObject);
var i:integer;
q:string;
begin
allocconsole;
findwindow1.enabled:=false;
bringwindowtotop(getconsolewindow);
finddialog1.CloseDialog;
for i:=0 to listbox1.Items.Count-1 do
if (pos(uppercase(finddialog1.findtext),uppercase(listbox1.items[i]))>0)or
('$'+inttohex(hwnd(listbox1.items.objects[i]),0)=uppercase(finddialog1.findtext))
or ('$'+inttohex(getparent(hwnd(listbox1.items.objects[i])),0)=uppercase(
finddialog1.findtext))then
searchres.Add(listbox1.items[i]);
if searchres.Count=0 then begin
writeln('Nothing found, press enter to continue...');
readln(q);
findwindow1.Enabled:=true;
freeconsole;
exit;
end;
for i:=0 to searchres.Count-1 do
writeln(i,'.',searchres[i]);
write('Enter your choice or hit enter to cancel: ');
readln(q);
if q<>'' then begin
listbox1.ItemIndex:=listbox1.Items.IndexOf(searchres[strtointdef(q,0)]);
wndhacker.ListBox1Click(nil);
end;
findwindow1.Enabled:=true;
freeconsole;
end;

procedure TWNDHacker.FindWindow1Click(Sender: TObject);
begin
finddialog1.Execute;
end;

procedure TWNDHacker.MouseFollower1Click(Sender: TObject);
begin
timer1.Enabled:=not timer1.Enabled;
end;

procedure TWNDHacker.Timer1Timer(Sender: TObject);
var hw:hwnd;
mouse:tpoint;
desktopdc:hdc;
s:String;
cn,wtxt:array[0..255]of char;
begin
getcursorpos(mouse);
hw:= windowfrompoint(mouse);
if listbox1.Items.IndexOfObject(TObject(hw))>-1 then begin
listbox1.ItemIndex:=listbox1.Items.IndexOfObject(tobject(hw));
listbox1click(nil);
end;
desktopdc:=getwindowdc(getdesktopwindow);
getclassname(hw,cn,256);
GetWindowText(hw,wtxt,256);
s:=Format('Classname:%s WindowText:%s Handle:%x Parent:%x',[cn,wtxt,hw,
getparent(hw)]);
textout(desktopdc,0,0,pchar(s),length(s));
releasedc(getdesktopwindow,desktopdc);
end;

procedure TWNDHacker.ViewAtomTable1Click(Sender: TObject);
var a:atom;
aname:array[0..255]of char;
hf:thandle;
sherr,bwrite:dword;
l:uint;
s:String;
cs:tstringlist;
begin
cs:=tstringlist.Create;
hf:=CreateFile('ATOMTABL.CSV',generic_write,0,nil,create_always,
file_attribute_normal,0);
if hf=INVALID_HANDLE_VALUE then begin
messagebox(handle,PChar(syserrormessage(getlasterror)),'Window Hacker(Create)',
mb_iconerror);
exit;
end;
s:='';
for a:=1 to $FFFF do
begin
l:= globalgetatomname(a,aname,256);
if l>0 then begin
cs.Add('0x'+inttohex(a,4));
cs.Add(aname);
s:=cs.CommaText+#13#10;
if not writefile(hf,s[1],length(s),bwrite,nil) then begin
messagebox(handle,pchar(syserrormessage(getlasterror)),'Window Hacker(write)',
mb_iconerror);
exit;
end;
end;
cs.Clear;
end;
closehandle(hf);
cs.Free;
sherr:=33;
if shellexecute(0,nil,'ATOMTABL.CSV',nil,nil,sw_show)<33 then
sherr:=shellexecute(0,nil,'notepad.exe','ATOMTABL.CSV',nil,sw_show);
if sherr<33 then messagebox(handle,PChar(syserrormessage(sherr)),
'Window Hacker(shell)',mb_iconerror);
end;

procedure TWNDHacker.SaveIcon1Click(Sender: TObject);
var ico:ticon;
begin
if not savedialog1.Execute then exit;
ico:=ticon.Create;
ico.Handle:=hico;
ico.SaveToFile(savedialog1.filename);
ico.Free;
end;

procedure TWNDHacker.HWNDIconClick(Sender: TObject);
var poin:tpoint;
begin
getcursorpos(poin);
restorewindow1.Enabled:=isiconic(strtoint(hwndedit.text));
popupmenu1.Popup(poin.x,poin.y);
end;

procedure TWNDHacker.RestoreWindow1Click(Sender: TObject);
begin
showwindow(strtoint(hwndedit.text),sw_show);
if not openicon(strtoint(hwndedit.text)) then
messagebox(handle,pchar(syserrormessage(getlasterror)),'Window Hacker',
mb_iconerror);

end;

procedure TWNDHacker.LoadIcon1Click(Sender: TObject);
var hins:hinst;
ind:dword;
begin
if not opendialog1.Execute then exit;
ind:=StrTointdef(inputbox('Icon Index#','Enter Icon Index Number','0'),0);
hins:=getclasslong(strtoint(hwndedit.text),GCL_HMODULE);
setclasslong(strtoint(hwndedit.text),GCL_HICON,ExtractIcon(hins,pchar(
opendialog1.FileName),ind));
end;

procedure TWNDHacker.ShowWindow1Click(Sender: TObject);
var sw:integer;
hw:hwnd;
s:string;
begin
hw:=strtoint(hwndedit.text);
s:=inputbox('ShowWindow','Enter SW_ Constant','SW_SHOWNA');
if pos('SW_',uppercase(s))=1 then
sw:=StrToInt(shows.values[s])else
sw:=Strtointdef(s,sw_showna);
showwindow(hw,sw);
end;

procedure TWNDHacker.GetWindowLong1Click(Sender: TObject);
var ind:integer;
hw:hwnd;
s:string;
begin
hw:=strtoint(hwndedit.text);
s:=InputBox('GetWindowLong','Enter GWL Constant:','GWL_STYLE');
if strscan(pchar(s),'_')=nil then ind:=strtointdef(s,gwl_style) else
ind:=strtoint(gwl.values[s]);
s:=Format('Index %x equals %x',[ind,GetWindowLong(hw,ind)]);
messagebox(handle,PChar(s),'Window Hacker',0);
end;

procedure TWNDHacker.Button5Click(Sender: TObject);
begin
setwindowpos(strtoint(hwndedit.text),0,spinedit3.value,spinedit4.value,
spinedit2.Value,spinedit1.Value,swp_noactivate or
(Byte(checkbox3.checked)*SWP_NOSENDCHANGING));
end;

procedure TWNDHacker.FindWindowEx1Click(Sender: TObject);
begin
findwndex.Visible:=true;
findwndex.BringToFront;
end;

end.
unit wndhackunit2;
//Find Window Unit
interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls;

type
  TFindWNDEx = class(TForm)
    Label1: TLabel;
    Edit1: TEdit;
    Label2: TLabel;
    Memo1: TMemo;
    Button1: TButton;
    Button2: TButton;
    Label3: TLabel;
    Edit2: TEdit;
    Button3: TButton;
    CheckBox1: TCheckBox;
    procedure Button1Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FindWNDEx: TFindWNDEx;
childaf:hwnd;
implementation

{$R *.DFM}

uses wndhackunit1;

procedure TFindWNDEx.Button1Click(Sender: TObject);
var hw:hwnd;
begin
if checkbox1.Checked then childaf:=0;
if memo1.Text='' then
hw:=findwindowex(strtointdef(edit2.text,0),childaf,pchar(edit1.text),nil)else
hw:=findwindowex(strtointdef(edit2.text,0),childaf,pchar(edit1.text),pchar(
memo1.text));
childaf:=hw;
checkbox1.Checked:=false;
if hw=0 then exit;
if wndhacker.ListBox1.Items.IndexOfObject(tobject(hw))=-1 then
wndhacker.UpdateList1.Click;
wndhacker.ListBox1.ItemIndex:=wndhacker.ListBox1.Items.IndexOfObject(tobject(hw));
wndhacker.ListBox1Click(nil);
end;

procedure TFindWNDEx.Button3Click(Sender: TObject);
begin
edit2.text:=wndhacker.HWNDEdit.Text
end;

end.
library libwndhack;
//API Library for Window Hacker
uses
  SysUtils,windows,messages,
  Classes;
{$RESOURCE wndhackdll.res}

type THWNDCommand=record
Opcode:byte;
etc,ret,found:integer;
hwnds:tlist;
query:pchar;
end;
PHWNDCommand=^THWNDCommand;
function GetConsoleWindow:HWND;stdcall;external 'kernel32.dll';
var lasterr:pchar=nil;
def_cmd:thwndcommand;
dc:hdc;

function WNDGetLastError:pchar;stdcall;
begin
result:=lasterr;
end;

function MyWNDEnum(hw:hwnd;var lp:thwndcommand):bool;stdcall;
var wtxt,cn:array[0..255]of char;
begin
getclassname(hw,cn,256);
getwindowtext(hw,wtxt,256);
result:=true;
if (strpos(cn,lp.query)<>nil)or(strpos(wtxt,lp.query)<>nil)then begin
lp.found:=lp.found+1;
case lp.Opcode of
1:lp.ret:= Integer(ShowWindow(hw,lp.etc));
2:lp.ret:= integer(EnableWindow(hw,(lp.etc=1)));
3:lp.ret:= sendmessage(hw,bm_Click,0,0 );
4:lp.ret:=sendmessage(hw,wm_destroy,0,0);
5:lp.ret:=sendmessage(hw,wm_close,0,0);
6:lp.ret:=setparent(hw,lp.etc);
end;
lp.hwnds.Add(Pointer(hw));
end;
if not enumchildwindows(hw,@mywndenum,integer(@lp))then
lasterr:='EnumChildWindows failed';
end;

function ShowHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;nshow:integer):POINTER;stdcall;
var cmd:phwndcommand;
begin
new(cmd);
cmd.query:=lpquery;
cmd.found:=0;
cmd.Opcode:=1;
cmd.etc:=nshow;
cmd.hwnds:=tlist.Create;
if not enumwindows(@mywndenum,Integer(cmd))then
if reserved>0 then begin
messagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);
exitprocess(0);
end else
lasterr:='EnumWindows failed';
if reserved>0 then exitprocess(cmd.found);
result:=cmd;
end;

function ClickButton(hwnderr:hwnd;reserved:dword;lpQuery:pchar;
nshow:integer):POINTER;stdcall;
var cmd:phwndcommand;
begin
new(cmd);
cmd.query:=lpquery;
cmd.found:=0;
cmd.Opcode:=3;
cmd.etc:=0;
cmd.hwnds:=tlist.Create;
if not enumwindows(@mywndenum,Integer(cmd))then
if reserved>0 then begin
messagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);
exitprocess(0);
end else
lasterr:='EnumWindows failed';
if reserved>0 then exitprocess(cmd.found);
result:=cmd;
end;

function GetFoundWindowCount(var lpHWNDCMD:THWNDCommand):integer;stdcall;
begin
result:=lphwndcmd.found;
end;

function GetWNDReturnValue(var lpWND:THWNDCommand):integer;stdcall;
begin
result:=lpWND.ret;
end;

function HWNDPop(lpWND:pHWNDCommand):hwnd;stdcall;
begin
result:=0;
try
result:=hwnd(lpwnd.hwnds[0]);
lpwnd.hwnds.Delete(0);
except on e:exception do lasterr:=PChar(e.message);
end;
end;

procedure WNDHackFree(p:phwndcommand);stdcall;
begin
if p.hwnds<>nil then p.hwnds.Free;
dispose(p);
end;

procedure WNDResetError;stdcall;
begin
lasterr:=nil;
end;

function DestroyHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;
nshow:integer):POINTER;stdcall;
var cmd:phwndcommand;
begin
new(cmd);
cmd.query:=lpquery;
cmd.found:=0;
cmd.Opcode:=4;
cmd.hwnds:=tlist.Create;
if not enumwindows(@mywndenum,Integer(cmd))then
if reserved>0 then begin
messagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);
exitprocess(0);
end else
lasterr:='EnumWindows failed';
if reserved>0 then exitprocess(cmd.found);
result:=cmd;
end;

function CloseHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;
nshow:integer):POINTER;stdcall;
var cmd:phwndcommand;
begin
new(cmd);
cmd.query:=lpquery;
cmd.found:=0;
cmd.Opcode:=5;
cmd.hwnds:=tlist.Create;
if not enumwindows(@mywndenum,Integer(cmd))then
if reserved>0 then begin
messagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);
exitprocess(0);
end else
lasterr:='EnumWindows failed';
if reserved>0 then exitprocess(cmd.found);
result:=cmd;
end;

procedure ScreenSaverBox(hwn:hwnd;inst:hinst;lpscrfile:pchar;nshow:integer);stdcall;
begin
allocconsole;
setconsoletitle(lpscrfile);
if winexec(pchar(strpas(lpscrfile)+' /P '+inttostr(getconsolewindow)),sw_show)>31
then while true do asm NOP end;
MessageBox(hwn,'Error opening screensaver','Window Hacker',mb_iconerror);
end;

function CreateBox(shw:hwnd;resered:dword;lpQuery:PCHAR;nshow:integer):bool;stdcall;
var cmd:phwndcommand;
hw:hwnd;
i:integer;
S,q:string;
begin
result:=allocconsole;
setconsoletitle('WNDHackerBox');
setclasslong(getconsolewindow,gcl_hicon,loadicon(getmodulehandle('libwndhack.dll'),
'WNDMAN'));
writeln('Box for ',lpquery);
writeln('Box handle is $',inttohex(getconsolewindow,0));
new(cmd);
cmd.Opcode:=6;
cmd.etc:= Integer(Getconsolewindow);
cmd.found:=0;
cmd.query:=lpquery;
cmd.hwnds:=tlist.Create;
enumwindows(@mywndenum,Integer(cmd));
writeln(cmd.found,' windows has joined this box');
hw:=HWNDPop(cmd);
while hw<>0 do begin
writeln('Window Handle $',inttohex(hw,0),' has joined this box');hw:=hwndpop(cmd);
end;
while true do begin
write('WNDHack>');
readln(s);
s:=trim(s);
if Uppercase(s)='HELP' then begin
writeln('Commands Avaliable:');
writeln('ADD      searches for a window objects and adds them to this box');
writeln('CLOSE    Sends WM_CLOSE message to all window objects that are apart of this box');
end;
if uppercase(s)='ADD' then begin
write('WindowName/Classname:');
readln(q);
cmd.query:=PChar(q);
enumwindows(@mywndenum,Integer(cmd));
end;
if Uppercase(s)='CLOSE' then 
for i:= 0 to cmd.hwnds.count-1do
sendmessage(HWND(CMD.hwnds[i]),wm_close,0,0);
end;
end;

function EnableHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;
nshow:integer):POINTER;stdcall;
var cmd:phwndcommand;
begin
new(cmd);
cmd.query:=lpquery;
cmd.found:=0;
cmd.Opcode:=2;
cmd.etc:=1;
cmd.hwnds:=tlist.Create;
if not enumwindows(@mywndenum,Integer(cmd))then
if reserved>0 then begin
messagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);
exitprocess(0);
end else
lasterr:='EnumWindows failed';
if reserved>0 then exitprocess(cmd.found);
result:=cmd;
end;

function DisableHWND(hwnderr:hwnd;reserved:dword;lpQuery:pchar;
nshow:integer):POINTER;stdcall;
var cmd:phwndcommand;
begin
new(cmd);
cmd.query:=lpquery;
cmd.found:=0;
cmd.Opcode:=2;
cmd.etc:=0;
cmd.hwnds:=tlist.Create;
if not enumwindows(@mywndenum,Integer(cmd))then
if reserved>0 then begin
messagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);
exitprocess(0);
end else
lasterr:='EnumWindows failed';
if reserved>0 then exitprocess(cmd.found);
result:=cmd;
end;

function WindowSearch(lpQuery:pchar):phwndcommand;stdcall;
begin
new(result);
result.Opcode:=0;
result.hwnds:=tlist.Create;
result.found:=0;
if not enumwindows(@mywndenum,integer(result)) then
lasterr:='EnumWindows failed';
end;

function ChangeParent(hwnderr:hwnd;reserved:dword;lpQuery:pchar;
nshow:integer):POINTER;stdcall;
var cmd:phwndcommand;
sl:tstringlist;
begin
sl:=tstringlist.Create;
sl.CommaText:=strpas(lpQuery);
new(cmd);
cmd.query:=PChar(sl[0]);
cmd.found:=0;
cmd.Opcode:=6;
cmd.etc:=strtointdef(sl[1],getdesktopwindow);
cmd.hwnds:=tlist.Create;
sl.Free;
if not enumwindows(@mywndenum,Integer(cmd))then
if reserved>0 then begin
messagebox(hwnderr,'EnumWindows Failed',nil,mb_iconerror);
exitprocess(0);
end else
lasterr:='EnumWindows failed';
if reserved>0 then exitprocess(cmd.found);
result:=cmd;
end;

function WNDHackSize(var wnddata:thwndcommand):integer;stdcall;
begin
result:=sizeof(wnddata);
end;

procedure QueryFirstWindow(hw:hwnd;inst:hinst;lpQuery:pchar;nShow:integer);stdcall;
var cmd:phwndcommand;
begin
new(cmd);
cmd.Opcode:=0;
cmd.query:=lpquery;
cmd.found:=0;
cmd.hwnds:=tlist.Create;
enumwindows(@mywndenum,integer(cmd));
if cmd.found=0 then exitprocess(0);
exitprocess(hwndpop(cmd));
end;

exports WNDGetLastError,ShowHWND,HWNDPop,WNDHackFree,GetWNDReturnValue,CreateBox,
GetFoundWindowCount,WNDResetError,ClickButton,CloseHWND,DestroyHWND,DisableHWND,
EnableHWND,WindowSearch,ChangeParent,WNDHackSize,QueryFirstWindow,ScreenSaverBox;
begin
end.

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

The post Window Hacker first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/window-hacker/feed/ 1
PingEx Alternative to Network PING https://delphijustin.biz/pingex-alternative-to-network-ping/?utm_source=rss&utm_medium=rss&utm_campaign=pingex-alternative-to-network-ping https://delphijustin.biz/pingex-alternative-to-network-ping/#comments Thu, 20 Jun 2019 17:05:44 +0000 https://delphijustin.biz/?p=203 This tool is a great alternative to Windows Ping.exe file. Not only does it work with ICMP, it works with Internet Explorer type protocols (such as HTTP, HTTPS and FTP). On the ICMP Protocol (which is the protocol Windows Ping uses) allows you to specify the data that will be echoed back from the host …

The post PingEx Alternative to Network PING first appeared on Delphijustin industries.

]]>

This tool is a great alternative to Windows Ping.exe file. Not only does it work with ICMP, it works with Internet Explorer type protocols (such as HTTP, HTTPS and FTP). On the ICMP Protocol (which is the protocol Windows Ping uses) allows you to specify the data that will be echoed back from the host If you don’t specify a the data string it will use the date time, packet index number and process id as the default data. This is option -d.

The default data will look like something like this if its being sniffed:

12/19/2017 4:39:28 PM#1 5676.

Where blue is the date and time red is the packet number and purple is the process id. And to end packet to make it more readable I put a period at the end of it.

To see what available command line options are type in pingex.exe /?  At the command prompt where you unzipped it to.

Here are some few examples here

Pingex.exe 8.8.8.8 -d “Hi Google DNS”

The command above pings google dns(8.8.8.8) with the data bytes set to “Hi Google DNS’

Pingex.exe http://www.pontaic90.org/ -n 5 –url

The command above does an HTTP ping with 5 request, don’t forget to put in –url in the command line otherwise you will have problems.

You can press Control+C at anytime to abort the ping tool and see the results. As well as viewing them without ending the ping by pressing Control+Break

Also checkout the Internet resetter option in it that can reboot any router or modem when the internet goes down see SerialResetter.bat and SerialResetter_Schematic.pdf file. Requires a circuit to be built and working with mains voltage.

Features of version 1.0.0.1 are offline batch file and random website URL Ping
program pingex;
{$RESOURCE PINGEX32.RES}
{$APPTYPE CONSOLE}

uses
  SysUtils,
  math,
  httpapp,
  windows,
  winsock,
  mmsystem,
  Classes,
  urlmon,
  shellapi,
  ICMP in '..\delphi\ICMP.PAS';
const MAX_URLBUFFER=64*1024;

VAR MyICMP:TICMP;
count,successcount,trigger,i,irto:integer;
reply:PIcmpEchoReply;
LastPong:tdatetime;
errres,sitesres:TResourceStream;
icmperr:tstringlist;
t,tmax,bread,bmax,timerid:dword;
tmin:dword=$FFFFFFFF;
bmin:dword=$ffffffff;
hstat:hresult;
scomport,sh,s:string;
sites:tstringlist;
htimer,hf,hcom:thandle;
urlfile,oldtitle:array[0..max_path]of char;
PMask:pchar;
ipoptions:TIPOptionInformation;
urlbuff:array of ansichar;
data:array of byte;
totalt,totalb:extended;
a,b,c,d:byte;
function GetStatCode:string;
begin
result:='Unknown: '+Inttostr(reply.status);
if icmperr.IndexOf(inttostr(reply.status))=-1 then exit;
result := icmperr[icmperr.indexof(inttostr(reply.status))-1];
if reply.Status=0 then inc(Successcount);
if not comparemem(@myicmp.data[1],reply.data,length(myicmp.data)) then
result:=result+' INVALID DATA';
end;

function GetSize(fs:dword):String;
begin
result:=inttostr(fs)+' bytes';
if fs>1023 then result:=formatfloat('0.00',fs/1024)+' kilobytes';
if fs>(1024*1024)-1then result:=formatfloat('0.00',fs/(1024*1024))+' megabytes';
if fs=$FFFFFFFFthen result:='Size Error';
end;

function PingTime(tx:dword):string;
begin
if tx>999 then result:=formatdatetime('hh:mm:ss',tx*encodetime(0,0,0,1))else
result:=inttostr(tx)+'ms';
end;

function Divide(n,d:extended):Extended;
begin
result:=0;
if d>0then result:=n/d;
end;

function TimerThread(Dummy:pointer):dword;stdcall;
var contitle:array[0..255]of char;
label loop;
begin
loop:
setconsoletitle(strfmt(contitle,
'PingEx - %u Success, Packet Count %u, Packet Success: %f%s Last Pong: %s',[
successcount,count-1,Divide(successcount,count-1)*100,'%',DateTimeToStr(
lastpong)]));
sleep(100);
goto loop;
end;

function CtrlPing(typ:dword):bool;stdcall;
begin
result:=true;
writeln('Ping Details:');
writeln('Packets: Sent=',count-1,' Recevied=',successcount,' Lost=',(count-1)-
successcount);
if pos(' -url',lowercase(getcommandline))>0 then
writeln('Min. data: ',GetSize(bmin),' Max. data: ',getsize(bmax),' Ave. data: ',
getsize(trunc(divide(totalb,count-1))));
writeln('Min. Time: '+pingtime(tmin),' Max. Time: ',pingtime(tmax),' Ave. Time: ',
pingtime(Trunc(divide(totalt,count-1))));
writeln('Success rate:',trunc(100*divide(successcount,count-1)),'%');
writeln('Last Pong: ',datetimetostr(lastpong));
if typ<>CTRL_BREAK_EVENT then begin
setconsoletitle(oldtitle);
if scomport<>''then closehandle(hcom);
errres.Free;
icmperr.Free;
myicmp.Destroy;
if count-1>0 then
exitprocess(trunc(100*(successcount/(count-1))))else Exitprocess(0);
end;
end;

function GetDataSizeP:integer;
var i:integer;
begin
result:=0;
for i:=2 to paramcount do
if stricomp(pchar(paramstr(i)),'-l')=0then
result:=strtointdef(paramstr(i+1),32);
setlength(data,result);
for i:=0 to length(data)-2 do
data[i]:=(i mod 255)+1;
end;

function CheckPattern(const pattern:string;len:integer):boolean;
var i:integer;
begin
result:=false;
if(len<>length(pattern))then exit;
result:=true;
for i:=1to length(pattern)do result:=result and((i mod 16)=strtointdef('$'+
pattern[i],16));
end;

function GeneratePattern(len:integer):string;
var i:integer;
begin
result:='';
for i:=1to len do result:=result+inttohex(i mod 16,1);
end;

function GetDataString:string;
var i:integer;
begin
result:=datetimetostr(now)+'#'+inttostr(count)+' '+inttostr(getcurrentprocessid)+'.';
if strpos(getcommandline,' -url')<>nil then result:=generatepattern(getdatasizep);
for i:=1 to paramcount do begin
if stricomp('-d',pchar(paramstr(i)))=0then result:=paramstr(i+1);
if(stricomp('-dhex',pchar(paramstr(i)))=0) then result:=generatepattern(strtointdef(paramstr(i+1),32));
end;
if result='' then begin
writeln('Err:data parameter needs a string');
exitprocess(0);
end;
if getdatasizep>0 then result:=strpas(@Data[0]);
end;

function GetPacketCount:integer;
var i:integer;
begin
result:=-1;
for i:= 2 to paramcount do
if stricomp('-n',pchar(paramstr(i)))=0then result:=strtointdef(paramstr(i+1),4);
end;

Function GetDelay:dword;
var i:integer;
begin
result:=1000;
for i:=2 to paramcount do
if stricomp('-de',pchar(paramstr(i)))=0then result:=strtointdef(paramstr(i+1),
result);
end;

function GetTimeout:integer;
var i:integer;
begin
result:= myicmp.TimeOut;
for i:=2 to paramcount do
if stricomp('-w',pchar(paramstr(i)))=0then result:=strtointdef(paramstr(i+1),
result);
end;

function GetTOS:Integer;
var i:integer;
begin
result := myicmp.IPOptions.TOS;
for i:=2to paramcount do
if stricomp('-v',pchar(paramstr(i)))=0then result:=Strtointdef(paramstr(i+1),
result);
end;

function GetTTL:Integer;
var i:integer;
begin
result := myicmp.IPOptions.TTL;
for i:=2to paramcount do
if stricomp('-i',pchar(paramstr(i)))=0then result:=Strtointdef(paramstr(i+1),
result);
end;

function GetHTMLTitle:string;
begin
result :=copy(strpas(@urlbuff[0]),pos('<title>',lowercase(pchar(@urlbuff[0])))+
length('<title>'),pos('</title>',lowercase(pchar(@urlbuff[0])))-pos('<title>',
lowercase(pchar(@urlbuff[0])))-Length('</title'));
end;

function GetURLError:string;
begin
result:='Unknown Error';
if hstat=urlmon.INET_E_INVALID_URL then result:='Invalid URL';
if hstat=urlmon.INET_E_NO_SESSION then result:='No session';
if hstat=urlmon.INET_E_CANNOT_CONNECT then result:='Cannot Connect';
if hstat=urlmon.INET_E_RESOURCE_NOT_FOUND then result:='Resource Not Found';
if hstat=urlmon.INET_E_OBJECT_NOT_FOUND then result:='Object not found';
if hstat=urlmon.INET_E_DATA_NOT_AVAILABLE then result :='Data not available';
if hstat=urlmon.INET_E_DOWNLOAD_FAILURE then result := 'Download Failed';
if hstat=urlmon.INET_E_AUTHENTICATION_REQUIRED then result:='Login required';
if hstat=urlmon.INET_E_NO_VALID_MEDIA then result:='No valid media';
if hstat=urlmon.INET_E_CONNECTION_TIMEOUT then result:='Connection timedout';
if hstat=urlmon.INET_E_INVALID_REQUEST then result:='Invalid request';
if hstat=urlmon.INET_E_UNKNOWN_PROTOCOL then result:='Unsupported protocol';
end;

function ProcessPingExServer(html:PChar):boolean;
var data:tstringlist;
begin
result:=(paramstr(1)='');
if not result then Result:=((paramstr(1)[1]='-')and(stricomp(pchar(paramstr(1)),
'-urlr')<>0))or(strpos(getcommandline,' -ht')<>nil);
if not result then begin result:=true;exit;end;
if strpos(html,'<!-- PingEx_Server -->')=nil then result:=false;
data:=tstringlist.Create;
data.Text:=strpas(html);
if length(data.values['hex'])<>getdatasizep then begin result:=false;exit;end;
for i:=1to getdatasizep do result:=result and((i mod 16)=strtointdef('$'+
data.values['hex'][i],16));
end;

function HTMLValidate(const html:pchar):boolean;
var i:integer;
begin
result:=true;
for i:=2to paramcount do if stricomp(PChar(paramstr(i)),'-k')=0then
result:=result and (StrPos(html,pchar(paramstr(i+1)))=nil);
end;

function GetTrigger:integer;
var i:integer;
begin
result:=-1;
for i:=2 to paramcount do
if stricomp(PChar(paramstr(i)),'-tl')=0then result:=strtointdef(paramstr(i+1),5);
end;

function PlayWave(xwave:byte):bool;
const aWaves:array[0..2]of pchar=('PONG','OFFLINE','ONLINE');
begin
result:=false;
if strpos(getcommandline,' -nosound')<>nil then exit;
result:=playsound(awaves[xwave],hinstance,snd_resource or snd_sync);
end;

function InternetActup:boolean;
var hoffline:thandle;
dwwrite:dword;
a:atom;
cmdline:String;
comb:char;
batcmd,ab:array[0..255]of char;
statepath:array[0..max_path]of char;
txsuccess:bool;
i:integer;
begin
cmdline:=lowercase(getcommandline);
result := false;
inc(trigger);
if(trigger<gettrigger)or(gettrigger=-1)then exit;
trigger:=0;
result:=(scomport<>'');
txsuccess:=true;
for i:=2to paramcount do
if stricomp(pchar(paramstr(i)),'-bat')=0then result:=true;
if not result then exit;
writeln('Resetting internet connection. Please wait for ',irto div 60000,' minutes');
if pos(' -bat',cmdline)=0 then begin
comb:='1';
if pos(' -tx',cmdline)>0then txsuccess:=txsuccess and writefile(hcom,comb,1,
dwwrite,nil)else begin
//escapecommfunction(hcom,setdtr);
escapecommfunction(hcom,SETRTS);end;if not txsuccess then writeln('ComTXFail1:',
syserrormessage(getlasterror));
sleep(10000);
if pos(' -tx',cmdline)=0then
escapecommfunction(hcom,clrrts);
sleep(irto);
comb:='0';
if pos(' -tx',cmdline)>0then txsuccess:=txsuccess and writefile(hcom,comb,1,
dwwrite,nil)else escapecommfunction(hcom,clrdtr);if not txsuccess then
writeln('ComTXFail0:',syserrormessage(getlasterror));
end else begin
a:=globaladdatom(PChar('PingEx_OFFLINEBAT_'+floattostr(now)));
shellexecute(0,nil,'offline.bat',strfmt(batcmd,'%d %d',[a,trigger]),nil,
sw_hide);
writeln('Waiting for batch file to complete...');
while GlobalGetAtomName(a,ab,256)>0do sleep(2500);
end;
playwave(2);
writeln('Now rechecking...');
end;

function GetFileSize2(hf:thandle):DWord;
begin
result:= getfilesize(hf,nil);
if result=$FFFFFFFF then result:=0;
end;

function CharCount(const s:string;c:char):integer;
var i:integer;
begin
result:=0;
for i:=1to length(s)do if s[i]=c then inc(result);
end;

function FormatIP(var a,b,c,d:byte;size:integer;Host:string):String;
begin
result:=stringreplace(host,'@','%d',[rfReplaceAll]);
case size of
0:asm nop end;
1:begin if d=255then d:=0;D:=d+1;result:=format(result,[d]);end;
2:begin if c=255then begin c:=0;d:=d+1;end;if d=255then begin d:=0;c:=c+1;end;
d:=d+1;result:=format(result,[c,d]);end;
3:begin if b=255then b:=0;if c=255then begin c:=0;b:=b+1;end;
if d=255then begin d:=0;c:=c+1;end;d:=d+1;result:=format(result,[b,c,d]);end;
4:begin if a=255then a:=0;if b=255then begin b:=0;a:=a+1;end;if c=255then begin
c:=0;b:=b+1;end;if d=255then begin d:=0;c:=c+1;end;d:=d+1;result:=format(result,
[a,b,c,d]);end;
else begin writeln('Only up to 4 @ symbols allowed');exitprocess(
ERROR_INVALID_PARAMETER);end;
end;
end;



label PingLoop,URLLoop,lookup;
begin
getconsoletitle(oldtitle,max_path+1);
if stricomp('/resume',pchar(paramstr(1)))=0then exitprocess(globaldeleteatom(
strtoint(paramstr(2))));
if paramstr(1)='/?' then begin
writeln('Usage: ',extractfilename(paramstr(0)),' [address] [options]');
writeln('Options:');
writeln('-n count   Number of packets to send');
writeln('-d "data"  Data string to send in the echo request,by default is the system time,packet number and process id');
writeln('-w timeout timeout in milliseconds.');
writeln('-i TTL     Time To Live');
writeln('-v TOS     Type Of Service');
writeln('-de delay  Specifies the delay time between each request.');
writeln('-url       Use URL instead of ICMP [address] is the URL');
writeln('-urlr      Use random website URLs in the built-in database.');
writeln('-k "word"  HTML Error Keywords,used to tell if the URL request was successful, you can put more than one of this option in one command');
writeln('-l [size]  Size of data buffer');
writeln('-ir232 comport [timeout] Starts the internet resetter which toggles a relay to restart a misbehaving router/modem, [timeout] is in minutes');
writeln('-tl [count] Number of failed attemps before resetting the internet router/modem. Default is 5. This must be used with -ir232');
writeln('-bat        Run offline.bat file hiddenly when if went offline');
writeln('-tx         Transmitt ACSII 1s and 0s through the internet resetter serial port for using Arduino');
writeln('-nosound    Disable alert sounds.');
writeln('-dhex [size] Use a hexadecimal loop pattern. This will make the data string start from ASCII Number 1 to ASCII Letter F and then ASCII Number 0 then looping back around to make a string the specified size. This overrides the -d option.');
writeln('-ht          Uses PingEx HTTP Server url');
writeln;
writeln('Supported URL Protocols: HTTP,HTTPS,FTP');
writeln('You can put @ symbols in the address for ip address range example 127.0.0.@ will replace it with number between 1-255');
exitprocess(0);
end;
htimer:=createthread(nil,0,@timerthread,nil,0,timerid);
sitesres:=TResourceStream.Create(hinstance,'WEBSITES','TXT');
scomport:='';
for i:=2to paramcount do if stricomp('-ir232',pchar(paramstr(i)))=0then begin
scomport:='\\.\'+paramstr(i+1);
irto:=strtointdef(paramstr(i+2),5)*60000;
end;
if scomport<>''then begin
hcom:=createfile(pchar(scomport),generic_read or generic_write,0,nil,
open_existing,file_attribute_normal,0);
if hcom=invalid_handle_value then writeln('OpenCom:',syserrormessage(getlasterror));
end;
SetConsoleCtrlHandler(@ctrlping,true);
sites:=tstringlist.create;
sites.LoadFromStream(sitesres);sitesres.Free;
randomize;
icmperr:=tstringlist.Create;
errres:=tresourcestream.Create(hinstance,'ICMPERR','TXT');
icmperr.LoadFromStream(errres);
myicmp:=ticmp.create(nil);
ipoptions.OptionsSize:=myicmp.IPOptions.OptionsSize;
ipoptions.OptionsData:=myicmp.IPOptions.OptionsData;
IPOptions.TTL:=getttl;
iPOptions.TOS:=gettos;
myicmp.IPOptions:=ipoptions;
myicmp.TimeOut := gettimeout;
count:=1;
if (pos(' -url',lowercase(getcommandline))>0)or(paramcount=0)or(strpos(
getcommandline,' -ht')<>nil)then begin
if pos(' -urlr',lowercase(getcommandline))=0then begin
if paramcount<>0 then
writeln('Pinging ',paramstr(1),'...')else
writeln('Pinging http://172.86.120.127/test.asp...');
end else writeln('Pinging random URLs...');
a:=0;b:=0;c:=0;d:=0;
urlloop:
t:=gettickcount;
s:=paramstr(1);
if(paramcount=0)or(stricomp('-urlspeed',pchar(paramstr(1)))=0)then s:=
'http://172.86.120.127/test.asp';
s:=formatip(a,b,c,d,charcount(paramstr(1),'@'),s);
if pos(' -urlr',lowercase(getcommandline))>0then begin s:='http://'+sites[random(
sites.count)]+'/';write(copy(s,length('http://')+1,length(s)));end;
if pos('ftp:',lowercase(s))=0then
if strscan(pchar(s),'?')=nil then s:=s+'?'else s:=s+'&';
if pos('ftp:',lowercase(s))=0 then
s:=format(
'%sping.count=%d&ping.success=%d&ping.pid=%d&ping.size=%d',[s,count,successcount,
getcurrentprocessid,getdatasizep]);
if strscan(getcommandline,'@')<>nil then begin sh:=copy(s,pos('://',s)+3,length(s));
delete(sh,pos('?',sh),length(sh));write(sh,#32);end;
hstat:=URLDownloadToCacheFile(nil,pchar(s),urlfile,max_path,0,nil);
if (hstat=s_ok) then
begin
lastpong:=now;
hf:=createfile(urlfile,generic_read,0,nil,open_Existing,file_attribute_normal,0);
setlength(urlbuff,getfilesize(hf,nil)+1);
readfile(hf,urlbuff[0],length(urlbuff)-1,bread,nil);
trigger:=0;
if not htmlvalidate(@urlbuff[0]) then
write('KWFound: ');
if processpingexserver(@urlbuff[0])then
writeln(datetimetostr(now),'#',count,' Title:',gethtmltitle,' - Got ',getsize(
getfilesize(hf,nil)),' in ',pingtime(gettickcount-t))else begin
writeln(datetimetostr(now),'#',count,'Failed:',gethtmltitle,' - Got ',getsize(
getfilesize(hf,nil)),' in ',pingtime(gettickcount-t));dec(count);playwave(1);end;
bmin:=min(GetFilesize2(hf),bmin);
bmax:=max(getfilesize2(hf),bmax);
totalb:=totalb+getfilesize2(hf);
closehandle(hf);
deletefile(urlfile);
if htmlvalidate(@urlbuff[0]) then begin PlayWave(0); inc(successcount);end;
end else begin playwave(1);
 Writeln(datetimetostr(now),'#',count,' URL Error:',inttohex(hstat,0),#32,
geturlerror);
internetactup;
end;
totalt:=totalt+(gettickcount-t);
tmin:=min(tmin,gettickcount-t);
tmax:=max(tmax,gettickcount-t);
inc(count);
sleep(getdelay);
if getpacketcount=count-1 then ctrlping(ctrl_close_event);
goto urlloop;
end;
lookup:if strscan(getcommandline,'@')=nil then begin
myicmp.HostName:=paramstr(1);
if not myicmp.LookupAddress then begin
writeln(datetimetostr(now),' Failed to lookup ',myicmp.hostname);
sleep(2500);
playwave(1);
goto lookup;
end;end;
writeln('Pinging ',myicmp.hostname,'[',myicmp.hostip,']...');
a:=0;b:=0;c:=0;d:=0;
PingLoop:if strscan(getcommandline,'@')<>nil then begin
myicmp.HostName:=formatip(a,b,c,d,charcount(paramstr(1),'@'),myicmp.HostName);
write(myicmp.hostname,#32);
end;
t:=gettickcount;
myicmp.Data:=GetDataString;
reply:=myicmp.ping;
if reply=nil then begin
writeln(Datetimetostr(now),'#',count,' - No response');
playwave(0);
internetactup;
end else begin lastpong:=now;
writeln(datetimetostr(now),'#',count,#32,inet_ntoa(in_addr(reply.address)),' - ',
getstatcode,' Time:',pingtime(gettickcount-t),' TTL:',reply.options.ttl);
trigger:=0;
end;
totalt:=totalt+(gettickcount-t);
tmin:=min(tmin,gettickcount-t);
tmax:=max(tmax,gettickcount-t);
inc(count);
sleep(getdelay);
if getpacketcount=count-1 then ctrlping(ctrl_close_event);
goto pingloop;
end.

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

The post PingEx Alternative to Network PING first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/pingex-alternative-to-network-ping/feed/ 1
MoveEx The Windows file mover and deleter on startup https://delphijustin.biz/moveex-the-windows-file-mover-and-deleter-on-startup/?utm_source=rss&utm_medium=rss&utm_campaign=moveex-the-windows-file-mover-and-deleter-on-startup https://delphijustin.biz/moveex-the-windows-file-mover-and-deleter-on-startup/#respond Thu, 20 Jun 2019 16:32:59 +0000 https://delphijustin.biz/?p=194 This tool allows you to delete or move files at winidows bootup. It does it like its a service, BUT it doesnt use a Windows nt service. It uses Windows NT Exported function MoveFileEx. By using that the file will be deleted or moved before anything loads. Its a great tool to have if you …

The post MoveEx The Windows file mover and deleter on startup first appeared on Delphijustin industries.

]]>

This tool allows you to delete or move files at winidows bootup. It does

it like its a service, BUT it doesnt use a Windows nt service. It uses

Windows NT Exported function MoveFileEx. By using that the file will be

deleted or moved before anything loads. Its a great tool to have if you

have a virus that is preventing itself from being deleted. A batch file

has been included called delete.bat. Just drag and drop the file you wish

to delete onto it. To see on ways to use this tool just open moveex by

itself at the command prompt.

 

WARNING THIS TOOL HASN’T BEEN TESTED ON WINDOWS 9X/ME,AND ACCOURDING TO

THE WIN32 API MANUAL IT SAYS THAT ONLY WINDOWS NT PLATFORM SUPPORT

OPERATIONS ON REBOOT.

 

More tools available at

www.delphijustin.biz

 

program MoveEx;
{$RESOURCE moveex32.res}
{$APPTYPE Console}

uses
  SysUtils,
  windows,
  Classes;

var dwopt:Dword;
b:boolean;
s:string;

begin
if paramcount<2 then begin
writeln('Usage: ',extractfilename(paramstr(0)),' oldfilename [newfilename] [options]');
writeln('Options:');
writeln('/D         Deletes the file instead of moving/renaming it');
writeln('/E         Work even when newfilename exists');
writeln('/T         Try moving/deleting file before doing it on next boot');
writeln('OPTIONS ARE CASE SENSITVE');
writeln('IF FILEPATHS CONTAIN SPACES THEY SHOULD HAVE QUOTES(") SURROUNDING THEM');
write('Press Enter to quit...');
readln(s);
exitprocess(0);
end;
setlasterror(0);
dwopt:=0;
if strpos(getcommandline,' /E')<>nil then
dwopt:=MOVEFILE_REPLACE_EXISTING;
if StrPos(getcommandline,' /T')<>nil then
begin
if StrPos(getcommandline,' /D')<>nil then
b:=deletefile(Pchar(paramstr(1)))else
b:=movefileex(PChar(paramstr(1)),pchar(paramstr(2)),dwopt);
writeln('Try:',syserrormessage(getlasterror));
if b then exitprocess(0);
end;
dwopt:=dwopt or MOVEFILE_DELAY_UNTIL_REBOOT;
if strpos(getcommandline,' /D')=nil then
MoveFileex(PChar(paramstr(1)),pchar(paramstr(2)),dwopt) else
movefileex(pchar(paramstr(1)),nil,dwopt);
writeln(syserrormessage(getlasterror));
exitprocess(getlasterror);
end.

All programs are virus free. Some antivirus software might say its "suspicious" or a "Potentionaly Unwanted Program". Some of them rate them on what there code looks like no matter if theres a definition in the virus database. If any of them are detected any Antivirus I will zip the software with the password "justin" j is lowercase

The post MoveEx The Windows file mover and deleter on startup first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/moveex-the-windows-file-mover-and-deleter-on-startup/feed/ 0
IP Address Calculators https://delphijustin.biz/ip-address-calculators/?utm_source=rss&utm_medium=rss&utm_campaign=ip-address-calculators https://delphijustin.biz/ip-address-calculators/#respond Thu, 20 Jun 2019 16:03:37 +0000 https://delphijustin.biz/?p=190 This here is a collection of tools that a Network Administrator will find useful. It calculates subnet masks, IP address ranges and number of hosts that the subnet can have. One that does IPv4 address and another that does IPv6 addresses.   It uses win32 api functions to convert IP addresses into their integer form …

The post IP Address Calculators first appeared on Delphijustin industries.

]]>

This here is a collection of tools that a Network Administrator will

find useful. It calculates subnet masks, IP address ranges and number

of hosts that the subnet can have. One that does IPv4 address and

another that does IPv6 addresses.

 

It uses win32 api functions to convert IP addresses into their

integer form and back into a string. The IPv6 will require windows xp

or higher

 

More free tools available at http://www.delphijustin.biz

program ipcalc;
//IPv4 Calculator
{$APPTYPE Console}
{$RESOURCE ipcalc32.res}
uses
  SysUtils,
  windows,
  winsock,
  math,
  Classes;

var ip,subnet:string;
dummy1:twsadata;
aip,asubnet,wildcard,sip,eip,cip:dword;
nip1,nip2:array[1..4]of byte;
i:integer;

label TryAgain,validmask;
begin
if wsastartup($101,dummy1)<>0 then begin
writeln('Error initializing winsock');
exitprocess(1);
end;
TryAgain:
write('Enter IP Address:');readln(ip);
aip := inet_addr(pchar(ip));
write('Enter subnet mask or prefix:');
readln(subnet);
asubnet:=inet_addr(pchar(subnet));
//write('Enter prefix or leave blank:');
//readln(range);
if strscan(Pchar(subnet),'.')=nil then begin
copymemory(@nip1,@asubnet,4);
asubnet:=Trunc(IntPower(2,nip1[4])-1);
end else begin
for i:= 7 to 31 do if intpower(2,i)-1=asubnet then goto validmask;
write('Invalid Subnet mask! Try again(Yes/No)?');
readln(ip);
if strscan(pchar(uppercase(ip)),'Y')<>nil then goto tryagain;
end;
validmask:
writeln('Subnet Mask:',inet_ntoa(in_addr(asubnet)));
wildcard:=not asubnet;
copymemory(@nip1,@wildcard,4);
nip2[4]:=nip1[1];
nip2[3]:=nip1[2];
nip2[2]:=nip1[3];
nip2[1]:=nip1[4];
copymemory(@cip,@nip2,4);
sip:=aip and asubnet;
eip:=sip+wildcard;
writeln('Wildcard Mask:',inet_ntoa(in_addr(wildcard)));
writeln('Starting Address:',inet_ntoa(in_addr(sip)));
writeln('Ending Address:',inet_ntoa(in_addr(eip)));
writeln('Max. Hosts:',cip);
//writeln('Class: ',getipclass(sip));
write('Try again(Yes/No)?');
readln(ip);
if strscan(PChar(Uppercase(ip)),'Y')<>nil then goto TryAgain;
wsacleanup;
end.
program ipcalc6;
//IPv6 Calculator
{$APPTYPE Console}
{$RESOURCE ipcalc632.res}
uses
  SysUtils,
  windows,
  Classes;

type TIN6_ADDR=array[0..15]of byte;

function RtlIpv6StringToAddressExA(astr:pchar;var address:tin6_addr;scope,
port:pointer):longint;stdcall;external 'ntdll.dll';
function RtlIpv6AddressToStringExA(var address:tin6_addr;scope,port:integer;
astr:pchar;len:PDWord):longint;stdcall;external 'ntdll.dll';

var ip,swcint:string;
aip,subnet,sip,eip,wildcard:tin6_addr;
bip,sSubnet,sSip,sEip,sWildcard:array[0..255] of char;
scope,cb,sum:dword;
i,prefix:integer;
port:word;
ce:byte;
wcint:int64;

function AddWithCarry(a,b:byte;var c:byte):byte;
begin
result:=(a xor b)xor c;
c:=(a and b)or(c and(a xor b));
end;

begin
ce:=0;
write('Enter IPv6 Address:'); //ask for a ip address
readln(ip);
write('Enter Subnet Prefix:'); //ask for the subnet prefix
readln(prefix);
zeromemory(@subnet,16);
if prefix>0 then subnet[0]:=subnet[0] or 128;//1 //bit setting on subnet mask
if prefix>1 then subnet[0]:=subnet[0] or 64;//2
if prefix>2 then subnet[0]:=subnet[0] or 32;//3
if prefix>3 then subnet[0]:=subnet[0] or 16;//4
if prefix>4 then subnet[0]:=subnet[0] or 8;//5
if prefix>5 then subnet[0]:=subnet[0] or 4;//6
if prefix>6 then subnet[0]:=subnet[0] or 2;//7
if prefix>7 then subnet[0]:=subnet[0] or 1;//8
if prefix>8 then subnet[1]:=subnet[1] or 128;//1
if prefix>9 then subnet[1]:=subnet[1] or 64;//2
if prefix>10 then subnet[1]:=subnet[1] or 32;//3
if prefix>11 then subnet[1]:=subnet[1] or 16;//4
if prefix>12 then subnet[1]:=subnet[1] or 8;//5
if prefix>13 then subnet[1]:=subnet[1] or 4;//6
if prefix>14 then subnet[1]:=subnet[1] or 2;//7
if prefix>15 then subnet[1]:=subnet[1] or 1;//8
if prefix>16 then subnet[2]:=subnet[2] or 128;//1
if prefix>17 then subnet[2]:=subnet[2] or 64;//2
if prefix>18 then subnet[2]:=subnet[2] or 32;//3
if prefix>19 then subnet[2]:=subnet[2] or 16;//4
if prefix>20 then subnet[2]:=subnet[2] or 8;//5
if prefix>21 then subnet[2]:=subnet[2] or 4;//6
if prefix>22 then subnet[2]:=subnet[2] or 2;//7
if prefix>23 then subnet[2]:=subnet[2] or 1;//8
if prefix>24 then subnet[3]:=subnet[3] or 128;//1
if prefix>25 then subnet[3]:=subnet[3] or 64;//2
if prefix>26 then subnet[3]:=subnet[3] or 32;//3
if prefix>27 then subnet[3]:=subnet[3] or 16;//4
if prefix>28 then subnet[3]:=subnet[3] or 8;//5
if prefix>29 then subnet[3]:=subnet[3] or 4;//6
if prefix>30 then subnet[3]:=subnet[3] or 2;//7
if prefix>31 then subnet[3]:=subnet[3] or 1;//8
if prefix>32 then subnet[4]:=subnet[4] or 128;//1
if prefix>33 then subnet[4]:=subnet[4] or 64;//2
if prefix>34 then subnet[4]:=subnet[4] or 32;//3
if prefix>35 then subnet[4]:=subnet[4] or 16;//4
if prefix>36 then subnet[4]:=subnet[4] or 8;//5
if prefix>37 then subnet[4]:=subnet[4] or 4;//6
if prefix>38 then subnet[4]:=subnet[4] or 2;//7
if prefix>39 then subnet[4]:=subnet[4] or 1;//8
if prefix>40 then subnet[5]:=subnet[5] or 128;//1
if prefix>41 then subnet[5]:=subnet[5] or 64;//2
if prefix>42 then subnet[5]:=subnet[5] or 32;//3
if prefix>43 then subnet[5]:=subnet[5] or 16;//4
if prefix>44 then subnet[5]:=subnet[5] or 8;//5
if prefix>45 then subnet[5]:=subnet[5] or 4;//6
if prefix>46 then subnet[5]:=subnet[5] or 2;//7
if prefix>47 then subnet[5]:=subnet[5] or 1;//8
if prefix>48 then subnet[6]:=subnet[6] or 128;//1
if prefix>49 then subnet[6]:=subnet[6] or 64;//2
if prefix>50 then subnet[6]:=subnet[6] or 32;//3
if prefix>51 then subnet[6]:=subnet[6] or 16;//4
if prefix>52 then subnet[6]:=subnet[6] or 8;//5
if prefix>53 then subnet[6]:=subnet[6] or 4;//6
if prefix>54 then subnet[6]:=subnet[6] or 2;//7
if prefix>55 then subnet[6]:=subnet[6] or 1;//8
if prefix>56 then subnet[7]:=subnet[7] or 128;//1
if prefix>57 then subnet[7]:=subnet[7] or 64;//2
if prefix>58 then subnet[7]:=subnet[7] or 32;//3
if prefix>59 then subnet[7]:=subnet[7] or 16;//4
if prefix>60 then subnet[7]:=subnet[7] or 8;//5
if prefix>61 then subnet[7]:=subnet[7] or 4;//6
if prefix>62 then subnet[7]:=subnet[7] or 2;//7
if prefix>63 then subnet[7]:=subnet[7] or 1;//8
if prefix>64 then subnet[8]:=subnet[8] or 128;//1
if prefix>65 then subnet[8]:=subnet[8] or 64;//2
if prefix>66 then subnet[8]:=subnet[8] or 32;//3
if prefix>67 then subnet[8]:=subnet[8] or 16;//4
if prefix>68 then subnet[8]:=subnet[8] or 8;//5
if prefix>69 then subnet[8]:=subnet[8] or 4;//6
if prefix>70 then subnet[8]:=subnet[8] or 2;//7
if prefix>71 then subnet[8]:=subnet[8] or 1;//8
if prefix>72 then subnet[9]:=subnet[9] or 128;//1
if prefix>73 then subnet[9]:=subnet[9] or 64;//2
if prefix>74 then subnet[9]:=subnet[9] or 32;//3
if prefix>75 then subnet[9]:=subnet[9] or 16;//4
if prefix>76 then subnet[9]:=subnet[9] or 8;//5
if prefix>77 then subnet[9]:=subnet[9] or 4;//6
if prefix>78 then subnet[9]:=subnet[9] or 2;//7
if prefix>79 then subnet[9]:=subnet[9] or 1;//8
if prefix>80 then subnet[10]:=subnet[10] or 128;//1
if prefix>81 then subnet[10]:=subnet[10] or 64;//2
if prefix>82 then subnet[10]:=subnet[10] or 32;//3
if prefix>83 then subnet[10]:=subnet[10] or 16;//4
if prefix>84 then subnet[10]:=subnet[10] or 8;//5
if prefix>85 then subnet[10]:=subnet[10] or 4;//6
if prefix>86 then subnet[10]:=subnet[10] or 2;//7
if prefix>87 then subnet[10]:=subnet[10] or 1;//8
if prefix>88 then subnet[11]:=subnet[11] or 128;//1
if prefix>89 then subnet[11]:=subnet[11] or 64;//2
if prefix>90 then subnet[11]:=subnet[11] or 32;//3
if prefix>91 then subnet[11]:=subnet[11] or 16;//4
if prefix>92 then subnet[11]:=subnet[11] or 8;//5
if prefix>93 then subnet[11]:=subnet[11] or 4;//6
if prefix>94 then subnet[11]:=subnet[11] or 2;//7
if prefix>95 then subnet[11]:=subnet[11] or 1;//8
if prefix>96 then subnet[12]:=subnet[12] or 128;//1
if prefix>97 then subnet[12]:=subnet[12] or 64;//2
if prefix>98 then subnet[12]:=subnet[12] or 32;//3
if prefix>99 then subnet[12]:=subnet[12] or 16;//4
if prefix>100 then subnet[12]:=subnet[12] or 8;//5
if prefix>101 then subnet[12]:=subnet[12] or 4;//6
if prefix>102 then subnet[12]:=subnet[12] or 2;//7
if prefix>103 then subnet[12]:=subnet[12] or 1;//8
if prefix>104 then subnet[13]:=subnet[13] or 128;//1
if prefix>105 then subnet[13]:=subnet[13] or 64;//2
if prefix>106 then subnet[13]:=subnet[13] or 32;//3
if prefix>107 then subnet[13]:=subnet[13] or 16;//4
if prefix>108 then subnet[13]:=subnet[13] or 8;//5
if prefix>109 then subnet[13]:=subnet[13] or 4;//6
if prefix>110 then subnet[13]:=subnet[13] or 2;//7
if prefix>111 then subnet[13]:=subnet[13] or 1;//8
if prefix>112 then subnet[14]:=subnet[14] or 128;//1
if prefix>113 then subnet[14]:=subnet[14] or 64;//2
if prefix>114 then subnet[14]:=subnet[14] or 32;//3
if prefix>115 then subnet[14]:=subnet[14] or 16;//4
if prefix>116 then subnet[14]:=subnet[14] or 8;//5
if prefix>117 then subnet[14]:=subnet[14] or 4;//6
if prefix>118 then subnet[14]:=subnet[14] or 2;//7
if prefix>119 then subnet[14]:=subnet[14] or 1;//8
if prefix>120 then subnet[15]:=subnet[15] or 128;//1
if prefix>121 then subnet[15]:=subnet[15] or 64;//2
if prefix>122 then subnet[15]:=subnet[15] or 32;//3
if prefix>123 then subnet[15]:=subnet[15] or 16;//4
if prefix>124 then subnet[15]:=subnet[15] or 8;//5
if prefix>125 then subnet[15]:=subnet[15] or 4;//6
if prefix>126 then subnet[15]:=subnet[15] or 2;//7
if prefix>127 then subnet[15]:=subnet[15] or 1;//8
rtlipv6stringtoaddressexa(pchar(ip),aip,@scope,@port);
//Convert a IP adresss in the string to a binary
for i:=0to 15 do begin//generates the wildcard mask and start and end addresses
wildcard[i]:=not subnet[i];
sip[i]:=aip[i] and subnet[i];
eip[i]:=addwithcarry(sip[i],wildcard[i],ce);
end;
cb:=256;
rtlipv6addresstostringexa(subnet,0,0,sSubnet,@cb);//convert subnet to string
cb:=256;
rtlipv6addresstostringexa(aip,0,0,bip,@cb);//convert ending address to string
writeln('IPv6 Address(short): ',bip);
writeln('IPv6 Address(long): ',inttohex(aip[0],2),inttohex(aip[1],2),':',
inttohex(aip[2],2),inttohex(aip[3],2),':',inttohex(aip[4],2),inttohex(aip[5],2)
,':',inttohex(aip[6],2),inttohex(aip[7],2),':',inttohex(aip[8],2),
inttohex(aip[9],2),':',inttohex(aip[10],2),inttohex(aip[11],2),':',
inttohex(aip[12],2),inttohex(aip[13],2),':',
inttohex(aip[14],2),inttohex(aip[15],2));
writeln('ScopeID:',scope);
writeln('Port:',port);
writeln('Microsoft Address: ',stringreplace(bip,':','-',[rfReplaceAll])+
'.ipv6-literal.net');
sum:=0;
for i:=0to 15 do sum:=sum+aip[i];
if sum*aip[15]=1 then Writeln('This is a loopback address');
write('Is part of a Local Unicast Network:');
if (aip[0]>$fb)and(aip[0]<$fe)then write('Yes')else
write('No');
writeln('');
write('Is link-local address:');
if (aip[0]=$fe)and(aip[1]=$80)then write('Yes')else write('No');
writeln('');
write('Prefix L bit:');
if aip[0] and 128>0 then Write('Yes')else write('No');
writeln('');
write('GlobalID:$');
for i:=1to 5 do write(inttohex(aip[i],2));
writeln('');
write('Subnet ID:$');
for i:=6to 7 do write(Inttohex(aip[i],2));
writeln('');
write('Interface ID:$');
for i:=8 to 15 do write(inttohex(aip[i],2));
writeln('');
cb:=256;
rtlipv6addresstostringexa(wildcard,0,0,sWildcard,@cb);
writeln('Subnet Mask: ',sSubnet);
if strscan(sWildCard,'.')=nil then  swcint:=strpas(sWildCard)else
begin
swcint:=inttohex(wildcard[0],2)+inttohex(wildcard[1],2)+':'+
inttohex(wildcard[2],2)+inttohex(wildcard[3],2)+':'+
inttohex(wildcard[4],2)+inttohex(wildcard[5],2)+':'+
inttohex(wildcard[6],2)+inttohex(wildcard[7],2)+':'+
inttohex(wildcard[8],2)+inttohex(wildcard[9],2)+':'+
inttohex(wildcard[10],2)+inttohex(wildcard[11],2)+':'+
inttohex(wildcard[12],2)+inttohex(wildcard[13],2)+':'+
inttohex(wildcard[14],2)+inttohex(wildcard[15],2);
end;
writeln('Wildcard Mask: ',swcint);
swcint:=stringreplace(swildcard,':','',[rfReplaceAll]);
cb:=256;
rtlipv6addresstostringexa(sip,0,0,ssip,@cb);
writeln('Starting Address: ',ssip);
cb:=256;
rtlipv6addresstostringexa(eip,0,0,seip,@cb);
writeln('Ending Address: ',seip);
wcint:=StrToInt64Def('$'+swcint,-1);
if wcint>-1 then writeln('Max. Hosts: ',wcint)else
writeln('Max. Hosts: Overflow');
writeln('Press enter to exit...');
readln(ip);
end.

The post IP Address Calculators first appeared on Delphijustin industries.

]]>
https://delphijustin.biz/ip-address-calculators/feed/ 0