Sign in to follow this  
Followers 0
tomaskir

BinaryToString() with really long strings

14 posts in this topic

#1 ·  Posted (edited)

Hey guys.

Here is a reproducer of my problem:

$string = "0x4E04093EAD992336A8CFA76C7818E725F1C8736D396FA4D83DEA7217DA0DAC0F6C20532F2340C20B4F1960FEAF2E489C1080E7CF5BE1E97A2A6EA7F109A1E2848EC02512D9B1EF1FB9093930A4477B6281735B5F00481AB217695B6E24A7DDA22803B85"& _
"717A20A45ACB55ECAE458F01795F4F112F6583EB7F3E30F788F1C3E995532CA04CEDF0F792DA69E78A58BA47F7594645B1AA1E6F7624FF3EFE623D3EEBD4C3B4DD78E00EDD988AFF219D9EA04529B7652CB308736C6062B7033FA6119001B5D34391468FBF82E9B8AD658190EB12" & _
"2B5E9C89CE91BC6A3CB75B90DC5FB6061356BD93FB468F4FC55BFAF7541521A599614F7B2F8A39AC159BF88C8BDABEEF485A533D5B6C37611582153C63B4E61CDBE9A7120FEF8A8C26864DFA1C9582F4884804912E62D7E73D80AF8014FF0F31BC2BD293731C13513574793F0D390" & _
"EB5696BFFF27E746970F134917C98DE692362059F22F1A02A678011885BFDD6A91425116AF7AC64BB2E1B09384FDD16BC5ADD025143BDEAF4B6A535F00E72004C5CA3BD6058431AF92813911687A4B3498B746BC3418D53C2DCBD0B8D088289345C1188E6D351CDA35CA15BB0DDF5ECCC" & _
"A27C5F5BB331CA8A721E982C0D6D2758AC053AE5958A76D43EB55A08324F28D3C038111B1FFA3FF5E8C9E28BDF9E9532645EC72631C3424B6804022858864838C02C99EE233D9F6F8687E92F16E67D2B9C62AC4A0A6E01A20E0684DF2624A22043B94AE323BFABECB85DF177A24190DF4EA8" & _
"CEB1C8FE7771BDD769699340FB0C94F11FE082CFD9942A8DFAFDD4489411699E9F4F7BEEBC4F41CBF1AE3581E3A9B236682F4CEDBDDE74EEBB011F3C28129BAD24FC63D18DD021E1688788D6B6E8F41DCDB99B8281674D92AEF28AE9B02FCE186406EF69236B8E2A2BA5350C6C820FF3C7A5FBB21" & _
"BE1DFD6FD3D6971AD495D4E7D122843A723A7129BB5C866E89B9D37963FF7CEA292CDAB862B39C5DB2A0E2D11E4A77C5CC88FC52B58FDC3551363E437F97F206AF029EEA4E50A3AA433606B1CFA3B394B993806DF46833EBEEBAB73E2D999DA495B27AC2849187CE80181381C90BA18A7C847C4" & _
"AA4789F105D3EC42D859FC2F34B1CF6B5EF3C33CBAC0BBA950645830FF5D363E33E3F8329EB360519F4AE63CE55F172DAE330371723DDDAFC94281E4856127DF773F62A24CAD151D4FFCB17B15E0CBD837A8C04A47A1AB47C42AC2A654D1B5379E6F47B168FB43BA226C0BEEEBBED18EEA45A133E" & _
"26B43E9EAAFCF1F1895C4F1A529E317C33CD031DAF6DD4F20457D05272C21944A3D57B8CDF876F9980A53AF7751641FEB601A849E16BF3831D78F455EDBC74D19488C88100C6EA0A3E27D5E95A8500AAC8D3CA1FAE5E7321AE15C0ECA48693CCFADEBE76A997204515AD8839351B1E0C89909FB0D8A5" & _
"FA8867A772CE4C1C9DDE321B0BE418BCDE98711E5FE693B271300BDA2BBE1B0FABED48BFB7319FFAFE38741962D52E5D8DAAFFCDF6729B578BFDCBFA56708BB9116115B9CC93C61BC0C215216664CED177E4F774E9206714B0987646124506BAD5B1AA822A3733A8CC8619D896382AA7E710CA943F370F" & _
"3F3B45265E100A72037B54604911EFABDB91C4FBA3D8B07BC1EF84DBAECA134DCFBA0E56402D98822AFDFA393E4CE2FBEEFF652CFC8529E11B76309791A11E6ADB0E35C28A583298520CC17A9C022B5DED4B3D57EF03C9EE1BFF9F3EB61FAAE87E4D7EC8F89B64D70A3DBC2C70CA1BB13898C89C1BDA379C3" & _
"66C5CC43EC8B5781A329517882A68F238CD09BF60656B4CC5A42B7171870AE1C1384D941A30E857416CA6CD7713E03060AB7F562C068B73995028915D41170749EDCA4917343C63C39B3C4FDB8746E6290A616E32A6295B9A48FC9CFDC6BA00AE9F900FCCA70C225140E434CAABEBD49F6B08717A745CC" & _
"190A1AC4FFD24A933C4D0FC9E0E4FB52FFF38694C3EFE0B80598206DC9B2ADD7C1149B79CDB844370F39583EAE9E2AC4A2209132A58EF1C7BE3C14BE8CDAE2F834BA1706A3CC9CD71EA71B99F6648E5AD5B764B52386E483CCAE08020E97A9AF140E0E508370605D2C286A5CC91DF8CF06AC6D200603679B" & _
"1E1EB3454CEA2071665E492F114E0190595FB7959D49240D60C719ED605607E12F1A73FF452216CB13740C560AA00A169741ACEB6F5B826EAEF311E9A0D06ADE022B62B1A2F0F27B47A61182C02746A6D54D29DFFD32FB6CD0FA7DD8345B9D79CAB74FE14EF37DDD520A41729CF3025CF079D8222E7AE6EA97" & _
"ED7DF8C595D23F3ED2E71FD8A1BA5F9B65C5F1016C873A673C2C1BA9E7E784AA0C36153E653D48076E3D7C860100E6A776CDE00625AFFFB532E2171CD2F18A36C3581CB000DC8E166435C57917F0B0CA795C75E289C69B6E1825A4F7157EF49343FAFACAD4567CB43D62E6986EEEEC0B4C8ADA2E15A2B783DA" & _
"D9CE54A7E09E9730CFC7BE529D4F4F8475A0B54F978ECDD5C3498AD32C2BC2D9E0BE6B41CD26FD933FE09A560DB2A36FA8A3FDBE4A3E6B034E7B8FBC3F11B85E9D751AACEBC7FCC432BDBF4E09A7163AE7C5FA93BB75CB5ED11195B4E03C245128A1A2CF519E848CAC43F301B8FC316241707F43C2B7035CE" & _
"84262237B29D4A70F677DD13EA37E237F7B73B20889099FEF3A943F5175A4F34DB14651AF07DE8AFB8F1B349CB738B01E2468FA897F88D5116566BE27328F4AE465CDB4B4BF0ECB3A4D9E2087A9B98D3742ECB6ADE24AA428EC10460F094EAF0170418A92397574D9AFB1E80F702E1B80BF4779186C8EA577B4" & _
"718EC16D69C49ED1C0E72BF1CAAE06CE598E46FA8C3633FBF45A5B000AFF0AF8F76B10A99C9E18333897B4B45E19DC588141CEC315E0602D2CCA84D1367944C9FD7426CFF6A9FB8C1B15109428A400D385B98903ECFB43621FBCDDEBBC106651A3F7DFA1B16C74340DF9EECE0759A7AB3E77208A490849661BFD9" & _
"7F6EEA4ED301D656472411D7B322E3F36AF09F7E2C521D4921E2AFD64676760C7879BBD339DE2497B18BAEFF0603096B935C4736BACDADD0024CD4B4BA84EAC29F504371B7737CFE9418CE3012223709803377AA2D4114C5052A1F42933C68A923E609AFC7F03ED4685BA23A5061D04AD27E6081B9F65776BAA60D9" & _
"9E70FD5CD8595AA894D8A617B3AD2644F2C9A55025D61DC4D55FEE9367DF5181D895D311C7EAA37E1E745036A0ED0983A272346787029CEFB6E7F38B59903D1547EFC8B83F472984EEABE0881361AB99ED3004B792CB9AADE123F238BAD164B13F0A4F629A3BA2918FC08F0A47ADC5A843726C9E91C4844B9B0D27" & _
"6E324B0AEE4D65E35B3014922B5A3CF0B27DC40E6339DE30E108086D99A753731DB85130B6F34D6473067DA9DC5130EFBB469C0E1F4D48C1DD0D5307F4814C75590935789F0FB2AF934261FAFE263B6797EC5CB204E66CF7441796F0847CE8D3EC76D59DCD9404D9FC5DBF5E75CCA70199D26A9F7B0EF86F9E40" & _
"B371D84D0BED0B2B7FF9071AC3B3CB92E2548D5666501B06F91E8A50CEB"

