Jump to content

Debugging DllStructGetData


Digisoul
 Share

Recommended Posts

Hello there,

I am working with DllCalls, and having trouble on runtime debugging.

Here is a sample code of my project

local $EDATA = DllStructCreate("byte[537]",$PHANDLE)
If @error Then error("Unable to pass the data.")
$fdata = DllStructGetData($EDATA,1)
if @error Then error("Unable to extract the data.")

now the "DllStructGetData($EDATA,1)" never return any error or something in special conditions which i want to debug and the "Don't Send" error occurs.

i want to know how can i control these types of conditions ?

Thanks in Advance

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

What special conditions?

I am making a Compiler Identifier, it works well for all PE32 except PE32 .NET Assembly.

When i tried to get its data the error occurs

Local $Aoep = 0x47EFBC11
Local $Smod = "D:\ZiPhoneGUI.exe"
Local $GHndle = DllCall("kernel32.dll", "hwnd", "GetModuleHandleW", "wstr", $SMod)
If @error Then
   error("Unable to call GetModuleHandleW")
EndIf
$PHANDLE = $GHndle[0]+$Aoep
local $EDATA = DllStructCreate("byte[537]",$PHANDLE)
If @error Then error("Unable to pass the data.")
$fdata = DllStructGetData($EDATA,1) ; Error in .NET Assembel Files
if @error Then error("Unable to extract the data.")

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

Show me ZiPhoneGUI.exe.

Ah! :D my mistake, the file was infected, thats why its not working , now i clean that file and my app displaying the correct result.

But my question is still there what will i do if i have to analyse any invalid file?

I mean how can i stop my app to crash.

Now would you like to check the clean & infected files (In Invalid Format i mean i just change their MZ sig)?

Coz i also test my app on some other infected files and its work properly.

73 108 111 118 101 65 117 116 111 105 116

Link to comment
Share on other sites

But my question is still there what will i do if i have to analyse any invalid file?

I mean how can i stop my app to crash.

Now would you like to check the clean & infected files (In Invalid Format i mean i just change their MZ sig)?

Coz i also test my app on some other infected files and its work properly.

Your code should be aware of the change before you reach the point where it would crash.

Just add some more checkings and respond properly to errors (either return or do some modification to variables or whatever).

♡♡♡

.

eMyvnE

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

  • Recently Browsing   0 members

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