English
Bugs and vermeintliche

FreeProfan Bugs and vermeintliche

FreeProfan32 and API UpdateResource

 

Matthias
Arlt
with the Fehlersuche in a of my programs is me noticed, that one schreibender grabbed with "UpdateResource" on The Runtime (or. Interpreter) regularly The File useless power. so far I found out have, or this anyway annehme, becomes the Schreibvorgang of course carryed out, but the Änderung not Header registered... this lead then the Startversuch the File To unterschiedlichen Fehlermeldungen. mostly "Nur one part the ReadProcessMemory- or WriteProcessMemory-demand watts abgeschlossen" or "Falscher Parameter...".
it concerns too ausschliesslich FreeProfan, The XProfan-versions are of these effect not concerned.

Greeting Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
04/10/16  
 




Jörg
Sellmeyer
it'll Roland sure help, if You as a small lauffähigen (!) Beispielcode postest.
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
04/10/16  
 




Matthias
Arlt
there have You naturally right... I habs time the minimalst possible "eingedampft". with the Unicode-Variante with Übergabe of Strings be I I do not More To 100% sure (therefore in the Eingangs-Posting removes).
with respect to the "Fehl-Verhaltens" power the first eh' none Difference.
declare file$,modul&,hFind&,hUpdate&
file$ = way to FreeProfan-Runtime...
modul& = external("KERNEL32","LoadLibraryExA",addr(file$),0,3)
hFind& = external("KERNEL32","FindResourceExA",modul&,2,"TOOLBAR32",0)
external("KERNEL32","FreeLibrary",modul&)

if hFind&

    print hFind&
    hUpdate& = external("KERNEL32","BeginUpdateResourceA",addr(file$),0)
    print hUpdate&
    print external("KERNEL32","UpdateResourceA",hUpdate&,2,"TOOLBAR32",0,0,0)
    print external("KERNEL32","EndUpdateResourceA",hUpdate&,0)

endif

waitkey
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
04/10/16  
 




Matthias
Arlt
I have meanwhile the trouble time hither investigating. with folgendem Result:
The Schreibvorgang finds instead of and The Entries in the Header go staid or. updated.
but:
The complete Ressourcen-Sektion becomes circa some forwards moved (in the concrete drop circa 312 byte). so is correct naturally the Rohdaten-Offset in the .rsrc-Header not any more. or richtiger, the Offset is correct already, what The changed position angeht, only the before it liegende part the File is nunmehr To short. as Workaround shift I now The Sektion through Insert of zero-Bytes again complete around the "Fehlbetrag" to hinten and carry in the Header (.rsrc + 20) again whom korrekten Offset one. by which it to this shift comes, is me though another puzzel...
on the API can not lying, The functions Yes with others Files (not FreeProfan) so How tappt im dunkeln should.

Greeting Matthias

Nachtrag:
The anfängliche assumption, with "FreePascal- or Lazarus-Derivaten" The Unicode-Variante the API use To must, has as gegenstandslos erwiesen...
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
04/19/16  
 




RGH
One first attempt has the following yield:

XProfan X3 and FreeProfan make exakt the same. though reacted a XProfan-Runtime the Delete the TOOLBAR32-Ressource from me yet unerklärlichen Found differently, as a FreeProfan-Runtime! from of/ one XProfan-Runtime can the Ressource delete and remaining funktionsfähig, a FreeProfan-Runtime well not.

Also had I check, that one gelinktes XProfan-Profan-Program at Delete the Ressource too of his Profan-Codes beraubt and is subsequently as an Runtime without gelinkten code functions.

I look moreover ....

Greeting
Roland
 
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
04/19/16  
 




Matthias
Arlt
already strange, the whole. still Have I therefore time more in detail with the Innenaufbau the PE's engage...


...the one gelinktes XProfan-Profan-Program at Delete the Ressource too of his Profan-Codes beraubt and is subsequently as an Runtime without gelinkten code functions.


