Jump to content
View in the app

A better way to browse. Learn more.

Tuts 4 You

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

get 3'th byte of eax?

Featured Replies

Posted

hello tuts4you, i tried to solve a keygenme and faced a problem.


 


the return value of a function is in example: eax == 00001234.


now i want the 3'th byte of it, which is 12.


 


so does anybody know a way to do this?


 


have a nice day!


The lowest 16 bits of EAX is AX


 


So...


AX = 1234


AL = 34


AH = 12


 


So just use AH


Edited by NOP

C



void Main()
{
int IntToParse = 4660; 0x00001234 = EAX = 32 bit integer // adjust this according to which bits you want. remember byte ordering
int ParsePlace = 1; // bit shift, multiply, and
int Parsed = ((IntToParse >> (8*ParsePlace)) & 0xFF); printf("Parsed = %i\n");
}
----- Output - Parsed = 18 (12h)

x86 asm



IntToParse = 0x1234 ; mov eax, IntToParse ; int IntToParse = 0x1234 sar eax, 8 ; IntToParse >> 8 and eax, FF ; Result & FF. sometimes this step isnt necessary eax == 12
x86 asm
IntToParse = 0x1234 ;mov eax, IntToParse ;  int IntToParse = 0x1234sar eax, 8 ; IntToParse >> 8and eax, FF ; Result & FF. sometimes this step isnt necessaryeax == 12 

Hi

 

easiest method for this problem (if we can call it problem !) is :

MOVZX EAX,AH

 

 

Best Regards,

h4sh3m

i understand u (even though in this case a simple "sar eax, 8" works exactly same as "mov eax, ah") but way i showed is standard way to do this in high level language.

  • Author

So many replys, all are helpfull, thank you very much guys, problem solved!


also, its 3rd.. not 3th

@evlncrn8: I smell some grammarnazism here :P


sorta, but im just trying to help too

  • Author

well thanks for the tip :)


Create an account or sign in to comment

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.