I will make this short but sweet. AND still so other can look at it ..
The only way to get a seperator bar in a menu is to pass the appropriate uFlags parameter to AppendMenu(). So look thru the code to find a uFlags that isn't 0. ANything other than 0 is something other than a string, like a seperator bar, etc.
Let's look at two places in this proggie where it uses this:
Code:
* Reference To: USER32.AppendMenuA, Ord:0004h
|
:004048FD 8B3574B34000 mov esi, dword ptr [0040B374]
:00404903 51 push ecx
:00404904 A35CAA4000 mov dword ptr [0040AA5C], eax
:00404909 6818040000 push 00000418
:0040490E 6A00 push 00000000
:00404910 50 push eax
:00404911 FFD6 call esi
:00404913 8B0D18A94000 mov ecx, dword ptr [0040A918]
:00404919 A15CAA4000 mov eax, dword ptr [0040AA5C]
:0040491E 51 push ecx
:0040491F 6819040000 push 00000419
:00404924 6A00 push 00000000
:00404926 50 push eax
:00404927 FFD6 call esi
:00404929 6A00 push 00000000
:0040492B 8B0D5CAA4000 mov ecx, dword ptr [0040AA5C]
:00404931 681B040000 push 0000041B
:00404936 6A20 push 00000020 ; NAUGHTY seperator line
:00404938 51 push ecx
:00404939 FFD6 call esi
:0040493B 8B0D38A84000 mov ecx, dword ptr [0040A838]
:00404941 8B155CAA4000 mov edx, dword ptr [0040AA5C]
You will notice at 00404936 you are pushing a 20 instead of a 0. This is the uFlags parameter being pushed before we call AppendMenu (which is in esi register). 20 is the constant for the uFlag of MF_MENUBARBREAK, and this gives you your break line which you dont like. If you look thru this code you can see AppendMenu is called four times, we only need three times, we will jump over this break line call. Notice the PUSH 00 at 00404929? We will change it to a JMP, since it takes the same amount of bytes. WE need to jump down to 0040493B. So this would be 0040493B - 0040492B (it's 2B because JMP's are from relative to the NEXT instruction) - this gives us 10 hex. JMP is "EB" Change the code from 6A00 to EB10.
The second occurence is at :
Code:
* Reference To: USER32.AppendMenuA, Ord:0004h
|
:00405127 8B3574B34000 mov esi, dword ptr [0040B374]
:0040512D 6A00 push 00000000
:0040512F 51 push ecx
:00405130 FFD6 call esi
:00405132 6A00 push 00000000
:00405134 8B0D04AA4000 mov ecx, dword ptr [0040AA04]
:0040513A 681B040000 push 0000041B
:0040513F 6A20 push 00000020 ; UGLY seperator line
:00405141 51 push ecx
:00405142 FFD6 call esi
:00405144 A1A4AA4000 mov eax, dword ptr [0040AAA4]
:00405149 8B0D04AA4000 mov ecx, dword ptr [0040AA04]
You can use the same technique here. Jump over the evil call, Change PUSH 00000000 at 00405132 to a JMP to 00405144. I'll leave the calculations to you !
Don't forget the position in the file in the hex editor will NOT be the same as these virtual addresses , you need to use a File location calculator, I prefer to use PEditor or LordPE's FLC
I'll leave those little details for you to figure out, it's good to learn SOME things !
-nt20