this is vaguely the same behaviour How with the UPX-Problematik, before You The "Packer-Unterstützung" nachgerüstet had.

The completely-shift of/ one Sektion can Yes suppose, that the Size or the end the previous Codes somehow not recognized becomes. The suitable Info stand against into individual Headern. (whether too yet on another place ???)
Perhaps nevertheless one reference point for further Search. The Verhaltensunterschied FreeProfan vs. XProfan can itself so but well neither explain...

still shifts my Workaround The File again in a funktionsfähigen status. with FreeProfan anyway. an actually XProfan-Runtime to that testing Have I Yes not.

Greeting Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
04/20/16  
 




RGH
The problem with UPX was one other: Since I one nachträgliches Change the Ressourcen make possible wished, there no festdefinierte address in the Runtime More, on the the Compilations to find is, separate I Search to the Start the Program to the Header the Kompilates. Since I with the Search but not at Dateanfang began, separate first short to the Beginn the Ressourcen in the unkomprimierten Program, running these Search to the Komprimierung in that vain. so have I then whom Beginn the Search explicit former angesetzt.

BTW: too FreeProfan has The new Ressourcen-functions of XProfan X3, so that itself your Program on following Lines reduce can:
declare file$
file$ = "prfrun32.exe"
print res("Change", file$, 2, "TOOLBAR32",0,0,0)
Print "Fertig!"
waitkey

unfortunately remaining the Problem Delete the Ressource consist.

Greeting
Roland
 
XProfan X3
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
04/20/16  
 




Matthias
Arlt
I meant the too only from the Auswirkungen since. the itself the trouble on not vergleichen can, is already clear.


BTW: too FreeProfan has The new Ressourcen-functions of XProfan X3, so that itself your Program on following Lines reduce can:


too this is clear. me went/goes But therefore, that the schreibende API-grabbed fails. and not only at Delete, separate generally, means too at add, Change etc.

declared is Yes sozusagen the smallest joint denominator, the always available standing, even if no newer Profan-Version is used or at all no grabbed from Profan out results.
ResourceHacker and Co shine there then too yet something differently vorzugehen or catch such effects through further Techniken ex...

Greeting Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
04/20/16  
 




RGH
FreePascal (Lazarus) shining a others PE-Header To use, How Delphi. unfortunately have I there evident none Einfluss hereon and into Compilereinstellungen nothing moreover found.

Greeting
Roland
 
XProfan X3
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
04/20/16  
 




Matthias
Arlt
whom suspicion with a others Header-construction I had already, be but withal stundenlanger Search likewise little fündig become.

after I found out have, what very there happens and How with the geringem hoisted again hinzubiegen is, is it Yes no really gravierendes trouble More.

Ärgerlicher is there almost already, that You too with XProfan such unklare Auffälligkeit discover have...

Greeting Matthias
 
WinXP SP2, Win7 - XProfan 10/11/FreeProfan32 - Xpia
04/20/16  
 




Michael
W.
the Compilations becomes sought...

leaves it not as free (selbstdefinierte) Ressource over The Ressourcenverwaltung To grasp get?
 
Alle Sprachen
System: Windows 8/10, XProfan X4
Programmieren, das spannendste Detektivspiel der Welt.
04/20/16  
 




RGH
Yes, The idea carry so did i already a while with me around and will be it well in the next Version of XProfan so hold.

but this is here Yes no Solution, there the FreeProfan-Runtime (and naturally too the Interpreter and presumably too others with FreePascal compiled Exen) evident not whom Ressourcen-functions the windows-API Edit can, without useless To go. Bislang have I there no Solution found.

Greeting
Roland
 
XProfan X3
Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4
04/20/16  
 




Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

66.833 Views

Untitledvor 0 min.
Sven Bader09/16/21
Rainer Hoefs07/12/19
p.specht12/20/18
Walter05/23/18
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie