Jump to content

String to hex problem


 Share

Recommended Posts

Ok I got this program I wanna to create a exe when excuted.

So I have taken my exe file and convert it to a txt file so I can see the ANSI strings.

So I thougt I was clever and then do the _StringtoHex command. Here is my srcipt

#include <string.au3>
#include <file.au3>

$File = FileOpen("testexe.txt",0)
$String = FileRead($File)
FileClose($File)
$Hex = _StringToHex($String)
_FileCreate(@workingdir & "\hex.txt")
$File = FileOpen(@workingdir & "\hex.txt",2)
FileWrite($File,$Hex)
FileClose($File)

But its creating a emtpy txt file... :lmao:.

Why does it not work?

Thank You :ph34r:

Ps. How do you count the lines in a file?

Edited by Mr. Zero
Link to comment
Share on other sites

  • Moderators

Ok I got this program I wanna to create a exe when excuted.

So I have taken my exe file and convert it to a txt file so I can see the ANSI strings.

So I thougt I was clever and then do the _StringtoHex command. Here is my srcipt

#include <string.au3>
#include <file.au3>

$File = FileOpen("testexe.txt",0)
$String = FileRead($File)
FileClose($File)
$Hex = _StringToHex($String)
_FileCreate(@workingdir & "\hex.txt")
$File = FileOpen(@workingdir & "\hex.txt",2)
FileWrite($File,$Hex)
FileClose($File)oÝ÷ Ø­Û­æ­xzkiÊÜm~)^èV'hzÈ­p¢¹©äb¿ªê-x{¡ée£¡Êz-ë-ºÇWËZS«v¨ºØbL¨¹Æ§©{·öÊ')bëaÄèj{0z»az«¨¶ènW¦ªê-{ayÊ{br¬Z²n¶*'¶¼­+ºÚ"µÍÌÍÑ[HH    ÌÎNÕÝ^IÌÎNÂÌÍÜÔÝ[ÈH^
[TÝ[Ê[TXY
    ÌÍÙ[JJJB[PÛÜÙJ[SÜ[   ÌÎNÚ^Y   ÌÎNËJB[UÜ]J ÌÎNÚ^Y   ÌÎNË ÌÍÜÔÝ[ÊJ

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Why not just use FileInstall()?

Because I wanna the file to be in the exe so I don't have to use rar files or something like that...

Ps. How do you count the lines in a file?

Edited by Mr. Zero
Link to comment
Share on other sites

  • Moderators

Because I wanna the file to be in the exe so I don't have to use rar files or something like that...

Ps. How do you count the lines in a file?

Have you bothered to look at any of the File topics in the help file, you'd be amazed at how quick that answer pops out at you.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...