Skip to content

Instantly share code, notes, and snippets.

View leoetlino's full-sized avatar
💭
I may be slow to respond. Busy with coursework

Léo Lam leoetlino

💭
I may be slow to respond. Busy with coursework
View GitHub Profile
@leoetlino
leoetlino / ida70.cpp
Created January 10, 2021 21:34
botw_decompiler_bugs
/*
CMP W1, #3
TBZ W2, #0, loc_710096E890
B.GT loc_710096E8C0
MOV X0, X20 ; a1
MOV W1, WZR ; a2
BL sead::ListImpl::nth(int)const
*/
...
if ( (signed int)type <= 9 )
#pragma once
// DO NOT EDIT. This file is automatically generated.
#include "KingSystem/GameData/gdtManager.h"
namespace ksys::gdt {
struct CommonFlags {
FlagHandle flag_100enemy_Activated;
/**
* @param dest Destination flag array
* @param src Source flag array
* @param records Copy records (only used if add_records is true)
* @param counts Boolean flag counts per category (only used if T = bool)
* @param record_copies Whether copies should be recorded
* @param ignore_temp_flags Whether temporary flags (i.e. flags that aren't saved)
* should be ignored
* @param find_existing_record See addFlagCopyRecord.
* @param is_array Whether the flag arrays are associated with an array-type flag (e.g. bool array)
void __fastcall gdt::copyFlags_s32(GameDataMgr::FlagArray *dest, GameDataMgr::FlagArray *src, sead::ObjArray *records, int *indices, bool add_records, bool y, bool find_existing_record, bool is_array)
{
__int64 dest_size; // x27
int src_size; // w28
unsigned __int64 v14; // x19
signed __int64 v15; // x20
GameDataFlag *v16; // x0
unsigned __int8 *v17; // x0
GameDataFlag *v18; // x0
unsigned __int8 *v19; // x0
BaseProcEvent *__fastcall BaseProcTaskPrioritizer::invoked(__int64 a1, TaskPrioritizerContext *ctx)
{
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
begin = ctx->it_begin;
end = ctx->it_end;
v5 = (BaseProcEvent *)begin->mPtr;
v6 = end->mPtr;
if ( begin->mPtr == end->mPtr )
return (BaseProcEvent *)ctx->it_begin->mPtr;
bool __fastcall needToFreezeSceneForActorCreate(BaseProcEvent *event, Vec3 *playerPos)
{
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
v2 = __ldar((unsigned __int8 *)&unk_71026003D8);
if...
if ( !event || !event->_.vptr->_.rtti1((ksys::util::ManagedTask *)event, &BaseProcEvent::rttiInfo) )
return 0;
obj = event->placementObj;
bool __cdecl ActorSystem::needToFreezeScene(ActorSystem *this)
{
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
v1 = BaseProcMgr::sInstance->procInitializer->mTaskQueue;
ksys::util::TaskQueueLock::TaskQueueLock(&lock);
v2 = ksys::util::TaskQueueBase::activeTasksBegin(v1, &lock);
_.playerAcc.acquired = 0;
_.playerAcc.actor = 0LL;
v27 = 0;
# Modified version of https://github.com/L4ys/LazyIDA
# Licensed under MIT
import idaapi
import idc
from struct import unpack
IDA7 = idaapi.IDA_SDK_VERSION >= 700
if IDA7:
from PyQt5.Qt import QApplication
else: