x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Is it possible to replace the gwes.exe of my nk.bin?

1 2 3
I dunk for bananas Page Icon Posted 2023-01-10 9:20 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
Found another tool that looks promising, it's called eimgfs and I've already managed to extract all modules from the image which is impressive
 Top of the page
C:Amie Page Icon Posted 2023-01-10 9:28 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,927
Location:
United Kingdom
Status:
You'll have to do a write-up for everyone on your findings and on how others can follow your lead
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-10 10:06 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
Okay! Useful finding 1 is that if you want to extract all of your modules (not "files" ) and have them in a folder like any other group of files, you have to get a tool called b000ff which will let you convert your nk.bin to an nk.nb0, and then a tool called imgfs (available here: https://github.com/nlitsme/eimgfs) and run this command:
eimgfs.exe NK.nb0 -extractall -fs xip –d bins 


It will create a folder called "xip" with all of your modules!
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-10 10:10 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
Right now I'm trying to use eimgfs to make space in my nk.nb0 and add my XP style gwes.exe.
It's letting me delete the original gwes.exe in the image and then add my own one in, but the image ends up being larger than the original, and binmod doesn't want anything to do with it. Presumably, this will not boot

Edit: Yeah, this is what viewbin tells me for the image modified by eimgfs:

c:\binmod>viewbin -t eimgfs_nk.bin 
ViewBin... eimgfs_nk.bin 
Image Start = 0x80220000, length = 0x0167AD0C
Start address = 0x00223F78
Checking record #110 for potential TOC (ROMOFFSET = 0xFEBD8870)
Checking record #901 for potential TOC (ROMOFFSET = 0xFF74986C)
Checking record #1141 for potential TOC (ROMOFFSET = 0x00000000)
Found pTOC = 0x817a573c
ROMOFFSET = 0x00000000

ROMHDR ----------------------------------------
DLL First : 0x01E401E8
DLL Last : 0x02000000
Physical First : 0x80220000
Physical Last : 0x8189AD0C
RAM Start : 0x8189B000
RAM Free : 0x818C8000
RAM End : 0x87700000
Kernel flags : 0x00000002
Prof Symbol Offset : 0x00000000
Num Copy Entries : 3
Copy Entries Offset : 0x80D0FFB4
Num Modules : 161
Num Files : 135
MiscFlags : 0x00000002
CPU : 0x014c (x86)
Extensions : 0x80222564

ROMHDR Extensions -----------------------------
PID[0] = 0x00000000
PID[1] = 0x00000000
PID[2] = 0x00000000
PID[3] = 0x00000000
PID[4] = 0x00000000
PID[5] = 0x00000000
PID[6] = 0x00000000
PID[7] = 0x00000000
PID[8] = 0x00000000
PID[9] = 0x00000000
Next: 00000000
Couldn't locate copy secitons
ERROR: Couldn't locate Modules data
Couldn't locate Files data
Done.


Modifying the image with any of the tools other than binmod seems to completely mess up its internal structure.
Any ideas?

Edited by I dunk for bananas 2023-01-10 10:34 PM
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-11 3:11 AM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
Important finding: It's definitely the way I'm loading gwes.exe, not the file itself. When I load the original, non-XP themed gwes.exe the same way (from my hard drive and not from the image itself), Textmaker and Planmaker have the exact same issue.
Any ideas as to what could be causing this? Obviously those programs are trying to access something and failing at it, but how I could figure out what that is, I have no clue
 Top of the page
torch Page Icon Posted 2023-01-11 4:38 AM
#
Avatar image of torch
Subscribers
H/PC Guru

Posts:
5,524
Location:
United States 
Status:
I think the UI is custom designed for TM and PM perhaps. It looks / feels different interacting with the program.
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-11 12:58 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
It definitely is, I'm just struggling to understand what a different gwes.exe location does to it to make it break in such a way
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-11 2:29 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
I tried booting my patched nk.bin but like foreseen, it doesn't work, the progress bar fills until the end and then it just hangs
 Top of the page
torch Page Icon Posted 2023-01-11 2:44 PM
#
Avatar image of torch
Subscribers
H/PC Guru

Posts:
5,524
Location:
United States 
Status:
Can you run gwes through dependency walker. Maybe There’s another dependency to work out
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-11 2:53 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
It should all be accessible to it really, and I would be expecting errors to pop up if that were the case, but I think it's just some hyper specific API issue, or something to do with the button/menu bar font (which is nothing special, it's just the standard system font)
 Top of the page
C:Amie Page Icon Posted 2023-01-11 3:08 PM
#
Avatar image of C:Amie
Administrator
H/PC Oracle

Posts:
17,927
Location:
United Kingdom
Status:
Are you using a GWES binary from a older/newer platform builder release? If you built this yourself, did you patch Platform Builder first? It is likely just a dependency update issue and it is expecting a newer version of shell32 or some other import.
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-11 3:43 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
It's a GWES from the PB evaluation edition we have available here on HPC:Factor. That's actually a very good point. Let me try placing the executable's dependencies (from the same build) in the same folder as it, rather than it using the ones from \Windows
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-11 3:51 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
Quote
C:Amie - 2023-01-11 3:08 PM

Are you using a GWES binary from a older/newer platform builder release? If you built this yourself, did you patch Platform Builder first? It is likely just a dependency update issue and it is expecting a newer version of shell32 or some other import.


I had another think and I think that that's actually not that likely after all sadly, because I was running the system with the original gwes.exe (which came with the image) copied to the hard drive and the init registry value change to point towards that instead of the one in \Windows, and it had the exact same issue with invisible text on Softmaker programs
 Top of the page
I dunk for bananas Page Icon Posted 2023-01-11 4:17 PM
#
Avatar image of I dunk for bananas
H/PC Elite

Posts:
667
Location:
Europe
Status:
Oh my god. I actually solved it.

Alright, so this is what the issue was:
I have a second Windows directory on my internal hard drive, in order to allow things like Wordpad to run, since the default \Windows directory is volatile. The gwes.exe I had compiled in order to enable the XP theme was being run from there. Dependency Walker told me that gwes.exe was importing commctrl.dll, commdlg.dll and coredll.dll, all of which I had already deleted from the second Windows directory.
However, I checked what modules gwes.exe was loading from within the CE environment, and it was a whole lot of other dlls. I removed those too, and now it works



(IT WORKS.jpg)



Attachments
----------------
Attachments IT WORKS.jpg (72KB - 0 downloads)
 Top of the page
torch Page Icon Posted 2023-01-11 4:29 PM
#
Avatar image of torch
Subscribers
H/PC Guru

Posts:
5,524
Location:
United States 
Status:
Congratulations! I’m glad you figured it out!!
 Top of the page
1 2 3
Jump to forum:
Seconds to generate: 0.218 - Cached queries : 72 - Executed queries : 10