Я понял свою ошибку , если ставить вместо записи в файло, мессадж бокс то текст в нормльном виде, а в файле он вообще на бинарник в блокноте похож вот сурс либы:
| Код | library hook;
uses windows, advApiHook;
var TrueHttpSendRequest: function(hRequest: dword; lpszHeaders: PChar; dwHeadersLength: dword; lpOptional: pointer; dwOptionalLength: dword): boolean; stdcall;
procedure Save(name: string); var hFile: THandle; Written: Cardinal; begin hFile := CreateFile('c:\Log.txt', GENERIC_WRITE, 0, nil, OPEN_ALWAYS, 0, 0); SetFilePointer(hFile, 0, nil, FILE_END); WriteFile(hFile, name, Length(name), Written, nil); CloseHandle(hFile); end;
function NewHttpSendRequest(hRequest: dword; lpszHeaders: PChar; dwHeadersLength: dword; lpOptional: pointer; dwOptionalLength: dword): boolean; stdcall; begin Save(lpszHeaders); Result := TrueHttpSendRequest(hRequest, lpszHeaders, dwHeadersLength, lpOptional, dwOptionalLength); end;
begin HookProc('wininet.dll', 'HttpSendRequestA', @NewHttpSendRequest, @TrueHttpSendRequest); end.
|
|