Jump to content

String, interger and binary stuff question


Go to solution Solved by Geir1983,

Recommended Posts

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)

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

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

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

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

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

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

×
×
  • Create New...