trancexx

ResHacker project

185 posts in this topic

#161 ·  Posted

@trancexx:

Sorry to dissappoint you, I got lost trying to understand it (...after hours). I think I will go back to my old procedure of building a header .au3 with a hard coded array matching the order of the resources in my .rc file. I did do some research and maybe even got a better understanding of pointers, but this, as I said, goes over my head.

Cheers.

Ivan

Share this post


Link to post
Share on other sites



#163 ·  Posted

Excellent.

I'm happy for that, really.


 

.

eMyvnE

Share this post


Link to post
Share on other sites

#165 ·  Posted

WOW

ResHacker written in AutoIt.

very nice trancexx, i appreciate it...

Share this post


Link to post
Share on other sites

#166 ·  Posted

Thanks very good resources

Share this post


Link to post
Share on other sites

#167 ·  Posted (edited)

Hi,

I know this is an old topic but I find this script very useful but I have a problem.

I made a Dll file with some image but I would to add also version info, I try RT_Manifest and it works in dll but non in Windows property. So I find RT_Version but it is impossible to add with original script so I modified the script but without success, after insertion I don't see my data like normal dll but oriental character.

Can someone help me?

Edited by Saiph

Share this post


Link to post
Share on other sites

#168 ·  Posted

Error report:

C:UsersXXXAppDataLocalTempRar$DIa0.992ResourcesViewerAndCompiler.au3 (7432) : ==> Array variable subscript badly formatted.:
ReDim $hTreeViewExp[$iNumberOfExporedFunctions]
ReDim $hTreeViewExp[^ ERROR

Share this post


Link to post
Share on other sites

#169 ·  Posted

This is very old script. When I wrote it I didn't know plenty of things I know now, that's the reason you get that error.

...Very old, 100 years or something, probably even more.


 

.

eMyvnE

Share this post


Link to post
Share on other sites

#170 ·  Posted

Sorry to resurrect.

trancexx, what an immense project! I appreciate the work you threw on this.

I'm working on one of my projects with the Resources UDF, but I can't figure out how to parse an RT_STRING table. It seems you did something in your code that parses the data, but I can't decipher it. What am I doing wrong?

Regards,

cb


_ArrayConcatenate2D · Aero Flip 3D · EPOCH (destroy timestamps) · File Properties Modifier · _GetFileType · UpdateEngine<new> · In-line Case (_ICase) <new>

[hr]

50% of the time, it works all the time. -PezoFaSho

Share this post


Link to post
Share on other sites

#171 ·  Posted

I'm working on one of my projects with the Resources UDF, but I can't figure out how to parse an RT_STRING table.

 

You could also take a look at the AutoIt3Wrapper source. I added RT_STRING capability to the resource functions a good while back.

Share this post


Link to post
Share on other sites

#172 ·  Posted (edited)

Oh! I didn't think of that.  :o

Maybe I wasn't clear... I'm successful in using the wrapper to get the .ini into my project as a RT_STRING table, but I can't figure out how to read it back into a readable structure. It doesn't have to be elegant, but dumping to an array would be nice.  ^_^

cb

Edit: Clarity.

Edited by cyberbit

_ArrayConcatenate2D · Aero Flip 3D · EPOCH (destroy timestamps) · File Properties Modifier · _GetFileType · UpdateEngine<new> · In-line Case (_ICase) <new>

[hr]

50% of the time, it works all the time. -PezoFaSho

Share this post


Link to post
Share on other sites

#173 ·  Posted

^^ There is nothing spectacular about RT_STRING resource. The only thing to remember is that strings always come packed as 16 of them. Try something like this:

#include <Array.au3>

; Read your resource as raw. You'll get something like this...
$bRT_STRING = "0x0000000000000000000009002800500061007500730065006400290020000C004100750074006F004900740020004500720072006F007200B9014100750074006F004900740020006800610073002000640065007400650063007400650064002000740068006500200073007400610063006B00200068006100730020006200650063006F006D006500200063006F00720072007500700074002E000A000A0053007400610063006B00200063006F007200720075007000740069006F006E0020007400790070006900630061006C006C00790020006F006300630075007200730020007700680065006E00200065006900740068006500720020007400680065002000770072006F006E0067002000630061006C006C0069006E006700200063006F006E00760065006E00740069006F006E002000690073002000750073006500640020006F00720020007700680065006E0020007400680065002000660075006E006300740069006F006E002000690073002000630061006C006C00650064002000770069007400680020007400680065002000770072006F006E00670020006E0075006D0062006500720020006F006600200061007200670075006D0065006E00740073002E000A000A004100750074006F0049007400200073007500700070006F00720074007300200074006800650020005F005F00730074006400630061006C006C0020002800570049004E004100500049002900200061006E00640020005F005F0063006400650063006C002000630061006C006C0069006E006700200063006F006E00760065006E00740069006F006E0073002E002000200054006800650020005F005F00730074006400630061006C006C0020002800570049004E004100500049002900200063006F006E00760065006E00740069006F006E00200069007300200075007300650064002000620079002000640065006600610075006C007400200062007500740020005F005F0063006400650063006C002000630061006E0020006200650020007500730065006400200069006E00730074006500610064002E00200020005300650065002000740068006500200044006C006C00430061006C006C0028002900200064006F00630075006D0065006E0074006100740069006F006E00200066006F0072002000640065007400610069006C00730020006F006E0020006300680061006E00670069006E00670020007400680065002000630061006C006C0069006E006700200063006F006E00760065006E00740069006F006E002E001900220045006E0064005700690074006800220020006D0069007300730069006E00670020002200570069007400680022002E0021004200610064006C007900200066006F0072006D006100740074006500640020002200460075006E00630022002000730074006100740065006D0065006E0074002E00190022005700690074006800220020006D0069007300730069006E0067002000220045006E006400570069007400680022002E0028004D0069007300730069006E006700200072006900670068007400200062007200610063006B00650074002000270029002700200069006E002000650078007000720065007300730069006F006E002E001F004D0069007300730069006E00670020006F00700065007200610074006F007200200069006E002000650078007000720065007300730069006F006E002E00220055006E00620061006C0061006E00630065006400200062007200610063006B00650074007300200069006E002000650078007000720065007300730069006F006E002E0014004500720072006F007200200069006E002000650078007000720065007300730069006F006E002E001C004500720072006F0072002000700061007200730069006E0067002000660075006E006300740069006F006E002000630061006C006C002E00"

; Convert to array
$aArray = RT_STRING_ToArray($bRT_STRING)

; Display it
_ArrayDisplay($aArray)


Func RT_STRING_ToArray($bBinary)
    Local $iOffset = 1
    Local $sData
    Local $iLen
    For $i = 1 To 16 ; There is always 16 strings packed together
        $iLen = 2 * LittleEndianToInt(BinaryMid($bBinary, $iOffset, 2))
        If $iLen = 0 Then
            $iOffset += 2
            ContinueLoop
        EndIf
        ; I'll replace some characters to get one-liners for nicer display
        $sData &= StringReplace(StringReplace(StringReplace(BinaryToString(BinaryMid($bBinary, $iOffset + 2, $iLen), 2), @LF, "\n"), @CR, "\r"), Chr(0), "\0") & @LF
        $iOffset += $iLen + 2
    Next
    Return StringSplit(StringTrimRight($sData, 1), @LF, 3)
EndFunc

; A little helper function
Func LittleEndianToInt($iVal)
    Local $tUINT64 = DllStructCreate("uint64")
    DllStructSetData($tUINT64, 1, $iVal)
    Return DllStructGetData($tUINT64, 1)
EndFunc

 

.

eMyvnE

Share this post


Link to post
Share on other sites

#174 ·  Posted

Does he mean FindResource / LoadResource / LockResource? Or does he really mean to read back the binary data, in which case he'll have to parse the PE header?

Share this post


Link to post
Share on other sites

#175 ·  Posted

Does he mean FindResource / LoadResource / LockResource? Or does he really mean to read back the binary data, in which case he'll have to parse the PE header?

My understanding is that he doesn't have problems locking the string resource, one way or the other. He has issues parsing locked data.

I could be wrong though.


 

.

eMyvnE

Share this post


Link to post
Share on other sites

#176 ·  Posted (edited)

Can I replace resource in dll file?

Edited by abisoftware

Share this post


Link to post
Share on other sites

#177 ·  Posted

@trancexx:

problem, It is going wrong in some file
5625f75449a3f_Adsz.thumb.png.7d369669882

Share this post


Link to post
Share on other sites

#178 ·  Posted

@Osys2010 Do you realize that the main post was updated *EXACTLY* 6 years ago? :P


Spoiler

My contributions to AutoIt Community:

Snippets:

StringTrimLeftUntil & StringTrimRightUntil - Does what it says

StringLeftUntil & StringRightUntil - Does what it says

CalcPercent - Clean calculations

ArraySplit - Simply put, Converts an 1D Array to an 2D Array based on Delimiters (See the example if you want to know what it does clearly)

IsMgcNumPresent - See post for more details :P

 

UDFs:

Process UDF - Get both the output & the exit code of a command with a single line of code :)

Experimental Maps UDF - UDF for Maps (the new alpha datatype)

 

Programs:

Magic Number Calculator - Converts magic numbers to constants

 

Articles:

The Great History of AutoIt - A log (with accurate dates) of major milestones of AutoIt

Arrays 101: All you need to know about them! - A nice documentation of the Array datatype in AutoIt

Maps 101: All you need to know about them! - A nice documentation of the Map (currently in beta) datatype in AutoIt

Chatbox 101: All you need to know about it! - CB 101

 

Some messages & Apologizes:

If I hurt you, Please accept my apologies, I never (regardless of the situation) mean to hurt anybody!!!

Also, I am very busy with my project so I will appear in the last row of the online list, if you want to contact me:

I get RSS feeds from my notification list every minute :),So anything which sends me a notification works, I am active most of the time (IST) :)

Or you can have a nice chat with me in the chatbox (If I am online)

3fHNZJ.gif

PLEASE JOIN ##AutoIt AND HELP THE IRC AUTOIT COMMUNITY!

Share this post


Link to post
Share on other sites

#179 ·  Posted

@Osys2010 Do you realize that the main post was updated *EXACTLY* 6 years ago? :P

Would you like to explain why that might be relevant to the less informed?

Share this post


Link to post
Share on other sites

#180 ·  Posted

I am aware and I did not realize that anyone 6 years ?
and (sory my english)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now