Skip to content

Commit

Permalink
Among us update 22-3-29 (#293)
Browse files Browse the repository at this point in the history
* Offsets fixes for update
* Fixed the lobby browser (for now)
  • Loading branch information
OhMyGuus committed Apr 1, 2022
1 parent 788e76b commit dc02ec2
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 84 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@
"cross-spawn": "^7.0.3",
"electron-devtools-installer": "^3.2.0",
"electron-log": "^4.3.2",
"electron-overlay-window": "git://github.com/OhMyGuus/electron-overlay-window",
"electron-overlay-window": "https://github.com/OhMyGuus/electron-overlay-window",
"electron-store": "^6.0.1",
"electron-updater": "^4.3.5",
"electron-window-state": "^5.0.3",
"i18next": "^19.9.2",
"jimp": "^0.16.1",
"memoryjs": "git://github.com/OhMyGuus/memoryjs",
"memoryjs": "https://github.com/OhMyGuus/memoryjs",
"minimist": "^1.2.5",
"node-keyboard-watcher": "git://github.com/OhMyGuus/node-keyboard-watcher",
"node-keyboard-watcher": "https://github.com/OhMyGuus/node-keyboard-watcher",
"path-intersection": "^2.2.0",
"pretty-bytes": "^5.5.0",
"react": "^17.0.2",
Expand Down
98 changes: 53 additions & 45 deletions src/main/GameReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import Struct from 'structron';
import { IpcOverlayMessages, IpcRendererMessages } from '../common/ipc-messages';
import { GameState, AmongUsState, Player } from '../common/AmongUsState';
import offsetStore, { IOffsets, TempFixOffsets5, TempFixOffsets6 } from './offsetStore';
import offsetStore, { IOffsets, TempFixOffsets5, TempFixOffsets6, TempFixOffsets7 } from './offsetStore';
import Errors from '../common/Errors';
import { CameraLocation, MapType } from '../common/AmongusMap';
import { GenerateAvatars, numberToColorHex } from './avatarGenerator';
Expand Down Expand Up @@ -503,6 +503,13 @@ export default class GameReader {
// }
this.colorsInitialized = false;
console.log('serverManager_currentServer', this.offsets.serverManager_currentServer[0].toString(16));

if (innerNetClient === 30104372 ||
innerNetClient == 30001864 ||
innerNetClient == 30155956 ||
innerNetClient == 29580672) {
this.offsets = TempFixOffsets7(this.offsets);
}
if (innerNetClient === 0x2c6c278) {
// temp fix for older game until I added more sigs.. //
this.disableWriting = true;
Expand Down Expand Up @@ -777,50 +784,51 @@ export default class GameReader {
}

joinGame(code: string, server: string): boolean {
if (
!this.amongUs ||
!this.initializedWrite ||
server.length > 15 ||
!this.offsets ||
this.is_64bit
// || this.loadedMod.id === 'POLUS_GG'
) {
return false;
}
const innerNetClient = this.readMemory<number>(
'ptr',
this.gameAssembly!.modBaseAddr,
this.offsets!.innerNetClient.base
);
this.writeString(this.shellcodeAddr + 0x40, server);
writeMemory(
this.amongUs.handle,
innerNetClient + this.offsets.innerNetClient.networkAddress,
this.shellcodeAddr + 0x40,
'int32'
);
writeMemory(
this.amongUs.handle,
innerNetClient + this.offsets.innerNetClient.onlineScene,
this.shellcodeAddr + 0x70,
'int32'
);
writeMemory(
this.amongUs.handle,
innerNetClient + this.offsets.innerNetClient.mainMenuScene,
this.shellcodeAddr + 0x95,
'int32'
);
writeMemory(this.amongUs.handle, innerNetClient + this.offsets.innerNetClient.networkPort, 22023, 'int32');
writeMemory(this.amongUs.handle, innerNetClient + this.offsets.innerNetClient.gameMode, 1, 'int32');
writeMemory(
this.amongUs.handle,
innerNetClient + this.offsets.innerNetClient.gameId,
this.gameCodeToInt(code),
'int32'
);
writeMemory(this.amongUs.handle, this.shellcodeAddr + 0x30, 1, 'int32'); // call connect function
return true;
return false;
// if (
// !this.amongUs ||
// !this.initializedWrite ||
// server.length > 15 ||
// !this.offsets ||
// this.is_64bit
// // || this.loadedMod.id === 'POLUS_GG'
// ) {
// return false;
// }
// const innerNetClient = this.readMemory<number>(
// 'ptr',
// this.gameAssembly!.modBaseAddr,
// this.offsets!.innerNetClient.base
// );
// this.writeString(this.shellcodeAddr + 0x40, server);
// writeMemory(
// this.amongUs.handle,
// innerNetClient + this.offsets.innerNetClient.networkAddress,
// this.shellcodeAddr + 0x40,
// 'int32'
// );
// writeMemory(
// this.amongUs.handle,
// innerNetClient + this.offsets.innerNetClient.onlineScene,
// this.shellcodeAddr + 0x70,
// 'int32'
// );
// writeMemory(
// this.amongUs.handle,
// innerNetClient + this.offsets.innerNetClient.mainMenuScene,
// this.shellcodeAddr + 0x95,
// 'int32'
// );
// writeMemory(this.amongUs.handle, innerNetClient + this.offsets.innerNetClient.networkPort, 22023, 'int32');
// writeMemory(this.amongUs.handle, innerNetClient + this.offsets.innerNetClient.gameMode, 1, 'int32');
// writeMemory(
// this.amongUs.handle,
// innerNetClient + this.offsets.innerNetClient.gameId,
// this.gameCodeToInt(code),
// 'int32'
// );
// writeMemory(this.amongUs.handle, this.shellcodeAddr + 0x30, 1, 'int32'); // call connect function
// return true;
}

loadColors(): void {
Expand Down
90 changes: 58 additions & 32 deletions src/main/offsetStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,14 +136,14 @@ export default {
planetSurveillanceMinigame_currentCamera: [0xd0],
planetSurveillanceMinigame_camarasCount: [0xa8, 0x18],
surveillanceMinigame_FilteredRoomsCount: [0x78, 0x18],
lightRadius: [0x88, 0x34],
lightRadius: [0xB0, 0x34],
palette: [0xffff, 0xb8],
palette_playercolor: [0x198],
palette_shadowColor: [0x1a0],
playerControl_GameOptions: [0xffff, 0xb8, 0x8],
gameOptions_MapId: [0x18],
gameOptions_MaxPLayers: [0x10],
serverManager_currentServer: [0xffff, 0xb8, 0x10, 0x20, 0x28],
serverManager_currentServer: [0xffff, 0xb8, 0x10, 0x20, 0x10],
connectFunc: 0xfff,
showModStampFunc: 0xfff,
modLateUpdateFunc: 0xff,
Expand All @@ -166,7 +166,7 @@ export default {
struct: [
{ type: 'SKIP', skip: 0x10, name: 'unused' },
{ type: 'UINT', name: 'id' }, // 0x10
{ type: 'SKIP', skip: 4, name: 'unused1' }, // 0x14
{ type: 'SKIP', skip: 0x14, name: 'unused1' }, // 0x14
{ type: 'UINT', name: 'outfitsPtr' }, // 0x18
{ type: 'SKIP', skip: 4, name: 'unused2' }, //
{ type: 'UINT', name: 'playerLevel' }, // 0x20
Expand All @@ -179,19 +179,19 @@ export default {
{ type: 'SKIP', skip: 4, name: 'unused' },
{ type: 'UINT', name: 'objectPtr' }, //0x40
],
isDummy: [0x111],
isLocal: [0x88],
localX: [0xa0, 0x6c],
localY: [0xa0, 0x70],
remoteX: [0xa0, 0x58],
remoteY: [0xa0, 0x5c],
bufferLength: 80,
isDummy: [0x139],
isLocal: [0xB0],
localX: [0xC8, 0x6c],
localY: [0xC8, 0x70],
remoteX: [0xC8, 0x58],
remoteY: [0xC8, 0x5c],
bufferLength: 96,
offsets: [0, 0],
inVent: [0x44],
inVent: [0x6C],
clientId: [0x28],
currentOutfit: [0x40],
currentOutfit: [0x68],
roleTeam: [0x48],
nameText: [0x78, 0xD8],
nameText: [0xA0, 0xD8],
outfit: {
colorId: [0x14],
hatId: [0x18],
Expand All @@ -217,7 +217,7 @@ export default {
addressOffset: 4,
},
shipStatus: {
sig: '48 8B 05 ? ? ? ? 48 8B 5C 24 ? 48 8B 6C 24 ? 48 8B 74 24 ? 48 8B 88 ? ? ? ? 48 89 39 48 83 C4 20 5F',
sig: '48 8B 05 ? ? ? ? 48 8B 90 ? ? ? ? 48 8B 0A 48 85 C9 74 ?',
patternOffset: 3,
addressOffset: 4,
},
Expand All @@ -242,8 +242,7 @@ export default {
pingMessageString: {},
modLateUpdate: {},
serverManager: {
sig:
'48 8B 05 ? ? ? ? F6 80 ? ? ? ? ? 74 18 44 39 A8 ? ? ? ? 75 0F 48 8B C8 E8 ? ? ? ? 48 8B 05 ? ? ? ? 48 85 DB 0F 84 ? ? ? ? ',
sig: '48 8B 05 ? ? ? ? 48 89 74 24 ? F6 80 ? ? ? ? 04',
patternOffset: 3,
addressOffset: 4,
},
Expand Down Expand Up @@ -274,11 +273,11 @@ export default {
palette: [0xffff, 0x5c],
palette_playercolor: [0x194],
palette_shadowColor: [0x198],
lightRadius: [0x60, 0x1c],
lightRadius: [0x78, 0x1c],
playerControl_GameOptions: [0xffff, 0x5c, 0x4],
gameOptions_MapId: [0x10],
gameOptions_MaxPLayers: [0x8],
serverManager_currentServer: [0xffff, 0x5c, 0x8, 0x10, 0x14],
gameOptions_MapId: [0x30],
gameOptions_MaxPLayers: [0x28],
serverManager_currentServer: [0xffff, 0x5c, 0x8, 0x10, 0x8],
innerNetClient: {
base: [0x1c57f54, 0x5c, 0x0],
networkAddress: 0x38,
Expand All @@ -295,6 +294,7 @@ export default {
struct: [
{ type: 'SKIP', skip: 8, name: 'unused' },
{ type: 'UINT', name: 'id' },
{ type: 'SKIP', skip: 8, name: 'unused' },
{ type: 'UINT', name: 'outfitsPtr' },
{ type: 'UINT', name: 'playerLevel' },
{ type: 'UINT', name: 'disconnected' },
Expand All @@ -304,19 +304,19 @@ export default {
{ type: 'SKIP', skip: 3, name: 'unused2' },
{ type: 'UINT', name: 'objectPtr' },
],
isDummy: [0xa9],
isLocal: [0x60],
localX: [0x6c, 80],
localY: [0x6c, 84],
remoteX: [0x6c, 60],
remoteY: [0x6c, 64],
isDummy: [0xC1],
isLocal: [0x78],
localX: [0x84, 80],
localY: [0x84, 84],
remoteX: [0x84, 60],
remoteY: [0x84, 64],
bufferLength: 56,
offsets: [0, 0],
inVent: [0x38],
inVent: [0x4C],
clientId: [0x1c],
currentOutfit: [0x34],
currentOutfit: [0x48],
roleTeam: [0x3C],
nameText: [0x58, 0x80],
nameText: [0x70, 0x80],
outfit: {
colorId: [0x0c],
hatId: [0x10],
Expand All @@ -343,7 +343,7 @@ export default {
addressOffset: 0,
},
gameData: {
sig: 'A1 ? ? ? ? 83 C4 04 8B 40 5C 8B 00 85 C0 0F 84 ? ? ? ? 6A 00 FF', //'8B 0D ? ? ? ? 8B F0 83 C4 10 8B 49 5C 8B 01',
sig: 'A1 ? ? ? ? 83 C4 04 8B 40 5C 8B 00 85 C0 0F 84 ? ? ? ? 6A 00 FF 75 ? 50', //'8B 0D ? ? ? ? 8B F0 83 C4 10 8B 49 5C 8B 01',
patternOffset: 1,
addressOffset: 0,
},
Expand Down Expand Up @@ -386,7 +386,7 @@ export default {
addressOffset: 0,
},
serverManager: {
sig: 'A1 ? ? ? ? 89 55 E0 F6 80 ? ? ? ? ? 74 14 83 78 74 00 75 0E 50 E8 ? ? ? ? A1 ? ? ? ? ',
sig: 'A1 ? ? ? ? 89 55 E0 F6 80 ? ? ? ? ? 74 14 83 78 74 00 75 0E 50 E8 ? ? ? ? A1 ? ? ? ? 83 C4 ? 8B 40 ? 6A',
patternOffset: 1,
addressOffset: 0,
},
Expand Down Expand Up @@ -515,7 +515,6 @@ export function TempFixOffsets5(offsetsOld: IOffsets): IOffsets {
offsets.shipstatus_allDoors = [0x84];
offsets.shipStatus_map = [0xe4];
offsets.lightRadius = [0x54, 0x1c];

return offsets;
}

Expand All @@ -529,6 +528,33 @@ export function TempFixOffsets6(offsetsOld: IOffsets): IOffsets {
offsets.innerNetClient.gameState = 0x78;
offsets.innerNetClient.onlineScene = 0x88;
offsets.innerNetClient.mainMenuScene = 0x8C;
return offsets;
}


export function TempFixOffsets7(offsetsOld: IOffsets): IOffsets {
console.log("TempFixed7")
const offsets = JSON.parse(JSON.stringify(offsetsOld)) as IOffsets; // ugly copy
offsets.player.struct = [
{ type: 'SKIP', skip: 8, name: 'unused' },
{ type: 'UINT', name: 'id' },
{ type: 'UINT', name: 'outfitsPtr' },
{ type: 'UINT', name: 'playerLevel' },
{ type: 'UINT', name: 'disconnected' },
{ type: 'UINT', name: 'rolePtr' },
{ type: 'UINT', name: 'taskPtr' },
{ type: 'BYTE', name: 'dead' },
{ type: 'SKIP', skip: 3, name: 'unused2' },
{ type: 'UINT', name: 'objectPtr' },
];
offsets.player.inVent = [0x38];
offsets.player.isDummy = [0xa9];
offsets.player.isLocal = [0x60];
offsets.player.localX = [0x6c, 80];
offsets.player.localY = [0x6c, 84];
offsets.player.remoteX = [0x6c, 60];
offsets.player.remoteY = [0x6c, 64];
offsets.player.currentOutfit = [0x34];
offsets.player.nameText = [0x58, 0x80];
return offsets;
}
9 changes: 5 additions & 4 deletions src/renderer/LobbyBrowser/LobbyBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ export default function lobbyBrowser({ t }) {
aria-labelledby="alert-dialog-slide-title"
aria-describedby="alert-dialog-slide-description"
>
<DialogTitle id="alert-dialog-slide-title">{t('lobbybrowser.code')}</DialogTitle>
<DialogTitle id="alert-dialog-slide-title">Lobby information</DialogTitle>
<DialogContent>
<DialogContentText id="alert-dialog-slide-description">
{code.split('\n').map((i, key) => {
return <span key={key}>{i}</span>;
return <div key={key}>{i}</div>;
})}
</DialogContentText>
</DialogContent>
Expand Down Expand Up @@ -208,15 +208,16 @@ export default function lobbyBrowser({ t }) {
row.id,
(state: number, codeOrError: string, server: string, publicLobby: PublicLobby) => {
if (state === 0) {
ipcRenderer.send(IpcHandlerMessages.JOIN_LOBBY, codeOrError, server);
setCode(`${t('lobbybrowser.code')}: ${codeOrError} \n Region: ${server}`);
// ipcRenderer.send(IpcHandlerMessages.JOIN_LOBBY, codeOrError, server);
} else {
setCode(`Error: ${codeOrError}`);
}
}
);
}}
>
Join
Show code
</Button>
{/* <Button variant="contained" color="secondary" style={{ marginLeft: '5px' }}>
report
Expand Down

0 comments on commit dc02ec2

Please sign in to comment.