Jump to content

Recommended Posts

  • 6 years later...
Posted
On 3/27/2019 at 2:56 PM, faustf said:

with this example  work, but not  compleatly

#include <String.au3>
$aFile=FileOpen(@DesktopDir&"\test",0)
if @error then MsgBox(0,'ERROR',@error)
local $firstLine=filereadline($aFile)
$hexData=_HexToString ( $firstLine )
ConsoleWrite(@crlf&$hexData)

i have 2 excel  one   have inside this

0xPK     ! ���w�  �   [Content_Types].xml �(�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 �U[K�0~�%��f� "�|���brֆ�I�9�ۿ���!�Ł�����.'�/��e�$���bXD^c}U�ח��RdH�傇R� ����d����W{,EM��D]C��<�LCj�g�dTz�*����B��  <��b����j�(�[�ﵒ7�Ev���R�B��V�B�›$y�N��a�ce���1YfL�@��Pȭ�  �#�tUpe'k��`hWv���{��H�@��=���˥��!��B��A���kQ�(�t���6��^�#i�u�=u�����?�A<s ���9p H+xd�k�C̵J`����:����th��M�#s�&lp��s�=��S4A_��V瑁 ��Mhm�

and i can use stringinstring [content_types].xml  or  0xpk

but in second excel i have this o_0

0x?? !??? ? ?????????????�                                                                                                                                                                                                                                                               ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????? ???? ?????????????                                                                                                                                                                                                                                                                ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????? ???????????????????????�                                                                                                                               ???????????????????????????????????????G??????????????????????????????????????????????????z???????????????????????????????????????????????? ??? !??s ?  ????????????????????????????????????????????????????????????????????????t??????????????????????????????????????????????????????????????????????????????????h???????????????????????? ??? !??? ?  ????????????????????????????????????a????????????????????L???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????h?????????????????????????????????????????v???????????????+??????? ??? !??� l # ??????????????????????????????????????????????"???????????????????????????????????????????????????????????????? ??? !??� ?  ????????????????????????????????????????????????????????????7?????????????????????????????????????????g????????????????????????????g????????????????????????????????????????????????????? ??? !??� ?  ????????????????????????????????????????????????????????????7?????????????????????????????????????????g????????????????????????????g????????????????????????????????????????????????????? ??? !??? ?  ???????????????????????????????????????????+????????????????????????????????????????????????????????????????????????????????????????????????????????????????S??????????????????????????????????????????????????????n?????????????+???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????o????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????s???????????????????????????,??????????????????????=???????????????????????????????????????????????t?????????????????????????x????????????????????????????????????????????????????????????????????????????????????????????????????????????????????t???????????????????????????????????????????????????????????????????????????� ??? !??? ? 0x?? !??? ? ??????????????                                                                                                                                                                                                                                                               ????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????? ???? ?????????????                                                                                                                                                                                                                                                                ??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????? ??????? ????????????????????????                                                                                                                               ???????????????????????????????????????G??????????????????????????????????????????????????z???????????????????????????????????????????????? ??? !??s ?  ????????????????????????????????????????????????????????????????????????t??????????????????????????????????????????????????????????????????????????????????h???????????????????????? ??? !??? ?  ????????????????????????????????????a????????????????????L?????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????h?????????????????????????????????????????v???????????????+??????? ??? !??? l # ??????????????????????????????????????????????"???????????????????????????????????????????????????????????????? ??? !??? ?  ????????????????????????????????????????????????????????????7?????????????????????????????????????????g????????????????????????????g????????????????????????????????????????????????????? ??? !??? ?  ????????????????????????????????????????????????????????????7?????????????????????????????????????????g????????????????????????????g????????????????????????????????????????????????????? ??? !??? ?  ???????????????????????????????????????????+????????????????????????????????????????????????????????????????????????????????????????????????????????????????S??????????????????????????????????????????????????????n?????????????+???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????o????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????s???????????????????????????,??????????????????????=???????????????????????????????????????????????t?????????????????????????x????????????????????????????????????????????????????????????????????????????????????????????????????????????????????t???????????????????????????????????????????????????????????????????????????? ??? !??? ?

why ? :(

FYI  

I was getting the same as FaustF with ?? in some of my output, I needed to modify the FileOpen to be 16 (Binary)

 

#include <String.au3>
$aFile=FileOpen(@DesktopDir&"\test",16)
if @error then MsgBox(0,'ERROR',@error)
local $firstLine=filereadline($aFile)
$hexData=_HexToString ( $firstLine )
ConsoleWrite(@crlf&$hexData)

Then I always get my expected value  (0x%PDF-1.4 in my case)

 

Just in case this helps anyone in the future !

 

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
  • Recently Browsing   0 members

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