MsgBox(0, "", BinaryToString(Binary($string)))

MsgBox(0, "", BinaryToString(Binary("123456789")))

The really long string is some stuff encrypted with _Crypt_EncryptData().

Basicly I use InetRead() to read my encrypted data from my web server, so then I need to use BinaryToString() to get it back to string form to be able to _Crypt_DecryptData()

Any ideas how to get around this?

Thanks,

tom

Edited by tomaskir

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ok, so the problem actually seems to be that even tho its a string, it starts with "0x"

The problem other way around here:

$string = "4E04093EAD992336A8CFA76C7818E725F1C8736D396FA4D83DEA7217DA0DAC0F6C20532F2340C20B4F1960FEAF2E489C1080E7CF5BE1E97A2A6EA7F109A1E2848EC02512D9B1EF1FB9093930A4477B6281735B5F0048" & _
"1AB217695B6E24A7DDA22803B85717A20A45ACB55ECAE458F01795F4F112F6583EB7F3E30F788F1C3E995532CA04CEDF0F792DA69E78A58BA47F432D6AB78EE5589A70EDF52EB146551A7B45F4F307CF382396CFD8CDBE5A2F9" & _
"97CD2619A8BA450407323A414CB825B5DB28F614B506921EC0D9142F71E9B4833851A90AAE7136605699308797FD452CDC3A94B0FAB83B8D454276AB56C264FBBB3260B1D5095A40E19175309CAF79BC6A38860B33CE0B6311E" & _
"A47B9E7278B4646A8CE5934912827317E55C0D7EE3BE62D627BA01E5BCEFCEDF06C787B4451F71491EA24898E01F86F44127AE6BA9AC161B32530C8B1AE025251A5FCE84BF7745E582FE815E32C11EBCF8F44B340AB5B67628D04A" & _
"D7A543B76CBB1AC2B65437C4C38FFE8275C4A60D8EA8F54D12A557E8FAF552E48793181490313383AB6EEA9F738BCC73C338298EEE6BBD197F4A40B51BC08407FA34DF67FD9A6526B21D9E5F9D26686FDBFF8450E2FB5CC249B0" & _
"8BF5AC66AEBC11C6EC65AF85CDD9E52C403EE30E624FD7F7C91F4FF879D980DD239EB89714B147D171B55FD471A53312A262D7FA901AA6B4BFA11BFE9ED020BE88C63E0984883D8079B1218C97F5367B50A23BC24F2256D9D86" & _
"5FF7BC5386A5E46F3AF78614D1243099E7EEB0C415FE3DDCC6769D881103F729BC81663707ADB70FD6F326D640753911475A0421F2EE6CD2981A72CE1F3344C35688E4C439BF5A3AA20531CF933724C7C21EFDBC3EAE0E2680" & _
"237ABC31B896D314C4529AE0F594E01B81AF453DF88AD0A407FF045C39C00DA04942CD57E42F13D3702387EA9842B2E8E03DF019E14C8DC518C9480D8A4485E34E272BE654EDB815672AE21F9D6E4CA790C28239FBEDD4B2892" & _
"CE34E731B7FD71FCFA18C0AD119545B0C5E264CF868B13EBDB6D29C1D8CB16A9BDDCEF3BC0505A2A8D348A1CADA0B018E4452F6F76F5A0868104C8DAA4B4DC3BE063DB3ED72F65E75D380FAC1EA906DAADB31983C763E800825" & _
"F3028664C9D446F5A00F128DA3ACFA645AAEC586BF48FF52DC342CC4D2EA9E9F09ECE59747F7DED4A404EE5F0178C890CDC13A33931F8F83CDCFEF0D3CB9C07D662B3D3D02D786DC8EA6C4D585D5A081005DABDC6F6DBFDA5E" & _
"D934D979BD7DEE007174421674522C9546B91E3A234C550715AD03A4CD5A51549FA3A59991337DECEF29A8D2DDE89B52095A2E825BB0756CAB9F46E1CF7CC76BE27DD67EC0EE11531330D8C9197FDCBCD31F4ABFA8AF719352C" & _
"A81628CB57A20DB1ED5904EA44F855DF1EFE5A3339A1D4FD482F1C47A12428294AA651D19DBAA04CB9CAB264AC1D8C01A87596AFD6FE8B8929D11DC11FEC83FCB3A2072156DD13F551B9B7101ACD7F2FB97E620DA2D1146BD1" & _
"9C75D85221536E301E141C8D5C092B1D645498A981C0EF89F196853F15B74D298D3B97B807061BB57C5F07CE3D88B654F22B6C56DFA67ECEB44833531DEE0712C0DD7EEABE86B4E60D54EDE085B1F0134CB9D2641A250A3D54" & _
"8ED1B6A6D62F0137F8641B2084B49FB9E463C7510FD123A5E51FF0AE1CFF73A679E675136A1DCFE0DD77E7F7B090246785C2715ED4ABC4AC95BC4942EE07C3A49F1F4B4A3FC69A33DB5DC8A60BAF8DF8D300C0107D99D5935BF" & _
"A1DCE94FA6900F82EE6A842FF0CBE9B44F4C2CA394248FA5C69EF3EE53A3EB7D578CD022A507165B109B8D9DDB35246397CD972B4BBD0A2DEE69AD7733D09C283DE4092CA676C727B3ABBEE3CFBE5F24B63DAAB429E1FB52D6" & _
"C8485E982C32556DA22CC7563363C257236630014CB0D4CCE09E7CC3BE378C31CE89C924DD0306E4485A1F2DE56718FF5694D2A02B5C514FAC253245989C5D809A7BA9587A6D88659D5C404C08B7069F05AE137318E24AA238" & _
"8EF024F669C67C533E56F2ACEF599CF6692AF277D948CDA21A1D0F5BB7F54DBFA87EDE468A15AEC08D0C12494AF2381E73A6CBD823150CC83E345FA21DDF0D8BA50449227FA131DE3F7142F12BE0CA88C8437A4CCD8479D358" & _
"9EE57DAD4950D8D655C9883DD3FB2FCC1AA15649645FDF6B886C7763B56AE88376618EBA7FB582B13DF3FEBE75647B9F6E910639FB1E66F71FFD651AE0B24836FEB5A57374DC9A95EBAC2982F2222CC66CE835E9DC2EC80163" & _
"817ECF5D23BD19DFB39320C928041840D86F535DDF701232B2FF14650AF9276493020ADCD6368055C9F20842AA9B944948FF74976CD27C14B9949313B6AB0599697D2E34F0DD4534428D9C611E92E16F3A49EB0578692A2FAC3" & _
"89B8AF8F893D81636C880EECC330DBA0510C0751812BEEEDD756F68A4033EAF1424A4A2091179CB144BF492C948533CC49FF74B3C1F5DA9A9C9D298E3FF599DC1D77885EB0239E693A70A78DA1743CD14301D455B016DCFE55A" & _
"7020BF40F99CCF9EBD75BA2E6471C2C60A1356CB3557D71A812DB756B2E13A5DFF42B0F80E9963D410029DE360D0CDF36F2A93A4243CD1C60C7633668C4095776F7AB544F64B690584CA2EDE7D09AB7EDCF2587101A5A62A1A" & _
"48F2220105875944FAB7076EBE0E36DDCCC1A565D4A2E6B3900A823F1C86D33377DCB21CF8D547F71F6800589BACC747F26C211EDB2268CEABD2A189457571FD66AB0296C22C8E24B862B1B6783A2B674BEC262DACBB3F8DA1" & _
"4ED4D8EA486CD0D1046FD2CFB4E1EBA967E7DE5760869CC206F6571AEEC2F0751A545AE3ECB39EA51432031F36B2F627A999BC5AC2C9A8537203F3A7063DA63D019E460E643E42340A861DD07D0B18B9324D293478C880CE4A" & _
"65164D38E86122D8CEFDB66C4D77DA3B0DB9697F25F87ABB3ABE440EEE532D0C2A1889D96F99AB343155AB7A076D8EA10CE0B5B2554D6021094799316B8B5958164141C5C78806BF899E511624452F766A5B173D7CDF6BE5BF8" & _
"960E40E8A6864EBF89D4BB8D18D08C63A4B9923C8D1A8112ACBB5C126F72022F2C2F93894F0E8D00EE0231E7AAE028C77748D1797DB198CA4AB2C21B37DA25ACAA203C49FCA95E24DE143C979ADCCBCEA85E57CA70727A8B558" & _
"43B5CDB941F0089BE700EB46827C4BBDCC51DE4F0DC60314D0F2AFF02639E236CB42D2032650898D1AB2D96938E5B7382E1A3202D606A917E5B60DC67432413686BD318345B0958407D9C651DCCE29172E85613C636BADE0378" & _
"2D81E6D72671AE31B1A4F024CADFFB6DDDC5D2E94455BECC707612BD18FD40BF528D5A8F4EBC1A2D44A4CCFDA00338B2F8B82EA3276271653087D69BBA1A764F96F604E387C43514E17F7CBE92C9D275DF2D34621C9A78DA936" & _
"D384BFCB54ADB549F64D9708026E581B707F075E66FD84D053ED19585E4D91ACB15F41E07D41323A99E769ADC19E24022D4132600BF960EB76C8BAF378829B0A22C9EF169B56183E0E1EDCF3DA3BDA7DE42A8AC613B53"

