Sign in to follow this  
Followers 0
TrickyDeath

String, interger and binary stuff question

10 posts in this topic

Hello everyone,

Again here with my new question.

I do have a value what is "text" string, what i read from memory adress, but i do not understand when i convert it, why i geting only the first 4 letter from the word...

I was reading how does it storeing in memory, but i am not 100% sure, i did understand right. :(

Anyone can explain how does it work? Or why i get only the first 4 letter only?

Ps.:

Useing Nomadmemory.

BinaryToString($MemRead, 1), 0, 0

The valuse is correct, if i do not convert it at all, but the valuse includeing only numbers. I tried different convert way, but nothing.


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites



If you are reading from a memory address you probably also have to specify the amount of bytes to read?

Share this post


Link to post
Share on other sites

I wana read commands and those commands can be short how short i want, but i do not wana use 4 letter length strings for command. My problem is this memory storeing thing is new for me, so i am on just about the begning.

I made a GUI with 1 edit and 3 different button on it. Each button storeing the text from Edit in the same value.

I did used Cheat Engine to find the adress for it, and in that program it showeing me the full lengh of the string, but with AutoIT i see only the first 4 letter somehow, and i could not find out why. BTW the GUI is just for test, cause i can try make it work w/o NET connection. Once it will work, i can change the process. Unfortunately skype and viber do not have any controll what i can read with autoIT to read the messages what i am geting or sending. :(

At least i did not found anything like that.

One sec i put the code here in new post, just let me find it.


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites

#include <NomadMemory.au3>
#include <Array.au3>
#include <String.au3>

#Region Communication List
Global $System[8][2], $Answares[6]
Global $MemRead, $Value, $OrderRegister, $OrderList
;Order List
$System[0][0] = "Shotdown PC" ;Shotdown PC
$System[1][0] = "Open emails"
$System[2][0] = "Undeclared"
$System[3][0] = "Undeclared"
$System[4][0] = "Undeclared"
$System[5][0] = "Undeclared"
$System[6][0] = "Undeclared"
$System[7][0] = "?"

;Function List
$System[0][1] = "ShotDown_PC"
$System[1][1] = "Open_Emails"
$System[2][1] = "Undeclared"
$System[3][1] = "Undeclared"
$System[4][1] = "Undeclared"
$System[5][1] = "Undeclared"
$System[6][1] = "Undeclared"
$System[7][1] = "Help"

;Answare List
$Answares[0] = "Login Failed"
$Answares[1] = "Incorrect Username and / or Password!"
$Answares[2] = "Acces Denide!"
$Answares[3] = "Acces Granted! Wellcome!"
$Answares[4] = "Undeclared"
$Answares[5] = "Undeclared"

$OrderList = $System[0][0] & @CRLF & $System[1][0] & @CRLF & $System[2][0] & @CRLF & $System[3][0] & @CRLF & $System[4][0] & @CRLF & $System[5][0] & @CRLF & $System[6][0] & @CRLF & $System[7][0]
#EndRegion Communication List

_Main()

While 1
    Sleep(100)
WEnd

Func _Main()
    if ProcessExists("Memtest.exe") = 0 Then
        Run("Memtest.exe", "G:\_Instal\4GL\AutoIT\Scripts\Windows\")
    EndIf
    MemoryOpen()
EndFunc   ;==>_Main

#Region - Work together !!!
Func MemoryOpen() ;Work properly !!!
    ;Reading the value from the Process searched Memory Adress

    While 1
        $Process = _MemoryOpen(ProcessExists("Memtest.exe"))
        ;$Process = _MemoryOpen(ProcessExists("Memtest.exe"))
        If Not @error Then
            $MemRead = _MemoryRead("0x" & "0095CD48", $Process)
            ;$MemRead = _MemoryRead("0x" & "0095A578", $Process)
            ToolTip(BinaryToString($MemRead, 1), 0, 0)
            If $OrderRegister <> $MemRead Then
                $OrderRegister = $MemRead
                _Arguments()
            EndIf
            _MemoryClose($Process)
        EndIf
        Sleep(100)
    WEnd
EndFunc   ;==>MemoryOpen

Func _Arguments()
    For $i = 0 To UBound($System) - 1
        If $MemRead = $System[$i][0] Then
            Call($System[$i][1])
        EndIf
    Next
EndFunc   ;==>_Arguments
#EndRegion - Work together !!!

The argument functions include only 1 messagebox message to see it work or not.

Do u need the memtest.exe code as well? also made with autoIT.

nvm, i post that as well.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Memtest", 140, 170)
$Input1 = GUICtrlCreateInput("", 10, 10, 120, 21)
$btn = GUICtrlCreateButton("Number", 10, 40, 120)
$btn2 = GUICtrlCreateButton("String", 10, 70, 120)
$btn3 = GUICtrlCreateButton("Binary", 10, 100, 120)
$btn4 = GUICtrlCreateButton("Normal", 10, 130, 120)
GUISetState(@SW_SHOW)

Local $Text

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $btn
            $Text = Number(GUICtrlRead($Input1))
        Case $btn2
            $Text = String(GUICtrlRead($Input1))
        Case $btn3
            $Text = Binary(GUICtrlRead($Input1))
        Case $btn4
            $Text = GUICtrlRead($Input1)
    EndSwitch
WEnd

If have any other question let me know.


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

you need to specify the length to read, default is a dword (4 bytes).

$MemRead = _MemoryRead("0x" & "0095CD48", $Process, "char[80]")
Edited by Geir1983

Share this post


Link to post
Share on other sites

I would be happy if we have a nice help file for that nomadmemory, but since that is just a home made function... the description not telling you everything. I like AutoIT help file, you can learn so much thing, without comming to forum all the time with any single simple question.

What does "char[80]" mean exactly?


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites

like you said, nomad.au3 is not part of the autoit package.. but it does have documentation for each of the functions inside the source code.

char[80] means it will read 80 characters (letters numbers etc), I did not test it but think it should work?

Share this post


Link to post
Share on other sites

I will chek it, just have to turn on my notebook, cause i am working on that at work, when i do have too much free time and nothing to do. :D

Actualy i start codeing on my mobile phone, then the boss will not realy notice what i do. :D

When the code is done and i go home, i jsut send it to my PC, so i can test it and see it is work or not.


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

Share this post


Link to post
Share on other sites

Ok i did test your example, and work perfect. Thank you for your help. Now i can continue to work on rest of the code to make the whole communication between PC and my phone. :-)


Sry for my bad English, and double sry, but I am learning AutoIT language by myself. :)

[u]Tricky[/u]

You can't teach a man anything, you can only help him, find it within himself. (Galileo Galilei)

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

  • Similar Content

    • JustinZandee
      By JustinZandee
      I need a random string generator which creates 15 letters/numbers.
      How can I make that?
    • anthonyjr2
      By anthonyjr2
      Hi guys,
      I am pretty bad with regex, and am having some trouble trying to come up with an expression for a certain type of string. Basically I want to be able to tell if a string is of the format:
      AA#####A
      Where the A's are any letter from A-Z and the #'s are any digit from 0-9.
      I've been playing around with a regex tester online for a while but I can't really seem to grasp the concept very well. Could anyone give me any tips?
      This isn't exactly an AutoIt specific question which is why I didn't post it in General Help & Support.
    • LoneWolf_2106
      By LoneWolf_2106
      Hi everybody,
      i have a question related to strings items in an Array and sorting. Maybe someone can advice me how to solve the issue.
      I have an Array of strings, every item of the Array is as following:
      INFO [13.06.2017 11:48:01] [Thread-13] [ConGenImpUsb -> waitForConnection]  INFO [07.06.2017 08:55:44] [main] MDU5 - Ver 5.1x I want to sort the item in the array by date and time, is there any function which allows me to sort by date/time?
      Thanks in advance
    • Innominate
      By Innominate
      How can I filter out everything in a string except for text between specific tags, specifically between <title>Message title</title> and <body id="msgFeedSummaryBody" selected="false">Summary text</body>
       
      I also want to extract the URL, which is given three times:
           1. Message-Id: <https://www.linktopage.htm@localhost.localdomain>
           2. Content-Base: https://linktopage.htm (no closing tag for this, just a line feed with the next one beginning with “Content-Type: “)
           3. <base href="https://www.linktopage.htm">
       
      Having extracted the Message title, Summary text, and URL, I want to save that in one of various text files, with a prompt for user input giving me a way (such as entering a letter, word, or clicking a radio button; the latter is preferable) to specify which file.
       
      Here is the code I have so far:
       
      #include <MsgBoxConstants.au3> Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase HotKeySet("^h", "_copy") While 1 Sleep(100) WEnd Func _copy() Send("^u") ; opens the message source of the news feed in my e-mail client (Thunderbird) showing all of the desired information Sleep(1000) Send("^a") ; select all of it Sleep(1000) Send("^c") ; copy it to clipboard EndFunc Now how can I filter the clipboard contents (as above), add to it (adding “-----------------------” as a separator, display it to the screen (for confirmation), and append it as plain text to one of several different files?
       
      Thank you!
    • vikashbitm2010
      By vikashbitm2010
      Hi all,
      I want to return string from autoit script to the python code.
      Autoit:
      Exit("22 FE 45") -> not working
      Exit(1) -> Working
      Exit(0) -> Working
      python:
      import os
      res=os.system(autoitmine.exe)
      print "res",res
      I got some hint of @ExitCode macro, but dont know how to use it to get the string in python variable 'res'.
      Please resolve this issue for me if anyone knows about this.