Cartman. Posted June 27, 2014 Report Posted June 27, 2014 by madResthis guy will write some strings in EXE file1) parameter: server fullpath2) strings to writeprocedure WriteSettings(ServerFile: string; Settings: string);var ResourceHandle: THandle; pwServerFile: PWideChar;begin GetMem(pwServerFile, (Length(ServerFile) + 1) * 2); try StringToWideChar(ServerFile, pwServerFile, Length(ServerFile) * 2); ResourceHandle := BeginUpdateResourceW(pwServerFile, False); UpdateResourceW(ResourceHandle, MakeIntResourceW(10), 'SETTINGS', 0, @settings[1], Length(Settings) + 1); EndUpdateResourceW(ResourceHandle, False); finally FreeMem(pwServerFile); end;end;------------------------------------------------this guy will read written data from modified exe file1) parameter: server's fullpathfunction ReadSettings(ServerFile: string): string;var ServerModule: HMODULE; ResourceLocation: HRSRC; ResourceSize: dword; ResourceHandle: THandle; ResourcePointer: pointer;begin ServerModule := LoadLibrary(pchar(ServerFile)); try ResourceLocation := FindResource(ServerModule, 'SETTINGS', RT_RCDATA); ResourceSize := SizeofResource(ServerModule, ResourceLocation); ResourceHandle := LoadResource(ServerModule, ResourceLocation); ResourcePointer := LockResource(ResourceHandle); if ResourcePointer <> nil then begin SetLength(Result, ResourceSize - 1); CopyMemory(@Result[1], ResourcePointer, ResourceSize); FreeResource(ResourceHandle); end; finally FreeLibrary(ServerModule); end;end;usage of functions in editorvar Settings: string;begin Settings := 'here String to write'; WriteSettings('here server.exe path', Settings); WriteLn(ReadSettings('server.exe')); // <--- this guy will read written data from server.exeend.---------------------------------------------------now code serverthis guy will load written datafunction LoadSettings: string;var ResourceLocation: HRSRC; ResourceSize: dword; ResourceHandle: THandle; ResourcePointer: pointer;begin ResourceLocation := FindResource(hInstance, 'SETTINGS', RT_RCDATA); ResourceSize := SizeofResource(hInstance, ResourceLocation); ResourceHandle := LoadResource(hInstance, ResourceLocation); ResourcePointer := LockResource(ResourceHandle); if ResourcePointer <> nil then begin SetLength(Result, ResourceSize - 1); CopyMemory(@Result[1], ResourcePointer, ResourceSize); FreeResource(ResourceHandle); end;end;usage of this function in serverPROCEDURE somefuckedupproc (yowazzup; RockMeBaby)var buffer : string;beginbuffer := LoadSettings;end. Quote