-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to assign a datatype to segment:0x0000 #4686
Comments
Try setting ES to a value at the beginning of the function as is done for DS. Looking at the function more closely, I would make a custom return value for the CALL to GetTaskIntoES and have it return a pointer to the TaskDatabase in the ES register. This is actually what is going on. The decompiler should pick that up. There may be other ways with the new pointer typedef, but I'd try this first. |
Nice one! Creating a memory block to hold a The only issue doing it this way is lots of new memory blocks will be needed for any type accessed this way (or maybe a big |
Glad you got it to work. If you can change the GetTaskIntoES() to return a value in ES and set the return type to (TaskDatabase *), you would probably get a more general solution. Might be some issues, since ES is not the full pointer size, so it might not accept the data type / offset. |
That's what I did beforehand, but doing that alone doesn't work because
does nothing when interpreting the address
produces a better outcome
However, as you can see, the variable |
I thought that might happen. Did you set the assume value at the instruction, or at the beginning of the function? |
Absolutely. (Don't forget about the other segment registers
I changed the register value at the instruction location NOT the beginning of the function. Also, adding a value for |
Changing the register value at any instruction location other than at the start of the function will be ignored. It has to occur at the beginning of the function for the decompiler to pick it up. Setting DS at the INC instruction should have no effect. I think what is happening is that when you set the ES at the start of the function, and then changed the function to return a value in ES in a custom calling convention, essentially the decompiler thinks the ES register value has changed from the call and no longer uses the value at entry to the function. There might be an assumption in the decompiler that assumes values are offset from the DS segment, but in this case I'm not sure why you are getting a pointer to &DAT_1018_0006 In the main branch, I get:
If I set ES at the beginning of the function with NO changes to the called function signature:
Adding the TaskDatabase structure at 9000 yields:
This is using protected mode which keeps the segment separate from the offset for pointers. |
Sorry for the delayed response, I missed yours!
This is definitely untrue/incorrect for the
It definitely does!
First, I setup
This appears to be the case, and that's why I'm seeing
Please ensure these changes don't require a reload otherwise months/years of work will go down the proverbial drain!!! |
Will any of these help with |
I have a similar situation here - dragon_FUN_1108_0dd6.zip in which a lower level nested structure contains an array of segments that should be used as the basis of another array of Tried the solution described earlier by creating a new memory block, but that didn't work. |
@ryanmkurtz any progress? |
In the example above, the line
as each element of the |
In general, if the label on the ticket is still |
Is your feature request related to a problem? Please describe.
There's no mechanism to apply a datatype to an address of the form
SEG:0000
. The below (correct disassembly) fromKRNL386.EXE
(Windows 3.11) illustrates this issue perfectly:decompiles to:
converting
ES:[0x6]
into an address in the applicationsDS
(data segment -1018:0006
). Whereas what's required is forES:[0x6]
to be the 6th-7th byte of a 0x200 byte structure (TaskDatabase
).Describe the solution you'd like
The ability to set a datatype on an address of this format. (I believe it is what used to be a
based
datatype.)Describe alternatives you've considered
Changing the global data area (at address
1018:0000
) to typeTaskDatabase
- breaks everything else that really uses the data in1018:0000
-1018:0200
.The text was updated successfully, but these errors were encountered: