DelPhi 2020. 4. 12. 13:54

1.Classes 추가

 

 uses 

 Classes;

2.값을 저장하고 불러올 Packed record를 만듭니다!

 type

 TPerson = Packed record 

 sName : Array[1..50] of Char;

 nAge   : Integer; 

 end;

 //저장할 데이터의 크기를 고정시켜줍니다.

 

 var

 Person : TPerson;

 

 3. dll 저장!

  procedure WriteDll;

 

  var

  sFilePath : string;

  Stream   : TMemoryStream;

 

  begin

  sFilePath := '저장될 경로명' + '파일명.dll';

  Stream := TMemoryStream.Create;

 

  try

  Stream.Clear;

  Stream.Write(Person, SizeOf(TPerson))

   Stream.SaveToFile(sFilePath);

   finally

   Stream.Free;

   end;

  4.dll 불러옵니다

  procedure ReadDll;

  var

 sFilePath : string;

  Stream   : TMemoryStream;

begin

  sFilePath := '불러올 경로명' + '파일명.dll';

   Stream := TMemoryStream.Create;

   FillChar(Person, Sizeof(TPerson), #0); //공백으로 채워줍니다.  

  try

  Stream.LoadFromFile(sFilePath); 

  Stream.Position := 0;

  Stream.Read(Person, SizeOf(TPerson)); 

  finally

  Stream.Free;

  //공백으로 채웠기 때문에 Trim을 사용해 문자열의 양쪽 공백을 제가한뒤 사용

 ShowMessage(Trim(Person.sName));

  end;

posted by 핵커 커뮤니티
:
DelPhi 2020. 4. 12. 13:50

<?
function random_string() {
$random= "";
for( $i=0; $i<rand(7,8); $i++) {
     if(rand(0,1)) {
$random .= rand(0, 9);
} else {
$random .= chr(rand(98, 122));
}
}
return $random;
}
print_r(random_string());
?>

posted by 핵커 커뮤니티
:
DelPhi 2020. 4. 12. 13:50

//랜덤 문자 만들기
function random_string($len) {
 $str = '1234567890abcdefghijklmnopqrstuvwxyz';
 $strlen = strlen($str) -1;
 $return = '';
 for ($i = 0; $i < $len; $i++) {
  $rand = rand(0, $strlen);
  $return .= $str[$rand];
 }
 return $return;
}

posted by 핵커 커뮤니티
:
DelPhi 2020. 4. 12. 13:47

int APIENTRY DllMain(HMODULE hModule, DWORD reason, LPVOID reserved)

{

if(reason == DLL_PROCESS_ATTACH)

{

hWindowA = FindWindowA(NULL,"인젝터 "); //윈도우캡션명

if(hWindowA != NULL)

{

}

else

{

posted by 핵커 커뮤니티
:
DelPhi 2020. 4. 12. 13:44

function Ch4ckPr0c4(Process: String): Boolean;

var

ContinueLoop: BOOL;

FSnapshotHandle: THandle;

FProcessEntry32: TProcessEntry32;

begin

Result := False;

FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);

FProcessEntry32.dwSize := Sizeof(FProcessEntry32);

ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);

while Integer(ContinueLoop) <> 0 do

begin

if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile))

= UpperCase(Process)) or (UpperCase(FProcessEntry32.szExeFile)

= UpperCase(Process))) then

begin

PID := FProcessEntry32.th32ProcessID;

if PID <> 0 then

begin

HandleWindow := OpenProcess(PROCESS_ALL_ACCESS, False, PID);

Result := True;

Break;

end;

end;

ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);

end;

CloseHandle(FSnapshotHandle);

end;

posted by 핵커 커뮤니티
: