Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

"kodowanie"? plików ini czy jak to się nazywa


Rekomendowane odpowiedzi

Opublikowano

Chodzi mi o to czy da się jakoś zakodować pliki ini by były do podglądu tylko przez program a nie przez użytkownika?

10 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 200 | 300 400 | 500 | 600 | 700 | 800 | 900 | 1000logoskillowcy.png

 

Opublikowano

nie kapuje nic z tego ^^ to jest kod, który czyta ini z ftp tak?

10 20 | 30 | 40 | 50 | 60 | 70 | 80 | 90 | 100 | 200 | 300 400 | 500 | 600 | 700 | 800 | 900 | 1000logoskillowcy.png

 

Opublikowano

Tam na dole masz gotowy kod.

#include <Crypt.au3>

Ini_Write("Password","Filename.ini","Section","Key","Value")

$Value = Ini_Read("Password","Filename.ini","Section","Key")
if Not @ Then _
MsgBox(0,"MSG",$Value)

Func Ini_Write($Password,$Filename,$Section,$Key,$Value)
_Crypt_Startup()
if @ Then Return SetError(1,@,False)
$hKey =_Crypt_DeriveKey($Password,$CALG_RC4)
if @ Then Return SetError(2,@,False)
$ByteStruct =  DllStructCreate("BYTE[" & StringLen($Value) & "]")
DllStructSetData($ByteStruct,1,$Value)
$StrByte = String(DllStructGetData($ByteStruct,1))
$EncryptedValue = _Crypt_EncryptData($StrByte,$hKey,$CALG_USERKEY)
if @ Then Return SetError(3,@,False)
IniWrite($Filename,$Section,$Key,$EncryptedValue)
if @ Then Return SetError(4,@,False)
_Crypt_DestroyKey($hKey)
_Crypt_Shutdown()
Return SetError(0,0,True)
EndFunc


Func Ini_Read($Password,$Filename,$Section,$Key,$Default = "NotFound")
$EncryptedValue = IniRead($Filename,$Section,$Key,$Default)
if $EncryptedValue == $Default Then Return SetError(1,0,$Default)
_Crypt_Startup()
if @ Then Return SetError(2,@,$Default)
$hKey =_Crypt_DeriveKey($Password,$CALG_RC4)
if @ Then Return SetError(3,@,$Default)
$Binary = _Crypt_DecryptData($EncryptedValue,$hKey,$CALG_USERKEY)
if @ Then Return SetError(4,@,$Default)
$StrByte = BinaryToString($Binary)
if @ Then Return SetError(5,@,$Default)
$ByteStruct =  DllStructCreate("BYTE[" & BinaryLen($StrByte) & "]")
DllStructSetData($ByteStruct,1,$StrByte)
$CharStruct = _
DllStructCreate("CHAR[" & DllStructGetSize($ByteStruct) & "]",DllStructGetPtr($ByteStruct))
_Crypt_DestroyKey($hKey)
_Crypt_Shutdown()
Return SetError(0,0,DllStructGetData($CharStruct,1))
EndFunc

Ale to jest chyba prostsze, a poziom zabezpieczenia ten sam (czyli zerowy):

#include <MsgBoxConstants.au3>
#include <WinAPIFiles.au3>

Example()

Func Example()
    ; Create a constant variable in Local scope of the filepath that will be read/written to.
    Local Const $sFilePath = @DesktopDir & "\msvcr100.dll"

    ; Write the value of 'AutoIt' to the key 'Title' and in the section labelled 'General'.
    IniWrite($sFilePath, "General", "Title", "AutoIt")

    ; Read the INI file for the value of 'Title' in the section labelled 'General'.
    Local $sRead = IniRead($sFilePath, "General", "Title", "Default Value")

    ; Display the value returned by IniRead.
    MsgBox($MB_SYSTEMMODAL, "", "The value of 'Title' in the section labelled 'General' is: " & $sRead)

    ; Delete the key labelled 'Title'.
    IniDelete($sFilePath, "General", "Title")

    ; Read the INI file for the value of 'Title' in the section labelled 'General'.
    $sRead = IniRead($sFilePath, "General", "Title", "Default Value")

    ; Display the value returned by IniRead. Since there is no key stored the value will be the 'Default Value' passed to IniRead.
    MsgBox($MB_SYSTEMMODAL, "", "The value of 'Title' in the section labelled 'General' is: " & $sRead)

EndFunc   ;==>Example

Badz swiadom tego, ze jak ktos naprawde bedzie chcial zajrzec do tego .ini to sobie po prostu zdekompiluje plik .exe.

 

 

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...