Hola tengo el siguiente codigo :
Código Delphi
[-]
unit tool;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants,
System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, IdBaseComponent,
IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, Vcl.StdCtrls, IdSSLOpenSSL,
IdIOHandler, IdIOHandlerSocket, IdIOHandlerStack, IdSSL, uLkJSON;
type
TForm1 = class(TForm)
StatusBar1: TStatusBar;
PageControl1: TPageControl;
TabSheet1: TTabSheet;
TabSheet2: TTabSheet;
nave: TIdHTTP;
TabSheet3: TTabSheet;
TabSheet4: TTabSheet;
GroupBox1: TGroupBox;
ip: TEdit;
Button1: TButton;
GroupBox2: TGroupBox;
console1: TMemo;
ssl: TIdSSLIOHandlerSocketOpenSSL;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
api_key: string;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
api_key := 'test';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
code: string;
var
json, json2: TlkJSONobject;
i: integer;
var
ip_found, country_found, country_code, region_name, postal_code: string;
var
ip_str, product, version, data, cpe, timestamp, last_update, port, os, isp,
ans, banner: string;
begin
code := nave.Get('https://api.shodan.io/shodan/host/' + ip.Text + '?key='
+ api_key);
json := TlkJSON.ParseText(code) as TlkJSONobject;
for i := 0 to json.Field['data'].Count - 1 do
begin
console1.Lines.Add('------------------------------------');
json2 := (json.Field['data'].Child[i] as TlkJSONobject);
try
begin
console1.Lines.Add(json.Field['ip_strz'].SelfTypeName);
end;
except
end;
end;
end;
end.
El problema es que estoy tratando de verificar si un field existe por ejemplo ip_strz , en el control uso SeldTypeName para ver si es null y asi darme cuenta pero siempre me da error , trate usando try y except pero sigue dando error , el error que siempre da es este :
Código:
Acess violation at adress in module 'shodan.exe' , read of address 000000
¿ Alguien me puede ayudar ?