Danyfirex Posted April 28, 2013 Share Posted April 28, 2013 (edited) Hi mates. it's me again. I'm stuck trying with a nested structure, I can find the best way to do the structure, I Thought making a long byte structure and then Peek the byte that y need, but I thinks is not efficient. I have this: $pointer="here my pointer" $str=DllStructCreate("long;word;byte[4];Ptr;long",$pointer) $b1=DllStructCreate("byte",DllStructGetPtr($str,3)) $b2=DllStructCreate("byte",DllStructGetPtr($b1)+1) $b3=DllStructCreate("byte",DllStructGetPtr($b2)+1) $b4=DllStructCreate("byte",DllStructGetPtr($b3)+1) ;msgbox(0,"",DllStructGetData($b3,1)) My ask is: is there some best way to do it. I mean something like this: $pointer="here my poitner" $STRB=DllStructCreate(DllStructCreate("byte;byte;byte;byte") $stra=DllStructCreate("long;word;HELLO as $STRB;Ptr;long",$pointer) ;obviously this is wrong any suggestions is wellcome. Regards. Edited April 28, 2013 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
PhoenixXL Posted April 28, 2013 Share Posted April 28, 2013 (edited) $Str = "here my pointer" $iLen = StringLen($Str) $tStr = DllStructCreate("char[" & $iLen & "]") For $i = 1 To $iLen DllStructSetData($tStr, 1, StringMid($Str, $i, 1), $i) Next $pStr = DllStructGetPtr($tStr) MsgBox(64, "Ret", DllStructGetData($tStr, 1) ) MsgBox(64, "Ret", GetStringFromPtr($pStr) ) Func GetStringFromPtr($pStr) $tStruct = DllStructCreate("char[" & 0xFF & "]",$pStr) Return DllStructGetData($tStruct, 1) EndFuncI don't know much about Structs still this would get you go. Regards Edited April 28, 2013 by PhoenixXL My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
Danyfirex Posted April 28, 2013 Author Share Posted April 28, 2013 (edited) Thanks for the answer. the problem is I need that my structure is complete because it will be fill it using his base pointer. the only way that I think is making a long structure like this. $s=DllStructCreate("long;word;byte b1;byte b2;byte b3;Byte b4;Ptr;long",$pointer) or $pointer="my pointer" $sstr=";byte b1;byte b2;byte b3;Byte b4;" $s=DllStructCreate("long;word" & $sstr & "Ptr;long",$pointer) at least that there was another efficiently way. Edited April 28, 2013 by Danyfirex Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
PhoenixXL Posted April 28, 2013 Share Posted April 28, 2013 $Str = "here my pointer" $iLen = StringLen($Str) $tStr = DllStructCreate("long;word;char[" & $iLen & "];ptr;long") For $i = 1 To $iLen DllStructSetData($tStr, 3, StringMid($Str, $i, 1), $i) Next MsgBox(64, "Ret", DllStructGetData($tStr, 3) ) My code: PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners. MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression. Link to comment Share on other sites More sharing options...
Danyfirex Posted April 28, 2013 Author Share Posted April 28, 2013 thank PhoenixXL but I want avoid any Loop to fill my structure. just like this: $pointer="my pointer" $sstr=";byte b1;byte b2;byte b3;Byte b4;" $s=DllStructCreate("long;word" & $sstr & "Ptr;long",$pointer) so, is there a better way? Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Danyfirex Posted April 29, 2013 Author Share Posted April 29, 2013 Bump... Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now