Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Forum Support

    3. Suggestions

x86 switch scanner


fastman92
 Share

Recommended Posts

As I'm creating a limit adjuster and vehicle special features, I had a need to write switch scanner to find all switches that contain the specific ID.

I created an IDC script for this.

 

Small part of output:

Switch 0x41C0C1:    XLAT table: 0x41C3F0    Pointer table: 0x41C3DC    Default case: 0x41C3C9    Number of cases: 173    Lowest case: 427    Cases:        427 - 0x41C27A        430 - 0x41C2C7        432 - 0x41C3BC        433 - 0x41C0C8        490 - 0x41C27A        523 - 0x41C3BC        596 - 0x41C0C8        597 - 0x41C0C8        598 - 0x41C0C8        599 - 0x41C0C8Switch 0x41C9E2:    XLAT table: 0x0    Pointer table: 0x41CA20    Default case: 0x41CA1C    Number of cases: 7    Lowest case: 0    Cases:        2 - 0x41C9E9        3 - 0x41C9FA        4 - 0x41CA0B        5 - 0x41CA0B        6 - 0x41CA0BSwitch 0x41CAB6:    XLAT table: 0x0    Pointer table: 0x41CB50    Default case: 0x41CB4C    Number of cases: 7    Lowest case: 0    Cases:        0 - 0x41CABD        1 - 0x41CAD4        2 - 0x41CADA        3 - 0x41CAE0        4 - 0x41CAFB        5 - 0x41CB16        6 - 0x41CB31Switch 0x41CB82:    XLAT table: 0x0    Pointer table: 0x41CBE0    Default case: 0x41CBDC    Number of cases: 7    Lowest case: 0    Cases:        0 - 0x41CB89        1 - 0x41CB95        2 - 0x41CBA1        3 - 0x41CBAD        4 - 0x41CBB9        5 - 0x41CBC5        6 - 0x41CBD1Switch 0x41CE4F:    XLAT table: 0x41CFA0    Pointer table: 0x41CF98    Default case: 0x41CEA1    Number of cases: 6    Lowest case: 45    Cases:        45 - 0x41CE56        46 - 0x41CE56        49 - 0x41CE56        50 - 0x41CE56Switch 0x41DB4A:    XLAT table: 0x420688    Pointer table: 0x42067C    Default case: 0x41FA92    Number of cases: 11    Lowest case: 2    Cases:        2 - 0x41DB51        3 - 0x41DB51        4 - 0x41FA84        5 - 0x41FA84        12 - 0x41DB51Switch 0x41DB6B:    XLAT table: 0x420708    Pointer table: 0x420694    Default case: 0x41F880    Number of cases: 67    Lowest case: 2    Cases:        2 - 0x41DB72        3 - 0x41DC92        4 - 0x41DF54        5 - 0x41E07D        8 - 0x41E2BF        9 - 0x41E3B1        10 - 0x41FA92        12 - 0x41E338        13 - 0x41E473        15 - 0x41E568        16 - 0x41E642        17 - 0x41E79D        18 - 0x41E88D        21 - 0x41EE05        24 - 0x41EB46        25 - 0x41EBB9        26 - 0x41ED1C        27 - 0x41FA92        28 - 0x41FA92        29 - 0x41F771        30 - 0x41F771        31 - 0x41F771        32 - 0x41F771        43 - 0x41F033        44 - 0x41F12D        52 - 0x41E989        53 - 0x41EA63        54 - 0x41EE76        55 - 0x41EF50        60 - 0x41F5B1        61 - 0x41F4D7        64 - 0x41EE3D        65 - 0x41F694        66 - 0x41F694        67 - 0x41F694        68 - 0x41F694

Designed for reverse engineers.

 

Works with IDA Pro.

 

Script works perfectly with 1.0 compact EXE IDB.

 

Download: http://pastebin.com/iJ2zGVe0

Edited by fastman92
Link to comment
Share on other sites

  • 1 month later...

I can use this to find all switches for police cars?

Like without having to search for every single switch?

Edited by dkluin
Link to comment
Share on other sites

I can use this to find all switches for police cars?

Like without having to search for every single switch?

Yes.

 

But beside ID switches there may be comparisons in some places like this:

 

cmp word ptr[esi+22h], 599
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

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.