MsgBox(0, "", BinaryToString(Binary($string)))

MsgBox(0, "", BinaryToString(Binary("0xABC123456789")))
Edited by tomaskir

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

I don't see the problem, when you convert a binary to a string then you get the ascii representation?

MsgBox(0, "", BinaryToString(Binary("0xABC123456789")))

This should return 0xABC123456789 inside the Msgbox, however, it returns «Á#Eg‰ for me.

Edited by tomaskir

Share this post


Link to post
Share on other sites

The problem I see is that you have a line of code which exceeds AutoIt limits. The string in the second example is already 4992 characters in length and the AutoIt limit is 4095. The length of the additional code takes the script line beyond the limit. To solve this you can concatenate smaller strings.

Share this post


Link to post
Share on other sites

The problem I see is that you have a line of code which exceeds AutoIt limits. The string in the second example is already 4992 characters in length and the AutoIt limit is 4095. The length of the additional code takes the script line beyond the limit. To solve this you can concatenate smaller strings.

Its not line limit, if you see the 2nd example, the long string returns correctly in MsgBox.

The short one in the 2nd example however doesnt return correctly in MsgBox.

Share this post


Link to post
Share on other sites

This will return 0xABC123456789.

MsgBox(0, "", BinaryToString(Binary("0x3078414243313233343536373839")))

I think you have a misunderstanding of the Binary function.

Br,

UEZ


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

The short one in the 2nd example however doesnt return correctly in MsgBox.

Yes it does, that's the ASCII characters of the binary string. Use this code and it will return the characters "d" and "2" because hex 64 is "d" and hex 32 is "2"

MsgBox(0, "", BinaryToString(Binary("0x6432")))

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Its not line limit, if you see the 2nd example, the long string returns correctly in MsgBox.

I read your first post again and I see that your code is just a reproducer. I am a bit confused that the code works at all. I thought it exceeded the limits of a single line of code. :) The line is greater than 5000 chars.

Edited by czardas

Share this post


Link to post
Share on other sites

I read your first post again and I see that your code is just a reproducer. I am a bit confused that the code works at all. I thought it exceeded the limits of a single line of code. :) The line is greater than 5000 chars.

Not if you use "& _" and spread it across several lines.

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Not if you use "& _" and spread it across several lines.

Apparently not. It wasn't clear to me that this actually split the line into multiple commands. I just thought it was a continuation of the same line and was for ease of visual reference. This means that the actual maximum length of a line of script is equal to the maximum length of a script, which perhaps has no limit at all. Interesting! :)

Edited by czardas

Share this post


Link to post
Share on other sites

Yes it does, that's the ASCII characters of the binary string. Use this code and it will return the characters "d" and "2" because hex 64 is "d" and hex 32 is "2"

MsgBox(0, "", BinaryToString(Binary("0x6432")))

This will return 0xABC123456789.

MsgBox(0, "", BinaryToString(Binary("0x3078414243313233343536373839")))

I think you have a misunderstanding of the Binary function.

Br,

UEZ

Man, thats confusing. Since Im sending a string and its actually taking that in as ASCII characters because the string starts with 0x.

Thanks guys!

Share this post


Link to post
Share on other sites

Its being converted to ASCII characters because it starts with 0x and you're telling it to convert it to ASCII from binary using the binarytostring.

BTW, you don't need the Binary($string) command, you get the exact same results using BinaryToString($string).


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

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
Sign in to follow this  
Followers 0