;************************************************************************************************************************************************************ ;* Reverb::set_extra_spread_base(float) * ;************************************************************************************************************************************************************ ;undefined set_extra_spread_base(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1d4],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Reverb::configure_buffers ;undefined configure_buffers(Reverb *... NOP LEAVE RET ?? 90h
void Reverb::set_extra_spread_base(float p_sec) { params.extra_spread_base = p_sec; configure_buffers(); }
void set_base(float value) { _base = value; }
;************************************************************************************************************************************************************ ;* Reverb::set_mix_rate(float) * ;************************************************************************************************************************************************************ ;undefined set_mix_rate(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1d0],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Reverb::configure_buffers ;undefined configure_buffers(Reverb *... NOP LEAVE RET ?? 90h
void Reverb::set_mix_rate(float p_mix_rate) { params.mix_rate = p_mix_rate; configure_buffers(); }
void float::set_float(float p_float) { m_float = p_float; m_float = p_float; }
;************************************************************************************************************************************************************ ;* Reverb::set_extra_spread(float) * ;************************************************************************************************************************************************************ ;undefined set_extra_spread(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1d8],param_1 NOP POP RBP RET ?? 90h
void Reverb::set_extra_spread(float p_spread) { params.extra_spread = p_spread; }
void set_angle (float val) { _angle = val; }
;************************************************************************************************************************************************************ ;* Reverb::set_highpass(float) * ;************************************************************************************************************************************************************ ;undefined set_highpass(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS XMM1,dword ptr [.rodata:DAT_00280c88] ;= 3F800000h COMISS param_1,XMM1 JBE LAB_0021674c MOVSS param_1,dword ptr [.rodata:DAT_00280c88] ;= 3F800000h MOVSS dword ptr [RBP + local_14+0x8],param_1 LAB_0021674c: PXOR param_1,param_1 COMISS param_1,dword ptr [RBP + local_14+0x8] JBE LAB_0021675f PXOR param_1,param_1 MOVSS dword ptr [RBP + local_14+0x8],param_1 LAB_0021675f: MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1e4],param_1 NOP POP RBP RET ?? 90h
void Reverb::set_highpass(float p_frq) { if (p_frq > 1) p_frq = 1; if (p_frq < 0) p_frq = 0; params.hpf = p_frq; }
void set::set(float f) { if (f < 0.0f) f = 0.0f; }
;************************************************************************************************************************************************************ ;* Reverb::set_predelay_feedback(float) * ;************************************************************************************************************************************************************ ;undefined set_predelay_feedback(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1e0],param_1 NOP POP RBP RET ?? 90h
void Reverb::set_predelay_feedback(float p_predelay_fb) { params.predelay_fb = p_predelay_fb; }
void pre_pre_pre::set_pre_pre(float p_pre) { p_pre = p_pre; }
;************************************************************************************************************************************************************ ;* Reverb::set_predelay(float) * ;************************************************************************************************************************************************************ ;undefined set_predelay(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1dc],param_1 NOP POP RBP RET ?? 90h
void Reverb::set_predelay(float p_predelay) { params.predelay = p_predelay; }
void set_pre_pre(float v) { _pre_pre = v; }
;************************************************************************************************************************************************************ ;* Reverb::set_dry(float) * ;************************************************************************************************************************************************************ ;undefined set_dry(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1cc],param_1 NOP POP RBP RET ?? 90h
void Reverb::set_dry(float p_dry) { params.dry = p_dry; }
void set::set(float x) { m_x = x; }
;************************************************************************************************************************************************************ ;* Reverb::set_wet(float) * ;************************************************************************************************************************************************************ ;undefined set_wet(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1c8],param_1 NOP POP RBP RET ?? 90h
void Reverb::set_wet(float p_wet) { params.wet = p_wet; }
void float::set_w (float w) { w = w; }
;************************************************************************************************************************************************************ ;* Reverb::set_damp(float) * ;************************************************************************************************************************************************************ ;undefined set_damp(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1c4],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Reverb::update_parameters ;undefined update_parameters(Reverb *... NOP LEAVE RET ?? 90h
void Reverb::set_damp(float p_damp) { params.damp = p_damp; update_parameters(); }
void GL::set_update(float value) { update(); }
;************************************************************************************************************************************************************ ;* Reverb::set_room_size(float) * ;************************************************************************************************************************************************************ ;undefined set_room_size(Reverb * this, float param_1) ;this Reverb * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x1c0],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Reverb::update_parameters ;undefined update_parameters(Reverb *... NOP LEAVE RET ?? 90h
void Reverb::set_room_size(float p_size) { params.room_size = p_size; update_parameters(); }
void set_size(float size) { size = size; update(); }
;************************************************************************************************************************************************************ ;* EQ::set_mix_rate(float) * ;************************************************************************************************************************************************************ ;undefined set_mix_rate(EQ * this, float param_1) ;this EQ * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x10],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL EQ::recalculate_band_coefficients ;undefined recalculate_band_coefficie... NOP LEAVE RET ;************************************************************************************************************************************************************ ;* EQ::get_band_processor(int) const * ;************************************************************************************************************************************************************ ;undefined get_band_processor(int param_1) ;param_1 int EDI ;local_10 undefined8 -10 ;local_28 undefined4 -28 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined8 -40 ;local_48 undefined8 -48 ;local_50 undefined8 -50 ;local_58 undefined8 -58 ;local_5c undefined4 -5c PUSH RBP
void EQ::set_mix_rate(float p_mix_rate) { mix_rate = p_mix_rate; recalculate_band_coefficients(); }
void float_t::set_float(float f) const { m_f = f; }
;************************************************************************************************************************************************************ ;* EQ::set_bands(Vector<float> const&) * ;************************************************************************************************************************************************************ ;undefined set_bands(EQ * this, Vector * param_1) ;this EQ * RDI ;param_1 Vector * RSI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_3c undefined4 -3c PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x38 MOV qword ptr [RBP + local_30+0x8],this MOV qword ptr [RBP + local_38+0x8],param_1 MOV RBX,qword ptr [RBP + local_30+0x8] MOV RAX,qword ptr [RBP + local_38+0x8] MOV this,RAX CALL Vector<float>::size ;undefined size(Vector<float> * this) MOV param_1,EAX MOV this,RBX CALL Vector<EQ::Band>::resize ;undefined resize(Vector<EQ::Band> *... MOV dword ptr [RBP + local_1c+0x8],0x0 JMP LAB_0021e0c0 LAB_0021e088: MOV EDX,dword ptr [RBP + local_1c+0x8] MOV RAX,qword ptr [RBP + local_38+0x8] MOV param_1,EDX MOV this,RAX CALL Vector<float>::operator[] ;undefined operator[](Vector<float> *... MOVSS XMM0,dword ptr [RAX] MOVSS dword ptr [RBP + local_3c+0x8],XMM0 MOV RAX,qword ptr [RBP + local_30+0x8] MOV EDX,dword ptr [RBP + local_1c+0x8] MOV param_1,EDX MOV this,RAX CALL Vector<EQ::Band>::operator[] ;undefined operator[](Vector<EQ::Band... MOVSS XMM0,dword ptr [RBP + local_3c+0x8] MOVSS dword ptr [RAX],XMM0 ADD dword ptr [RBP + local_1c+0x8],0x1 LAB_0021e0c0: MOV RAX,qword ptr [RBP + local_38+0x8] MOV this,RAX CALL Vector<float>::size ;undefined size(Vector<float> * this) CMP dword ptr [RBP + local_1c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_0021e088 MOV RAX,qword ptr [RBP + local_30+0x8] MOV this,RAX CALL EQ::recalculate_band_coefficients ;undefined recalculate_band_coefficie... NOP MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void EQ::set_bands(const Vector<float> &p_bands) { band.resize(p_bands.size()); for (int i = 0; i < p_bands.size(); i++) { band[i].freq = p_bands[i]; } recalculate_band_coefficients(); }
void Vector::set_size(const Vector3f &v) { for (size_t i = 0; i < v.size(); i++) { v[i] = v[i]; } }
;************************************************************************************************************************************************************ ;* EQ::get_band_count() const * ;************************************************************************************************************************************************************ ;undefined get_band_count(EQ * this) ;this EQ * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Vector<EQ::Band>::size ;undefined size(Vector<EQ::Band> * this) LEAVE RET ;************************************************************************************************************************************************************ ;* EQ::get_band_frequency(int) * ;************************************************************************************************************************************************************ ;undefined get_band_frequency(EQ * this, int param_1) ;this EQ * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP
int EQ::get_band_count() const { return band.size(); }
size_t Vector::get_count() const { return m_count; }
;************************************************************************************************************************************************************ ;* get_vst2_editor_function() * ;************************************************************************************************************************************************************ ;undefined get_vst2_editor_function(void) PUSH RBP MOV RBP,RSP LEA RAX,[create_vst2_editor] POP RBP RET ;************************************************************************************************************************************************************ ;* __static_initialization_and_destruction_0(int, int) * ;************************************************************************************************************************************************************ ;undefined __static_initialization_and_destruction_0(int param_1, int param_2) ;param_1 int EDI ;param_2 int ESI ;local_c undefined4 -c ;local_10 undefined4 -10 PUSH RBP
EffectEditorPluginFunc get_vst2_editor_function() { return &create_vst2_editor; }
const char *get_function_function_and_function(void) { return &function_and_function_and_function; }
;************************************************************************************************************************************************************ ;* create_vst2_provider() * ;************************************************************************************************************************************************************ ;undefined create_vst2_provider(void) PUSH RBP MOV RBP,RSP PUSH R12 PUSH RBX LAB_0022355f: CALL initialize_vst2_editor ;undefined initialize_vst2_editor(void) MOV EDI,0x8 CALL .plt:<EXTERNAL>::operator.new ;void * operator.new(ulong param_1) MOV RBX,RAX MOV RDI,RBX ;try { // try from 00223574 to 00223578 has its CatchHandler @ 0022357e LAB_00223574: CALL AudioEffectProviderVST2::AudioEffectProviderVST2 ;undefined AudioEffectProviderVST2(Au... ;} // end try from 00223574 to 00223578 MOV RAX,RBX JMP LAB_00223599 ;catch() {... } // from try @ 00223574 with catch @ 0022357e LAB_0022357e: MOV R12,RAX MOV ESI,0x8 MOV RDI,RBX CALL .plt:<EXTERNAL>::operator.delete ;void operator.delete(void * param_1,... MOV RAX,R12 MOV RDI,RAX LAB_00223594: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_00223599: POP RBX POP R12 POP RBP RET ;************************************************************************************************************************************************************ ;* create_vst2_editor(AudioEffect*, EffectEditor*) * ;************************************************************************************************************************************************************ ;undefined create_vst2_editor(AudioEffect * param_1, EffectEditor * param_2) ;param_1 AudioEffect * RDI ;param_2 EffectEditor * RSI ;local_20 undefined1 -20 ;local_28 undefined1 -28 ;local_30 undefined8 -30 ;local_38 undefined8 -38 PUSH RBP
AudioEffectProvider *create_vst2_provider() { initialize_vst2_editor(); return new AudioEffectProviderVST2; }
std::unique_ptr<Editor> createEditor(void) { return createEditor(); }
;************************************************************************************************************************************************************ ;* cleanup_rtaudio_driver() * ;************************************************************************************************************************************************************ ;undefined cleanup_rtaudio_driver(void) ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_20 undefined4 -20 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x18 MOV dword ptr [RBP + local_1c+0x8],0x0 JMP LAB_002239fc LAB_002239cd: MOV EAX,dword ptr [RBP + local_1c+0x8] MOV ESI,EAX LEA RAX,[.bss:drivers] MOV RDI=>.bss:drivers,RAX CALL Vector<SoundDriverRTAudio*>::operator[] ;undefined operator[](Vector<SoundDri... MOV RAX,qword ptr [RAX] TEST RAX,RAX JZ LAB_002239f8 MOV RDX,qword ptr [RAX] ADD RDX,0x58 MOV RDX,qword ptr [RDX] MOV RDI,RAX CALL RDX LAB_002239f8: ADD dword ptr [RBP + local_1c+0x8],0x1 LAB_002239fc: LEA RAX,[.bss:drivers] MOV RDI=>.bss:drivers,RAX CALL Vector<SoundDriverRTAudio*>::size ;undefined size(Vector<SoundDriverRTA... CMP dword ptr [RBP + local_1c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_002239cd MOV dword ptr [RBP + local_20+0x8],0x0 JMP LAB_00223a53 LAB_00223a1e: MOV EAX,dword ptr [RBP + local_20+0x8] MOV ESI,EAX LEA RAX,[.bss:rt_audios] MOV RDI=>.bss:rt_audios,RAX CALL Vector<RtAudio*>::operator[] ;undefined operator[](Vector<RtAudio*... MOV RBX,qword ptr [RAX] TEST RBX,RBX JZ LAB_00223a4f MOV RDI,RBX CALL RtAudio::~RtAudio ;undefined ~RtAudio(RtAudio * this) MOV ESI,0x8 MOV RDI,RBX CALL .plt:<EXTERNAL>::operator.delete ;void operator.delete(void * param_1,... LAB_00223a4f: ADD dword ptr [RBP + local_20+0x8],0x1 LAB_00223a53: LEA RAX,[.bss:rt_audios] MOV RDI=>.bss:rt_audios,RAX CALL Vector<RtAudio*>::size ;undefined size(Vector<RtAudio*> * this) CMP dword ptr [RBP + local_20+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00223a1e NOP NOP MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* __static_initialization_and_destruction_0(int, int) * ;************************************************************************************************************************************************************ ;undefined __static_initialization_and_destruction_0(int param_1, int param_2) ;param_1 int EDI ;param_2 int ESI ;local_c undefined4 -c ;local_10 undefined4 -10 PUSH RBP
void cleanup_rtaudio_driver() { for (int i = 0; i < drivers.size(); i++) { delete drivers[i]; } for (int i = 0; i < rt_audios.size(); i++) { delete rt_audios[i]; } }
void R_SoundSoundSound(void) { int i; for (i = 0; i < R_SoundSound.size(); i++) { if (r_SoundSound[i].driver) { r_SoundSound[i].driver->stop(); } } }
;************************************************************************************************************************************************************ ;*RtAudio::openStream(RtAudio::StreamParameters*, RtAudio::StreamParameters*, unsigned long, unsigned int, unsigned int*, int (*)(void*, void*, unsigned in...* ;************************************************************************************************************************************************************ ;undefined openStream(RtAudio * this, StreamParameters * param_1, StreamParameters * param_2, ulong param_3, uint param_4, uint * param_5, FuncDef223 * param_6, void * param_7, StreamOptions * param_8, FuncDef224 * param_9) ;this RtAudio * RDI ;param_1 StreamParam... RSI ;param_2 StreamParam... RDX ;param_3 ulong RCX ;param_4 uint R8D ;param_5 uint * R9 ;param_6 FuncDef223 * 8 ;param_7 void * 10 ;param_8 StreamOptio... 18 ;param_9 FuncDef224 * 20 ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_2c undefined4 -2c ;local_38 undefined8 -38 PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV qword ptr [RBP + local_10+0x8],this MOV qword ptr [RBP + local_18+0x8],param_1 MOV qword ptr [RBP + local_20+0x8],param_2 MOV qword ptr [RBP + local_28+0x8],param_3 MOV dword ptr [RBP + local_2c+0x8],param_4 MOV qword ptr [RBP + local_38+0x8],param_5 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX] MOV param_4,qword ptr [RBP + local_38+0x8] MOV this,dword ptr [RBP + local_2c+0x8] MOV param_3,qword ptr [RBP + local_28+0x8] MOV param_2,qword ptr [RBP + local_20+0x8] MOV param_1,qword ptr [RBP + local_18+0x8] PUSH qword ptr [RBP + param_9+0x8] PUSH qword ptr [RBP + param_8+0x8] PUSH qword ptr [RBP + param_7+0x8] PUSH qword ptr [RBP + param_6+0x8] MOV param_5,param_4 MOV param_4,this MOV this,RAX CALL RtApi::openStream ;undefined openStream(RtApi * this, S... ADD RSP,0x20 NOP LEAVE RET ?? 90h
void RtAudio :: openStream( RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData, RtAudio::StreamOptions *options, RtAudioErrorCallback errorCallback ) { return rtapi_->openStream( outputParameters, inputParameters, format, sampleRate, bufferFrames, callback, userData, options, errorCallback ); }
void AudioStreamStream::openStream(void* data, size_t size, void* data, size_t size, void* data, size_t size) { m_stream->openStream(data, size, data, size, data, size); }
;************************************************************************************************************************************************************ ;* unregister_rtmidi_driver() * ;************************************************************************************************************************************************************ ;undefined unregister_rtmidi_driver(void) ;local_c undefined4 -c PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_00234e9f LAB_00234e70: MOV EAX,dword ptr [RBP + local_c+0x8] MOV ESI,EAX LEA RAX,[.bss:midi_drivers] MOV RDI=>.bss:midi_drivers,RAX CALL Vector<MIDIInputDriverRtMidi*>::operator[] ;undefined operator[](Vector<MIDIInpu... MOV RAX,qword ptr [RAX] TEST RAX,RAX JZ LAB_00234e9b MOV RDX,qword ptr [RAX] ADD RDX,0x40 MOV RDX,qword ptr [RDX] MOV RDI,RAX CALL RDX LAB_00234e9b: ADD dword ptr [RBP + local_c+0x8],0x1 LAB_00234e9f: LEA RAX,[.bss:midi_drivers] MOV RDI=>.bss:midi_drivers,RAX CALL Vector<MIDIInputDriverRtMidi*>::size ;undefined size(Vector<MIDIInputDrive... CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00234e70 MOV RAX,qword ptr [.bss:midiin] TEST RAX,RAX JZ LAB_00234ed3 MOV RDX,qword ptr [RAX] ADD RDX,0x40 MOV RDX,qword ptr [RDX] MOV RDI,RAX CALL RDX LAB_00234ed3: NOP LEAVE RET ;************************************************************************************************************************************************************ ;* __static_initialization_and_destruction_0(int, int) * ;************************************************************************************************************************************************************ ;undefined __static_initialization_and_destruction_0(int param_1, int param_2) ;param_1 int EDI ;param_2 int ESI ;local_c undefined4 -c ;local_10 undefined4 -10 PUSH RBP
void unregister_rtmidi_driver() { for (int i = 0; i < midi_drivers.size(); i++) { delete midi_drivers[i]; } delete midiin; }
void handle_input() { int i; for (i = 0; i < MAX_SIZE; i++) { if (input[i] == 0) { input[i] = 0; input[i] = 0; } } }
;************************************************************************************************************************************************************ ;* MidiInApi::MidiQueue::push(MidiInApi::MidiMessage const&) * ;************************************************************************************************************************************************************ ;undefined push(MidiQueue * this, MidiMessage * param_1) ;this MidiQueue * RDI ;param_1 MidiMessage * RSI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_14 undefined1 -14 ;local_20 undefined8 -20 ;local_28 undefined8 -28 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV qword ptr [RBP + local_28+0x8],param_1 LEA RDX=>local_14,[RBP + -0xc] LEA RCX=>local_10,[RBP + -0x8] MOV RAX,qword ptr [RBP + local_20+0x8] MOV param_1,RCX MOV this,RAX CALL MidiInApi::MidiQueue::size ;undefined size(MidiQueue * this, uin... MOV dword ptr [RBP + local_c+0x8],EAX MOV RAX,qword ptr [RBP + local_20+0x8] MOV EAX,dword ptr [RAX + 0x8] SUB EAX,0x1 CMP dword ptr [RBP + local_c+0x8],EAX JNC LAB_00236d76 MOV RAX,qword ptr [RBP + local_20+0x8] MOV RAX,qword ptr [RAX + 0x10] MOV EDX,dword ptr [RBP + local_10+0x8] MOV EDX,EDX SHL RDX,0x5 ADD RDX,RAX MOV RAX,qword ptr [RBP + local_28+0x8] MOV param_1,RAX MOV this,RDX CALL MidiInApi::MidiMessage::operator= ;undefined operator=(MidiMessage * th... MOV RAX,qword ptr [RBP + local_20+0x8] MOV EAX,dword ptr [RAX + 0x4] LEA EDX,[RAX + 0x1] MOV RAX,qword ptr [RBP + local_20+0x8] MOV ECX,dword ptr [RAX + 0x8] MOV EAX,EDX MOV EDX,0x0 DIV ECX MOV RAX,qword ptr [RBP + local_20+0x8] MOV dword ptr [RAX + 0x4],EDX MOV EAX,0x1 JMP LAB_00236d7b LAB_00236d76: MOV EAX,0x0 LAB_00236d7b: LEAVE RET ?? 90h
bool MidiInApi::MidiQueue::push(const MidiInApi::MidiMessage &msg) { // Local stack copies of front/back unsigned int _back, _front, _size; // Get back/front indexes exactly once and calculate current size _size = size(&_back, &_front); if (_size < ringSize - 1) { ring[_back] = msg; back = (back + 1) % ringSize; return true; } return false; }
void Message::push(MessageMessage& message) { message.push_back(message); }
;************************************************************************************************************************************************************ ;* MidiInApi::MidiQueue::size(unsigned int*, unsigned int*) * ;************************************************************************************************************************************************************ ;undefined size(MidiQueue * this, uint * param_1, uint * param_2) ;this MidiQueue * RDI ;param_1 uint * RSI ;param_2 uint * RDX ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_14 undefined4 -14 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_30 undefined8 -30 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_20+0x8],this MOV qword ptr [RBP + local_28+0x8],param_1 MOV qword ptr [RBP + local_30+0x8],param_2 MOV RAX,qword ptr [RBP + local_20+0x8] MOV EAX,dword ptr [RAX + 0x4] MOV dword ptr [RBP + local_10+0x8],EAX MOV RAX,qword ptr [RBP + local_20+0x8] MOV EAX,dword ptr [RAX] MOV dword ptr [RBP + local_14+0x8],EAX MOV EAX,dword ptr [RBP + local_10+0x8] CMP EAX,dword ptr [RBP + local_14+0x8] JC LAB_00236cb8 MOV EAX,dword ptr [RBP + local_10+0x8] SUB EAX,dword ptr [RBP + local_14+0x8] MOV dword ptr [RBP + local_c+0x8],EAX JMP LAB_00236ccc LAB_00236cb8: MOV RAX,qword ptr [RBP + local_20+0x8] MOV EAX,dword ptr [RAX + 0x8] SUB EAX,dword ptr [RBP + local_14+0x8] MOV param_2,EAX MOV EAX,dword ptr [RBP + local_10+0x8] ADD EAX,param_2 MOV dword ptr [RBP + local_c+0x8],EAX LAB_00236ccc: CMP qword ptr [RBP + local_28+0x8],0x0 JZ LAB_00236cdc MOV RAX,qword ptr [RBP + local_28+0x8] MOV param_2,dword ptr [RBP + local_10+0x8] MOV dword ptr [RAX],param_2 LAB_00236cdc: CMP qword ptr [RBP + local_30+0x8],0x0 JZ LAB_00236cec MOV RAX,qword ptr [RBP + local_30+0x8] MOV param_2,dword ptr [RBP + local_14+0x8] MOV dword ptr [RAX],param_2 LAB_00236cec: MOV EAX,dword ptr [RBP + local_c+0x8] POP RBP RET ?? 90h
unsigned int MidiInApi::MidiQueue::size(unsigned int *__back, unsigned int *__front) { // Access back/front members exactly once and make stack copies for // size calculation unsigned int _back = back, _front = front, _size; if (_back >= _front) _size = _back - _front; else _size = ringSize - _front + _back; // Return copies of back/front so no new and unsynchronized accesses // to member variables are needed. if (__back) *__back = _back; if (__front) *__front = _front; return _size; }
int QueueQueue::QueueQueueQueue(QueueQueue *pQueue, uint32_t *pQueue, uint32_t *pQueue) { if (pQueue == NULL) return 0; *pQueue = pQueue->pQueue; return 1; }
;************************************************************************************************************************************************************ ;* finalize_vst2_editor() * ;************************************************************************************************************************************************************ ;undefined finalize_vst2_editor(void) PUSH RBP MOV RBP,RSP CALL vstfx_exit ;undefined vstfx_exit(void) NOP POP RBP RET ;************************************************************************************************************************************************************ ;* EffectEditorVST2::initialize() * ;************************************************************************************************************************************************************ ;undefined initialize(EffectEditorVST2 * this) ;this EffectEdito... RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP
void finalize_vst2_editor() { #ifdef FREEDESKTOP_ENABLED vstfx_exit(); #endif }
void v2_exit () { v2_exit (); }
;************************************************************************************************************************************************************ ;* initialize_vst2_editor() * ;************************************************************************************************************************************************************ ;undefined initialize_vst2_editor(void) PUSH RBP MOV RBP,RSP CALL vstfx_init ;undefined vstfx_init(void) NOP POP RBP RET ;************************************************************************************************************************************************************ ;* finalize_vst2_editor() * ;************************************************************************************************************************************************************ ;undefined finalize_vst2_editor(void) PUSH RBP
void initialize_vst2_editor() { #ifdef WINDOWS_ENABLED HMODULE hInst = GetModuleHandleA(NULL); ERR_FAIL_COND(!hInst); WNDCLASSEXW wcex{ sizeof(wcex) }; wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hCursor = LoadCursor(NULL, IDC_ARROW); wcex.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); wcex.lpfnWndProc = DefWindowProc; wcex.hInstance = GetModuleHandle(0); wcex.lpszClassName = L"VST_HOST"; if (!RegisterClassExW(&wcex)) { ERR_PRINT("Error in initialize_vst2_editor(): (class registration failed"); return; } #endif #ifdef FREEDESKTOP_ENABLED vstfx_init(); #endif }
void v2_editor_init() { v2_editor_init(); }
;************************************************************************************************************************************************************ ;* vstfx_event_loop_remove_plugin(VSTState*) * ;************************************************************************************************************************************************************ ;undefined vstfx_event_loop_remove_plugin(VSTState * param_1) ;param_1 VSTState * RDI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],param_1 MOV RAX,qword ptr [.bss:vstfx_first] MOV qword ptr [RBP + local_10+0x8],RAX MOV qword ptr [RBP + local_18+0x8],0x0 JMP LAB_00244fe5 LAB_00244fae: MOV RAX,qword ptr [RBP + local_10+0x8] CMP RAX,qword ptr [RBP + local_20+0x8] JNZ LAB_00244fd1 CMP qword ptr [RBP + local_18+0x8],0x0 JZ LAB_00244fd1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RDX,qword ptr [RAX + 0x58] MOV RAX,qword ptr [RBP + local_18+0x8] MOV qword ptr [RAX + 0x58],RDX JMP LAB_00244fec LAB_00244fd1: MOV RAX,qword ptr [RBP + local_10+0x8] MOV qword ptr [RBP + local_18+0x8],RAX MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x58] MOV qword ptr [RBP + local_10+0x8],RAX LAB_00244fe5: CMP qword ptr [RBP + local_10+0x8],0x0 JNZ LAB_00244fae LAB_00244fec: MOV RAX,qword ptr [.bss:vstfx_first] TEST RAX,RAX JNZ LAB_00245020 LEA RAX,[.rodata:s_void_vstfx_event_loop_remove_plu_00285838] ;= "void vstfx_event_loop_remove_plug... MOV RCX=>.rodata:s_void_vstfx_event_loop_remove_plu_00285838,RAX ;= "void vstfx_event_loop_remove_plug... MOV EDX,0x32e LEA RAX,[.rodata:s_drivers/vst2/effect_editor_x11.c_00285740] ;= "drivers/vst2/effect_editor_x11.cpp" MOV RSI=>.rodata:s_drivers/vst2/effect_editor_x11.c_00285740,RAX ;= "drivers/vst2/effect_editor_x11.cpp" LEA RAX,[.rodata:s_vstfx_first_00285867] ;= "vstfx_first" MOV param_1=>.rodata:s_vstfx_first_00285867,RAX ;= "vstfx_first" CALL .plt:<EXTERNAL>::__assert_fail ;void __assert_fail(char * __assertio... LAB_00245020: MOV RAX,qword ptr [.bss:vstfx_first] CMP qword ptr [RBP + local_20+0x8],RAX JNZ LAB_0024503f MOV RAX,qword ptr [.bss:vstfx_first] MOV RAX,qword ptr [RAX + 0x58] MOV qword ptr [.bss:vstfx_first],RAX LAB_0024503f: NOP LEAVE RET ;************************************************************************************************************************************************************ ;* __static_initialization_and_destruction_0(int, int) * ;************************************************************************************************************************************************************ ;undefined __static_initialization_and_destruction_0(int param_1, int param_2) ;param_1 int EDI ;param_2 int ESI ;local_c undefined4 -c ;local_10 undefined4 -10 PUSH RBP
void vstfx_event_loop_remove_plugin(VSTState *vstfx) { /* This only ever gets called from within our GUI thread so we don't need to lock here - if we did there would be a deadlock anyway */ VSTState *p; VSTState *prev; for (p = vstfx_first, prev = NULL; p; prev = p, p = p->next) { if (p == vstfx) { if (prev) { prev->next = p->next; break; } } } // if this function is called, there must be // at least one plugin in the linked list assert(vstfx_first); if (vstfx_first == vstfx) { vstfx_first = vstfx_first->next; } }
void v_event_remove_event(int event) { v_event_t *v; for (v = v_event; v!= NULL; v = v_next(v)) { v = v->next; } }
;************************************************************************************************************************************************************ ;* vstfx_destroy_editor(AudioEffectVST2*) * ;************************************************************************************************************************************************************ ;undefined vstfx_destroy_editor(AudioEffectVST2 * param_1) ;param_1 AudioEffect... RDI ;local_10 undefined8 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],param_1 MOV RAX,qword ptr [.bss:vstfx_first] MOV qword ptr [RBP + local_10+0x8],RAX JMP LAB_00244f1f LAB_00244f05: MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x70] CMP qword ptr [RBP + local_20+0x8],RAX JZ LAB_00244f28 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x58] MOV qword ptr [RBP + local_10+0x8],RAX LAB_00244f1f: CMP qword ptr [RBP + local_10+0x8],0x0 JNZ LAB_00244f05 JMP LAB_00244f29 LAB_00244f28: NOP LAB_00244f29: CMP qword ptr [RBP + local_10+0x8],0x0 JNZ LAB_00244f41 LEA RAX,[.rodata:s_destroyed_invalid_effect.._00285816] ;= "destroyed invalid effect.." MOV param_1=>.rodata:s_destroyed_invalid_effect.._00285816,RAX ;= "destroyed invalid effect.." CALL .plt:<EXTERNAL>::puts ;int puts(char * __s) JMP LAB_00244f8b LAB_00244f41: MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_1,RAX CALL .plt:<EXTERNAL>::pthread_mutex_lock ;int pthread_mutex_lock(pthread_mutex... MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x60] TEST RAX,RAX JZ LAB_00244f7f MOV RAX,qword ptr [RBP + local_10+0x8] MOV dword ptr [RAX + 0x90],0x1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RDX,qword ptr [RBP + local_10+0x8] ADD RDX,0x28 MOV RSI,RAX MOV param_1,RDX CALL .plt:<EXTERNAL>::pthread_cond_wait ;int pthread_cond_wait(pthread_cond_t... LAB_00244f7f: MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_1,RAX CALL .plt:<EXTERNAL>::pthread_mutex_unlock ;int pthread_mutex_unlock(pthread_mut... LAB_00244f8b: LEAVE RET ;************************************************************************************************************************************************************ ;* vstfx_event_loop_remove_plugin(VSTState*) * ;************************************************************************************************************************************************************ ;undefined vstfx_event_loop_remove_plugin(VSTState * param_1) ;param_1 VSTState * RDI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 PUSH RBP
void vstfx_destroy_editor(AudioEffectVST2 *p_effect) { VSTState *vstfx = vstfx_first; while (vstfx) { if (vstfx->effect_vst == p_effect) { break; } vstfx = vstfx->next; } if (!vstfx) { printf("destroyed invalid effect..\n"); return; } pthread_mutex_lock(&vstfx->lock); if (vstfx->linux_window) { vstfx->destroy = TRUE; pthread_cond_wait(&vstfx->window_status_change, &vstfx->lock); } pthread_mutex_unlock(&vstfx->lock); }
void plugin_remove_event(plugin_t *plugin) { plugin_t *plugin; if (plugin == NULL) return; plugin = plugin; while (plugin!= NULL) { plugin->next = plugin->next; plugin->next = plugin->next; } pthread_mutex_lock(&plugin->lock); plugin->event = NULL; pthread_mutex_unlock(&plugin->lock); }
;************************************************************************************************************************************************************ ;* vstfx_launch_editor(VSTState*) * ;************************************************************************************************************************************************************ ;undefined vstfx_launch_editor(VSTState * param_1) ;param_1 VSTState * RDI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_1c undefined4 -1c ;local_20 undefined4 -20 ;local_30 undefined8 -30 PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV qword ptr [RBP + local_30+0x8],param_1 MOV RAX,qword ptr [RBP + local_30+0x8] MOV EAX,dword ptr [RAX + 0x94] TEST EAX,EAX JZ LAB_00244e1c MOV EAX,0x0 JMP LAB_00244eea LAB_00244e1c: MOV qword ptr [RBP + local_10+0x8],0x0 MOV dword ptr [RBP + local_1c+0x8],0x1 MOV dword ptr [RBP + local_20+0x8],0x1 MOV RAX,qword ptr [RBP + local_30+0x8] MOV RAX,qword ptr [RAX + 0x60] MOV qword ptr [RBP + local_18+0x8],RAX MOV RAX,qword ptr [RBP + local_30+0x8] MOV RAX,qword ptr [RAX + 0x70] MOV RDX,qword ptr [RBP + local_18+0x8] MOV RCX,qword ptr [.bss:LXVST_XDisplay] MOV RSI,RCX MOV param_1,RAX CALL AudioEffectVST2::open_user_interface ;undefined open_user_interface(AudioE... MOV param_1,0x186a0 CALL .plt:<EXTERNAL>::Glib::usleep ;undefined usleep(ulong param_1) MOV RAX,qword ptr [RBP + local_30+0x8] MOV RAX,qword ptr [RAX + 0x70] LEA RDX=>local_20,[RBP + -0x18] LEA RCX=>local_1c,[RBP + -0x14] MOV RSI,RCX MOV param_1,RAX CALL AudioEffectVST2::get_user_interface_size ;undefined get_user_interface_size(Au... MOV EDX,dword ptr [RBP + local_1c+0x8] MOV RAX,qword ptr [RBP + local_30+0x8] MOV dword ptr [RAX + 0x80],EDX MOV EDX,dword ptr [RBP + local_20+0x8] MOV RAX,qword ptr [RBP + local_30+0x8] MOV dword ptr [RAX + 0x84],EDX MOV EAX,dword ptr [RBP + local_20+0x8] MOV ECX,EAX MOV EAX,dword ptr [RBP + local_1c+0x8] MOV EDX,EAX MOV RAX,qword ptr [.bss:LXVST_XDisplay] MOV RSI,qword ptr [RBP + local_18+0x8] MOV param_1,RAX CALL .plt:<EXTERNAL>::XResizeWindow ;undefined XResizeWindow() MOV RAX,qword ptr [.bss:LXVST_XDisplay] MOV param_1,RAX CALL .plt:<EXTERNAL>::XFlush ;undefined XFlush() MOV RAX,qword ptr [RBP + local_30+0x8] MOV dword ptr [RAX + 0x94],0x1 MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x28 MOV param_1,RAX CALL .plt:<EXTERNAL>::pthread_cond_signal ;int pthread_cond_signal(pthread_cond... MOV EAX,0x0 LAB_00244eea: LEAVE RET ;************************************************************************************************************************************************************ ;* vstfx_destroy_editor(AudioEffectVST2*) * ;************************************************************************************************************************************************************ ;undefined vstfx_destroy_editor(AudioEffectVST2 * param_1) ;param_1 AudioEffect... RDI ;local_10 undefined8 -10 ;local_20 undefined8 -20 PUSH RBP
int vstfx_launch_editor(VSTState *vstfx) { /*This is the second stage of launching the editor (see vstfx_create editor) we get called here in response to receiving the ClientMessage on our Window, therefore it's about as safe (as can be) to assume that the Window we created is now valid in the XServer and can be passed to the plugin in effEditOpen without generating BadWindow errors when the plugin reparents itself into our parent window*/ if (vstfx->been_activated) return 0; Window parent_window; struct ERect *er = NULL; int x_size = 1; int y_size = 1; parent_window = vstfx->linux_window; /*Open the editor - Bah! we have to pass the int windowID as a void pointer - yuck it gets cast back to an int as the parent window XID in the plugin - and we have to pass the Display* as a long */ /**************************************************************/ /* 64Bit --- parent window is an int passed as a void* so */ /* that should be ok for 64Bit machines */ /* */ /* Display is passed in as a long - ok on arch's where sizeof */ /* long = 8 */ /* */ /* Most linux VST plugins open a connection to X on their own */ /* Display anyway so it may not matter */ /* */ /* linuxDSP VSTs don't use the host Display* at all */ /**************************************************************/ vstfx->effect_vst->open_user_interface((long)LXVST_XDisplay, (void *)(parent_window)); /*QUIRK - some plugins need a slight delay after opening the editor before you can ask the window size or they might return zero - specifically discoDSP */ Glib::usleep(100000); /*Now we can find out how big the parent window should be (and try) to resize it*/ vstfx->effect_vst->get_user_interface_size(x_size, y_size); vstfx->width = x_size; vstfx->height = y_size; XResizeWindow(LXVST_XDisplay, parent_window, x_size, y_size); XFlush(LXVST_XDisplay); /*Not sure if we need to map the window or if the plugin will do it for us it should be ok because XReparentWindow generates a Map event*/ /*mark the editor as activated - mainly so that vstfx_get_XID will know it is valid*/ vstfx->been_activated = TRUE; pthread_cond_signal(&vstfx->window_status_change); return 0; }
void user_interface_open(void *data) { user_t *user = (user_t *)data; user_t *user = (user_t *)user->user; if (user->open) { user->open(); user->open(user); } else { user->open(user); user->open(user); } }
;************************************************************************************************************************************************************ ;* vstfx_get_window_size(AudioEffectVST2*, int*, int*) * ;************************************************************************************************************************************************************ ;undefined vstfx_get_window_size(AudioEffectVST2 * param_1, int * param_2, int * param_3) ;param_1 AudioEffect... RDI ;param_2 int * RSI ;param_3 int * RDX ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_30 undefined8 -30 PUSH RBP MOV RBP,RSP SUB RSP,0x30 MOV qword ptr [RBP + local_20+0x8],param_1 MOV qword ptr [RBP + local_28+0x8],param_2 MOV qword ptr [RBP + local_30+0x8],param_3 MOV RAX,qword ptr [RBP + local_28+0x8] MOV dword ptr [RAX],0x0 MOV RAX,qword ptr [RBP + local_30+0x8] MOV dword ptr [RAX],0x0 LEA RAX,[.bss:plugin_mutex] MOV param_1=>.bss:plugin_mutex,RAX CALL .plt:<EXTERNAL>::pthread_mutex_lock ;int pthread_mutex_lock(pthread_mutex... MOV RAX,qword ptr [.bss:vstfx_first] MOV qword ptr [RBP + local_10+0x8],RAX JMP LAB_00244a9a LAB_00244a60: MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x70] CMP qword ptr [RBP + local_20+0x8],RAX JNZ LAB_00244a8e MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_3,dword ptr [RAX + 0x80] MOV RAX,qword ptr [RBP + local_28+0x8] MOV dword ptr [RAX],param_3 MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_3,dword ptr [RAX + 0x84] MOV RAX,qword ptr [RBP + local_30+0x8] MOV dword ptr [RAX],param_3 LAB_00244a8e: MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x58] MOV qword ptr [RBP + local_10+0x8],RAX LAB_00244a9a: CMP qword ptr [RBP + local_10+0x8],0x0 JNZ LAB_00244a60 LEA RAX,[.bss:plugin_mutex] MOV param_1=>.bss:plugin_mutex,RAX CALL .plt:<EXTERNAL>::pthread_mutex_unlock ;int pthread_mutex_unlock(pthread_mut... NOP LEAVE RET ;************************************************************************************************************************************************************ ;* vstfx_run_editor(AudioEffectVST2*, EffectEditorVST2*) * ;************************************************************************************************************************************************************ ;undefined vstfx_run_editor(AudioEffectVST2 * param_1, EffectEditorVST2 * param_2) ;param_1 AudioEffect... RDI ;param_2 EffectEdito... RSI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 ;local_28 undefined8 -28 PUSH RBP
void vstfx_get_window_size(AudioEffectVST2 *p_effect, int *w, int *h) { *w = 0; *h = 0; pthread_mutex_lock(&plugin_mutex); VSTState *p = vstfx_first; while (p) { if (p->effect_vst == p_effect) { *w = p->width; *h = p->height; } p = p->next; } pthread_mutex_unlock(&plugin_mutex); }
void vplugin_get_window(Vplugin *plugin, int *width, int *height) { Vplugin *vplugin; vplugin = plugin->vplugin; vplugin->width = width; vplugin->height = height; vplugin->width = height; vplugin->height = height; }
;************************************************************************************************************************************************************ ;* vstfx_exit() * ;************************************************************************************************************************************************************ ;undefined vstfx_exit(void) PUSH RBP MOV RBP,RSP MOV EAX,dword ptr [.bss:gui_quit] TEST EAX,EAX SETNZ AL TEST AL,AL JNZ LAB_00244a19 MOV dword ptr [.bss:gui_quit],0x1 MOV RAX,qword ptr [.bss:LXVST_gui_event_thread] MOV ESI,0x0 MOV RDI,RAX CALL .plt:<EXTERNAL>::pthread_join ;int pthread_join(pthread_t __th, voi... LEA RAX,[.bss:plugin_mutex] MOV RDI=>.bss:plugin_mutex,RAX CALL .plt:<EXTERNAL>::pthread_mutex_destroy ;int pthread_mutex_destroy(pthread_mu... JMP LAB_00244a1a LAB_00244a19: NOP LAB_00244a1a: POP RBP RET ;************************************************************************************************************************************************************ ;* vstfx_get_window_size(AudioEffectVST2*, int*, int*) * ;************************************************************************************************************************************************************ ;undefined vstfx_get_window_size(AudioEffectVST2 * param_1, int * param_2, int * param_3) ;param_1 AudioEffect... RDI ;param_2 int * RSI ;param_3 int * RDX ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_30 undefined8 -30 PUSH RBP
void vstfx_exit() { if (gui_quit) { return; } gui_quit = 1; /*We need to pthread_join the gui_thread here so we know when it has stopped*/ pthread_join(LXVST_gui_event_thread, NULL); pthread_mutex_destroy(&plugin_mutex); }
void gui_exit(void) { if (gui_exit) gui_exit(gui_exit); gui_exit(0); }
;************************************************************************************************************************************************************ ;* getXWindowProperty(unsigned long, unsigned long) * ;************************************************************************************************************************************************************ ;undefined getXWindowProperty(ulong param_1, ulong param_2) ;param_1 ulong RDI ;param_2 ulong RSI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_1c undefined1 -1c ;local_28 undefined1 -28 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined1 -40 ;local_50 undefined8 -50 ;local_58 undefined8 -58 PUSH RBP MOV RBP,RSP SUB RSP,0x50 MOV qword ptr [RBP + local_50+0x8],param_1 MOV qword ptr [RBP + local_58+0x8],param_2 MOV qword ptr [RBP + local_10+0x8],0x0 MOV byte ptr [.bss:LXVST_xerror],0x0 LEA RAX,[TempErrorHandler] MOV param_1=>TempErrorHandler,RAX CALL .plt:<EXTERNAL>::XSetErrorHandler ;undefined XSetErrorHandler() MOV qword ptr [RBP + local_18+0x8],RAX MOV RAX,qword ptr [.bss:LXVST_XDisplay] MOV RDX,qword ptr [RBP + local_58+0x8] MOV param_2,qword ptr [RBP + local_50+0x8] LEA RCX=>local_38,[RBP + -0x30] PUSH RCX LEA RCX=>local_28,[RBP + -0x20] PUSH RCX LEA RCX=>local_30,[RBP + -0x28] PUSH RCX LEA RCX=>local_1c,[RBP + -0x14] PUSH RCX LEA RCX=>local_40,[RBP + -0x38] PUSH RCX PUSH 0x0 MOV R9D,0x0 MOV R8D,0x2 MOV ECX,0x0 MOV param_1,RAX CALL .plt:<EXTERNAL>::XGetWindowProperty ;undefined XGetWindowProperty() ADD RSP,0x30 MOVZX EAX,byte ptr [.bss:LXVST_xerror] MOVZX EAX,AL TEST EAX,EAX JNZ LAB_00244246 MOV RAX,qword ptr [RBP + local_30+0x8] CMP RAX,0x1 JNZ LAB_00244246 MOV RAX,qword ptr [RBP + local_38+0x8] MOV RAX,qword ptr [RAX] MOV qword ptr [RBP + local_10+0x8],RAX LAB_00244246: MOV RAX,qword ptr [RBP + local_18+0x8] MOV param_1,RAX CALL .plt:<EXTERNAL>::XSetErrorHandler ;undefined XSetErrorHandler() MOV RAX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* dispatch_x_events(_XEvent*, VSTState*) * ;************************************************************************************************************************************************************ ;undefined dispatch_x_events(_XEvent * param_1, VSTState * param_2) ;param_1 _XEvent * RDI ;param_2 VSTState * RSI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_2c undefined4 -2c ;local_30 undefined4 -30 ;local_38 undefined8 -38 ;local_40 undefined8 -40 ;local_48 undefined8 -48 ;local_50 undefined8 -50 ;local_58 undefined8 -58 PUSH RBP
long getXWindowProperty(Window window, Atom atom) { long result = 0; int userSize; unsigned long bytes; unsigned long userCount; unsigned char *data; Atom userType; LXVST_xerror = false; /*Use our own Xerror handler while we're in here - in an * attempt to stop the brain dead default Xerror behaviour of * qutting the entire application because of e.g. an invalid * window ID */ XErrorHandler olderrorhandler = XSetErrorHandler(TempErrorHandler); XGetWindowProperty(LXVST_XDisplay, window, atom, 0, 2, false, AnyPropertyType, &userType, &userSize, &userCount, &bytes, &data); if (LXVST_xerror == false && userCount == 1) { result = *(long *)data; } XSetErrorHandler(olderrorhandler); /*Hopefully this will return zero if the property is not set*/ return result; }
void X11Window(Display *dpy, Window window, Window window, Window window) { Window window; Window window; Window window; Window window; window.window = window; window.window = window; window.window = window; window.window = window; window.window = window; window.window = window; window.window = window; window.window = window; window.window = window; window.window = window; }
;************************************************************************************************************************************************************ ;* TempErrorHandler(_XDisplay*, XErrorEvent*) * ;************************************************************************************************************************************************************ ;undefined TempErrorHandler(_XDisplay * param_1, XErrorEvent * param_2) ;param_1 _XDisplay * RDI ;param_2 XErrorEvent * RSI ;local_10 undefined8 -10 ;local_18 undefined8 -18 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],param_1 MOV qword ptr [RBP + local_18+0x8],param_2 MOV byte ptr [.bss:LXVST_xerror],0x1 MOV EAX,0x0 POP RBP RET ;************************************************************************************************************************************************************ ;* getXWindowProperty(unsigned long, unsigned long) * ;************************************************************************************************************************************************************ ;undefined getXWindowProperty(ulong param_1, ulong param_2) ;param_1 ulong RDI ;param_2 ulong RSI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_1c undefined1 -1c ;local_28 undefined1 -28 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined1 -40 ;local_50 undefined8 -50 ;local_58 undefined8 -58 PUSH RBP
int TempErrorHandler(Display *display, XErrorEvent *e) { LXVST_xerror = true; return 0; }
int XErrorEvent(Display *dpy, XErrorEvent *event) { return 0; }
;************************************************************************************************************************************************************ ;* Filter::Processor::set_filter(Filter*, bool) * ;************************************************************************************************************************************************************ ;undefined set_filter(Processor * this, Filter * param_1, bool param_2) ;this Processor * RDI ;param_1 Filter * RSI ;param_2 bool DL ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_1c undefined1 -1c PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV qword ptr [RBP + local_18+0x8],param_1 MOV EAX,param_2 MOV byte ptr [RBP + local_1c+0x8],AL CMP byte ptr [RBP + local_1c+0x8],0x0 JZ LAB_00247c3a MOV RAX,qword ptr [RBP + local_10+0x8] PXOR XMM0,XMM0 MOVSS dword ptr [RAX + 0x28],XMM0 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS XMM0,dword ptr [RAX + 0x28] MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS dword ptr [RAX + 0x24],XMM0 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS XMM0,dword ptr [RAX + 0x24] MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS dword ptr [RAX + 0x20],XMM0 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS XMM0,dword ptr [RAX + 0x20] MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS dword ptr [RAX + 0x1c],XMM0 LAB_00247c3a: MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_2,qword ptr [RBP + local_18+0x8] MOV qword ptr [RAX],param_2 NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Filter::Processor::update_coeffs(int) * ;************************************************************************************************************************************************************ ;undefined update_coeffs(Processor * this, int param_1) ;this Processor * RDI ;param_1 int ESI ;local_18 undefined4 -18 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_30 undefined8 -30 ;local_34 undefined4 -34 PUSH RBP
void Filter::Processor::set_filter(Filter *p_filter, bool p_clear_history) { if (p_clear_history) { ha1 = ha2 = hb1 = hb2 = 0; } filter = p_filter; }
void Filter::set_filter(float f_filter, float f_filter) { if (f_filter) { f_filter = f_filter; f_filter = f_filter; f_filter = f_filter; } else { f_filter = f_filter; } }
;************************************************************************************************************************************************************ ;* Filter::set_stages(int) * ;************************************************************************************************************************************************************ ;undefined set_stages(Filter * this, int param_1) ;this Filter * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV EDX,dword ptr [RBP + local_14+0x8] MOV dword ptr [RAX + 0x10],EDX NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Filter::get_response(float, Filter::Coeffs*) * ;************************************************************************************************************************************************************ ;undefined get_response(float param_1, Coeffs * param_2) ;param_1 float XMM0_Da ;param_2 Coeffs * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_14 undefined4 -14 ;local_18 undefined4 -18 ;local_20 undefined8 -20 ;local_24 undefined4 -24 ;local_30 undefined8 -30 PUSH RBP
void Filter::set_stages(int p_stages) { //adjust for multiple stages stages = p_stages; }
void set_response(int val) { m_response = val; }
;************************************************************************************************************************************************************ ;* Filter::set_sampling_rate(float) * ;************************************************************************************************************************************************************ ;undefined set_sampling_rate(Filter * this, float param_1) ;this Filter * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0xc],param_1 NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Filter::prepare_coefficients(Filter::Coeffs*) * ;************************************************************************************************************************************************************ ;undefined prepare_coefficients(Filter * this, Coeffs * param_1) ;this Filter * RDI ;param_1 Coeffs * RSI ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined8 -40 ;local_48 undefined8 -48 ;local_4c undefined4 -4c ;local_58 undefined8 -58 ;local_60 undefined8 -60 ;local_68 undefined8 -68 ;local_70 undefined8 -70 ;local_78 undefined8 -78 ;local_80 undefined8 -80 ;local_88 undefined8 -88 ;local_90 undefined8 -90 ;local_98 undefined8 -98 ;local_a0 undefined8 -a0 ;local_a8 undefined8 -a8 ;local_b0 undefined8 -b0 ;local_b8 undefined8 -b8 PUSH RBP
void Filter::set_sampling_rate(float p_srate) { sampling_rate = p_srate; }
void floatFilter::set_filter(float f) { filter = f; }
;************************************************************************************************************************************************************ ;* Filter::set_gain(float) * ;************************************************************************************************************************************************************ ;undefined set_gain(Filter * this, float param_1) ;this Filter * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x8],param_1 NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Filter::set_sampling_rate(float) * ;************************************************************************************************************************************************************ ;undefined set_sampling_rate(Filter * this, float param_1) ;this Filter * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP
void Filter::set_gain(float p_gain) { gain = p_gain; }
void float::set_filter(float val) { m_filter = val; }
;************************************************************************************************************************************************************ ;* Filter::set_resonance(float) * ;************************************************************************************************************************************************************ ;undefined set_resonance(Filter * this, float param_1) ;this Filter * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x4],param_1 NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Filter::set_gain(float) * ;************************************************************************************************************************************************************ ;undefined set_gain(Filter * this, float param_1) ;this Filter * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP
void Filter::set_resonance(float p_resonance) { resonance = p_resonance; }
void float::set_filter(float _filter) { _filter = _filter; }
;************************************************************************************************************************************************************ ;* Filter::set_cutoff(float) * ;************************************************************************************************************************************************************ ;undefined set_cutoff(Filter * this, float param_1) ;this Filter * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX],param_1 NOP POP RBP RET ?? 90h
void Filter::set_cutoff(float p_cutoff) { cutoff = p_cutoff; }
void float::set(float f) { m_f = f; }
;************************************************************************************************************************************************************ ;* Filter::set_mode(Filter::Mode) * ;************************************************************************************************************************************************************ ;undefined set_mode(Filter * this, Mode param_1) ;this Filter * RDI ;param_1 Mode ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV EDX,dword ptr [RBP + local_14+0x8] MOV dword ptr [RAX + 0x14],EDX NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Filter::set_cutoff(float) * ;************************************************************************************************************************************************************ ;undefined set_cutoff(Filter * this, float param_1) ;this Filter * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP
void Filter::set_mode(Mode p_mode) { mode = p_mode; }
void setMode(float value) { _mode = value; }
;************************************************************************************************************************************************************ ;* UndoRedo::set_action_callback(void (*)(String const&, void*), void*) * ;************************************************************************************************************************************************************ ;undefined set_action_callback(UndoRedo * this, FuncDef239 * param_1, void * param_2) ;this UndoRedo * RDI ;param_1 FuncDef239 * RSI ;param_2 void * RDX ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV qword ptr [RBP + local_18+0x8],param_1 MOV qword ptr [RBP + local_20+0x8],param_2 MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_2,qword ptr [RBP + local_18+0x8] MOV qword ptr [RAX + 0x18],param_2 MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_2,qword ptr [RBP + local_20+0x8] MOV qword ptr [RAX + 0x20],param_2 NOP POP RBP RET ?? 90h
void UndoRedo::set_action_callback(ActionCallback p_action_callback, void *p_action_callback_userdata) { action_callback = p_action_callback; action_callback_userdata = p_action_callback_userdata; }
void action_callback_callback (void *ptr, void *data) { ptr = ptr; ptr = data; }
;************************************************************************************************************************************************************ ;* UndoRedo::clean() * ;************************************************************************************************************************************************************ ;undefined clean(UndoRedo * this) ;this UndoRedo * RDI ;local_c undefined4 -c ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_002488fd LAB_002488cf: MOV RAX,qword ptr [RBP + local_20+0x8] MOV EDX,dword ptr [RBP + local_c+0x8] MOV ESI,EDX MOV this,RAX CALL Vector<UndoRedo::Group*>::operator[] ;undefined operator[](Vector<UndoRedo... MOV RSI,qword ptr [RAX] MOV RAX,qword ptr [RBP + local_20+0x8] MOV ECX,0x1 MOV EDX,0x0 MOV this,RAX CALL UndoRedo::_delete_group ;undefined _delete_group(UndoRedo * t... ADD dword ptr [RBP + local_c+0x8],0x1 LAB_002488fd: MOV RAX,qword ptr [RBP + local_20+0x8] MOV this,RAX CALL Vector<UndoRedo::Group*>::size ;undefined size(Vector<UndoRedo::Grou... CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_002488cf MOV RAX,qword ptr [RBP + local_20+0x8] MOV this,RAX CALL Vector<UndoRedo::Group*>::clear ;undefined clear(Vector<UndoRedo::Gro... MOV RAX,qword ptr [RBP + local_20+0x8] MOV dword ptr [RAX + 0x10],0x0 MOV RAX,qword ptr [RBP + local_20+0x8] MOV dword ptr [RAX + 0x14],0x0 NOP LEAVE RET ;************************************************************************************************************************************************************ ;* UndoRedo::set_action_callback(void (*)(String const&, void*), void*) * ;************************************************************************************************************************************************************ ;undefined set_action_callback(UndoRedo * this, FuncDef239 * param_1, void * param_2) ;this UndoRedo * RDI ;param_1 FuncDef239 * RSI ;param_2 void * RDX ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 PUSH RBP
void UndoRedo::clean() { for (int i = 0; i < group_list.size(); i++) { _delete_group(group_list[i], false, true); } group_list.clear(); current_group = 0; group_rc = 0; }
void Group::clear_group(void) { for (int i = 0; i < _group.size(); i++) { _group[i]->clear(); } _group.clear(); }
;************************************************************************************************************************************************************ ;* UndoRedo::get_current_version() * ;************************************************************************************************************************************************************ ;undefined get_current_version(UndoRedo * this) ;this UndoRedo * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x10] POP RBP RET ?? 90h
int UndoRedo::get_current_version() { return current_group; }
int get_current_version() { return current_version; }
;************************************************************************************************************************************************************ ;* UndoRedo::commit_action() * ;************************************************************************************************************************************************************ ;undefined commit_action(UndoRedo * this) ;this UndoRedo * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x14] TEST EAX,EAX JG LAB_0024862c LEA RAX,[.rodata:s__***_ERROR_***_00285c80] ;= " *** ERROR *** " MOV RSI=>.rodata:s__***_ERROR_***_00285c80,RAX ;= " *** ERROR *** " LEA RAX,[.bss:std::cout] MOV this=>.bss:std::cout,RAX CALL .plt:<EXTERNAL>::std::operator<< ;basic_ostream * operator<<(basic_ost... MOV RDX,RAX LEA RAX,[.rodata:s_engine/undo_redo.cpp_00285c90] ;= "engine/undo_redo.cpp" MOV RSI=>.rodata:s_engine/undo_redo.cpp_00285c90,RAX ;= "engine/undo_redo.cpp" MOV this,RDX CALL .plt:<EXTERNAL>::std::operator<< ;basic_ostream * operator<<(basic_ost... MOV RDX,RAX LEA RAX,[.rodata:DAT_00285ca5] ;= 3Ah : MOV RSI=>.rodata:DAT_00285ca5,RAX ;= 3Ah : MOV this,RDX CALL .plt:<EXTERNAL>::std::operator<< ;basic_ostream * operator<<(basic_ost... MOV ESI,0x4c MOV this,RAX CALL .plt:<EXTERNAL>::std::basic_ostream<char,std::char_traits<char>>::operator<< ;undefined operator<<(basic_ostream<c... MOV RDX,RAX LEA RAX,[.rodata:DAT_00285ca7] ;= 20h MOV RSI=>.rodata:DAT_00285ca7,RAX ;= 20h MOV this,RDX CALL .plt:<EXTERNAL>::std::operator<< ;basic_ostream * operator<<(basic_ost... MOV RDX,RAX LEA RAX,[.rodata:s_group_rc_<=_0_failed._00285cab] ;= "group_rc <= 0 failed." MOV RSI=>.rodata:s_group_rc_<=_0_failed._00285cab,RAX ;= "group_rc <= 0 failed." MOV this,RDX CALL .plt:<EXTERNAL>::std::operator<< ;basic_ostream * operator<<(basic_ost... MOV RDX=>EXTERNAL:<EXTERNAL>::std::endl<char,std::...,qword ptr [-><EXTERNAL>::std::endl<char,std::ch...;= 002e3ca0 ;=?? MOV RSI=>EXTERNAL:<EXTERNAL>::std::endl<char,std::char_traits<char>>,RDX ;=?? MOV this,RAX CALL .plt:<EXTERNAL>::std::basic_ostream<char,std::char_traits<char>>::operator<< ;undefined operator<<(basic_ostream<c... CALL _error_break_function ;undefined _error_break_function(void) JMP LAB_00248657 LAB_0024862c: MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x14] LEA EDX,[RAX + -0x1] MOV RAX,qword ptr [RBP + local_10+0x8] MOV dword ptr [RAX + 0x14],EDX MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x14] TEST EAX,EAX JG LAB_00248656 MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL UndoRedo::redo ;undefined redo(UndoRedo * this) JMP LAB_00248657 LAB_00248656: NOP LAB_00248657: LEAVE RET ?? 90h
void UndoRedo::commit_action() { ERR_FAIL_COND(group_rc <= 0); group_rc--; if (group_rc > 0) { return; } redo(); }
void action::action_group() { std::cout << "action_group: " << std::endl; }
;************************************************************************************************************************************************************ ;* Song::get_peak_volume_db_r() const * ;************************************************************************************************************************************************************ ;undefined get_peak_volume_db_r(Song * this) ;this Song * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV RAX,qword ptr [RBP + local_20+0x8] MOVSS XMM0,dword ptr [RAX + 0x50] MOVSS dword ptr [RBP + local_10+0x8],XMM0 MOV EAX,dword ptr [RBP + local_10+0x8] MOVD XMM0,EAX CALL std::log ;undefined log(float param_1) PXOR XMM1,XMM1 CVTSS2SD XMM1,XMM0 MOVSD XMM0,qword ptr [.rodata:DAT_002865b8] ;= 40215F2CED384F29h MULSD XMM0,XMM1 CVTSD2SS XMM0,XMM0 MOVSS dword ptr [RBP + local_c+0x8],XMM0 MOV RAX,qword ptr [RBP + local_20+0x8] PXOR XMM0,XMM0 MOVSS dword ptr [RAX + 0x50],XMM0 MOVSS XMM0,dword ptr [RBP + local_c+0x8] LEAVE RET ?? 90h
float Song::get_peak_volume_db_r() const { float peak_db = linear2db(peak_volume_r); peak_volume_r = 0; return peak_db; }
float log_r::get_float() const { return log_r->get_float(); }
;************************************************************************************************************************************************************ ;* Song::get_peak_volume_db_l() const * ;************************************************************************************************************************************************************ ;undefined get_peak_volume_db_l(Song * this) ;this Song * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV RAX,qword ptr [RBP + local_20+0x8] MOVSS XMM0,dword ptr [RAX + 0x4c] MOVSS dword ptr [RBP + local_10+0x8],XMM0 MOV EAX,dword ptr [RBP + local_10+0x8] MOVD XMM0,EAX CALL std::log ;undefined log(float param_1) PXOR XMM1,XMM1 CVTSS2SD XMM1,XMM0 MOVSD XMM0,qword ptr [.rodata:DAT_002865b8] ;= 40215F2CED384F29h MULSD XMM0,XMM1 CVTSD2SS XMM0,XMM0 MOVSS dword ptr [RBP + local_c+0x8],XMM0 MOV RAX,qword ptr [RBP + local_20+0x8] PXOR XMM0,XMM0 MOVSS dword ptr [RAX + 0x4c],XMM0 MOVSS XMM0,dword ptr [RBP + local_c+0x8] LEAVE RET ?? 90h
float Song::get_peak_volume_db_l() const { float peak_db = linear2db(peak_volume_l); peak_volume_l = 0; return peak_db; }
float log::get_log_pos() const { return log_pos[0] * log_pos[1] + log_pos[2] * log_pos[3]; }
;************************************************************************************************************************************************************ ;* Song::get_main_volume_db() const * ;************************************************************************************************************************************************************ ;undefined get_main_volume_db(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS XMM0,dword ptr [RAX + 0x48] POP RBP RET ?? 90h
float Song::get_main_volume_db() const { return main_volume_db; }
float S_main::get_main_db() const { return m_main_db; }
;************************************************************************************************************************************************************ ;* Song::set_main_volume_db(float) * ;************************************************************************************************************************************************************ ;undefined set_main_volume_db(Song * this, float param_1) ;this Song * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x48],param_1 NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Song::get_main_volume_db() const * ;************************************************************************************************************************************************************ ;undefined get_main_volume_db(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP
void Song::set_main_volume_db(float p_db) { main_volume_db = p_db; }
void set_main_db::set_value(const float value) { m_value = value; }
;************************************************************************************************************************************************************ ;* Song::clear() * ;************************************************************************************************************************************************************ ;undefined clear(Song * this) ;this Song * RDI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_30 undefined8 -30 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV dword ptr [RBP + local_1c+0x8],0x0 JMP LAB_0025a158 LAB_0025a122: MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_1c+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RBX,qword ptr [RAX] TEST RBX,RBX JZ LAB_0025a154 MOV this,RBX CALL Track::~Track ;undefined ~Track(Track * this) MOV ESI,0x200e8 MOV this,RBX CALL .plt:<EXTERNAL>::operator.delete ;void operator.delete(void * param_1,... LAB_0025a154: ADD dword ptr [RBP + local_1c+0x8],0x1 LAB_0025a158: MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_1c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_0025a122 MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::clear ;undefined clear(Vector<Track*> * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOVSS XMM0,dword ptr [.rodata:DAT_002865b4] ;= 42FA0000h MOVSS dword ptr [RAX + 0x40],XMM0 MOV RAX,qword ptr [RBP + local_30+0x8] PXOR XMM0,XMM0 MOVSS dword ptr [RAX + 0x44],XMM0 MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x58 LEA RDX,[.rodata:DAT_00286405] MOV RSI=>.rodata:DAT_00286405,RDX MOV this,RAX CALL String::operator= ;undefined operator=(String * this, c... MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x60 LEA RDX,[.rodata:DAT_00286405] MOV RSI=>.rodata:DAT_00286405,RDX MOV this,RAX CALL String::operator= ;undefined operator=(String * this, c... MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x68 LEA RDX,[.rodata:DAT_00286405] MOV RSI=>.rodata:DAT_00286405,RDX MOV this,RAX CALL String::operator= ;undefined operator=(String * this, c... MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x18 MOV this,RAX CALL Map<int,int>::clear ;undefined clear(Map<int,int> * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOV this,RAX CALL Map<int,Song::PatternConfig>::clear ;undefined clear(Map<int,Song::Patter... MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x88 MOV this,RAX CALL Vector<int>::clear ;undefined clear(Vector<int> * this) NOP MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::clear() { for (int i = 0; i < tracks.size(); i++) delete tracks[i]; tracks.clear(); bpm = DEFAULT_BPM; swing = 0; name = ""; author = ""; description = ""; order_list.clear(); pattern_config.clear(); track_process_order.clear(); }
void RVector::clear() { int i; for (i = 0; i < m_size; i++) { m_size[i] = 0; m_size[i] = 0; } m_size[i] = 0; m_size[i] = 0; m_size[i] = 0; }
;************************************************************************************************************************************************************ ;* Song::get_playing_tick() const * ;************************************************************************************************************************************************************ ;undefined get_playing_tick(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0xa0] TEST AL,AL JZ LAB_0025a104 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSD XMM0,qword ptr [RAX + 0xb0] COMISD XMM0,qword ptr [.rodata:DAT_00286588] ;= 43E0000000000000h JNC LAB_0025a0e4 CVTTSD2SI RAX,XMM0 JMP LAB_0025a109 LAB_0025a0e4: MOVSD XMM1,qword ptr [.rodata:DAT_00286588] ;= 43E0000000000000h SUBSD XMM0,XMM1 CVTTSD2SI RAX,XMM0 MOV RDX,-0x8000000000000000 XOR RAX,RDX JMP LAB_0025a109 LAB_0025a104: MOV EAX,0x0 LAB_0025a109: POP RBP RET ?? 90h
Tick Song::get_playing_tick() const { if (playback.playing) { return playback.pos; } else { return 0; } }
int Smb4::get_len() const { if (m_current == 0) return 0; else return m_current->get_len(); }
;************************************************************************************************************************************************************ ;* Song::get_playing_pattern() const * ;************************************************************************************************************************************************************ ;undefined get_playing_pattern(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0xa0] TEST AL,AL JZ LAB_0025a0a9 MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0xa4] JMP LAB_0025a0ae LAB_0025a0a9: MOV EAX,0xffffffff LAB_0025a0ae: POP RBP RET ;************************************************************************************************************************************************************ ;* Song::get_playing_tick() const * ;************************************************************************************************************************************************************ ;undefined get_playing_tick(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP
int Song::get_playing_pattern() const { if (playback.playing) { return playback.pattern; } else { return -1; } }
int Ssg::get_volume() const { return m_volume? m_volume->volume : -1; }
;************************************************************************************************************************************************************ ;* Song::get_playing_order() const * ;************************************************************************************************************************************************************ ;undefined get_playing_order(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0xa0] TEST AL,AL JZ LAB_0025a07f MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0xa1] XOR EAX,0x1 TEST AL,AL JZ LAB_0025a07f MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0xa8] JMP LAB_0025a084 LAB_0025a07f: MOV EAX,0xffffffff LAB_0025a084: POP RBP RET ;************************************************************************************************************************************************************ ;* Song::get_playing_pattern() const * ;************************************************************************************************************************************************************ ;undefined get_playing_pattern(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP
int Song::get_playing_order() const { if (playback.playing &&!playback.loop_pattern) { return playback.order; } else { return -1; } }
int _order::get_order() const { if (!m_order) return -1; else return m_order->get_order(); }
;************************************************************************************************************************************************************ ;* Song::is_playing() const * ;************************************************************************************************************************************************************ ;undefined is_playing(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0xa0] POP RBP RET ?? 90h
bool Song::is_playing() const { return playback.playing; }
bool Sam::is_end() const { return m_end; }
;************************************************************************************************************************************************************ ;* Song::play_prev_pattern() * ;************************************************************************************************************************************************************ ;undefined play_prev_pattern(Song * this) ;this Song * RDI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_20 undefined4 -20 ;local_21 undefined1 -21 ;local_30 undefined8 -30 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this LEA RAX=>local_21,[RBP + -0x19] MOV this,RAX LAB_00259f58: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOVZX EAX,byte ptr [RAX + 0xa0] XOR EAX,0x1 TEST AL,AL JNZ LAB_00259f7e MOV RAX,qword ptr [RBP + local_30+0x8] MOVZX EAX,byte ptr [RAX + 0xa1] TEST AL,AL JZ LAB_00259f85 LAB_00259f7e: MOV EBX,0x0 JMP LAB_0025a002 LAB_00259f85: MOV RAX,qword ptr [RBP + local_30+0x8] MOV EAX,dword ptr [RAX + 0xa8] MOV dword ptr [RBP + local_1c+0x8],EAX LAB_00259f92: SUB dword ptr [RBP + local_1c+0x8],0x1 CMP dword ptr [RBP + local_1c+0x8],0x0 JNS LAB_00259fa3 MOV EBX,0x0 JMP LAB_0025a002 LAB_00259fa3: MOV EDX,dword ptr [RBP + local_1c+0x8] MOV RAX,qword ptr [RBP + local_30+0x8] MOV ESI,EDX MOV this,RAX ;try { // try from 00259faf to 00259fb3 has its CatchHandler @ 0025a013 LAB_00259faf: CALL Song::order_get ;undefined order_get(Song * this, int... ;} // end try from 00259faf to 00259fb3 MOV dword ptr [RBP + local_20+0x8],EAX CMP dword ptr [RBP + local_20+0x8],0xfffff JNZ LAB_00259fc7 MOV EBX,0x0 JMP LAB_0025a002 LAB_00259fc7: CMP dword ptr [RBP + local_20+0x8],0xffffe JNZ LAB_00259fd2 JMP LAB_00259f92 LAB_00259fd2: NOP MOV RAX,qword ptr [RBP + local_30+0x8] MOV EDX,dword ptr [RBP + local_1c+0x8] MOV dword ptr [RAX + 0xa8],EDX MOV RAX,qword ptr [RBP + local_30+0x8] MOV EDX,dword ptr [RBP + local_20+0x8] MOV dword ptr [RAX + 0xa4],EDX MOV RAX,qword ptr [RBP + local_30+0x8] PXOR XMM0,XMM0 MOVSD qword ptr [RAX + 0xb0],XMM0 MOV EBX,0x1 LAB_0025a002: LEA RAX=>local_21,[RBP + -0x19] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) CMP EBX,0x1 JMP LAB_0025a02d ;catch() {... } // from try @ 00259faf with catch @ 0025a013 LAB_0025a013: MOV RBX,RAX LEA RAX,[RBP + -0x19] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_0025a028: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_0025a02d: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::play_prev_pattern() { _AUDIO_LOCK_ if (!playback.playing || playback.loop_pattern) { return; } int order = playback.order; int pattern; while (true) { order--; if (order < 0) { return; } pattern = order_get(order); if (pattern == ORDER_EMPTY) { return; } else if (pattern!= ORDER_SKIP) { break; } } playback.order = order; playback.pattern = pattern; playback.pos = 0; }
void AudioAudio::get_Lock() { for (int i = 0; i < m_state.size(); i++) { if (m_state[i]->get_Lock()) { m_state[i]->Lock(); } } }
;************************************************************************************************************************************************************ ;* Song::play_next_pattern() * ;************************************************************************************************************************************************************ ;undefined play_next_pattern(Song * this) ;this Song * RDI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_20 undefined4 -20 ;local_21 undefined1 -21 ;local_30 undefined8 -30 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this LEA RAX=>local_21,[RBP + -0x19] MOV this,RAX LAB_00259e62: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOVZX EAX,byte ptr [RAX + 0xa0] XOR EAX,0x1 TEST AL,AL JNZ LAB_00259e88 MOV RAX,qword ptr [RBP + local_30+0x8] MOVZX EAX,byte ptr [RAX + 0xa1] TEST AL,AL JZ LAB_00259e92 LAB_00259e88: MOV EBX,0x0 JMP LAB_00259f12 LAB_00259e92: MOV RAX,qword ptr [RBP + local_30+0x8] MOV EAX,dword ptr [RAX + 0xa8] MOV dword ptr [RBP + local_1c+0x8],EAX LAB_00259e9f: ADD dword ptr [RBP + local_1c+0x8],0x1 CMP dword ptr [RBP + local_1c+0x8],0x3e7 JLE LAB_00259eb3 MOV EBX,0x0 JMP LAB_00259f12 LAB_00259eb3: MOV EDX,dword ptr [RBP + local_1c+0x8] MOV RAX,qword ptr [RBP + local_30+0x8] MOV ESI,EDX MOV this,RAX ;try { // try from 00259ebf to 00259ec3 has its CatchHandler @ 00259f23 LAB_00259ebf: CALL Song::order_get ;undefined order_get(Song * this, int... ;} // end try from 00259ebf to 00259ec3 MOV dword ptr [RBP + local_20+0x8],EAX CMP dword ptr [RBP + local_20+0x8],0xfffff JNZ LAB_00259ed7 MOV EBX,0x0 JMP LAB_00259f12 LAB_00259ed7: CMP dword ptr [RBP + local_20+0x8],0xffffe JNZ LAB_00259ee2 JMP LAB_00259e9f LAB_00259ee2: NOP MOV RAX,qword ptr [RBP + local_30+0x8] MOV EDX,dword ptr [RBP + local_1c+0x8] MOV dword ptr [RAX + 0xa8],EDX MOV RAX,qword ptr [RBP + local_30+0x8] MOV EDX,dword ptr [RBP + local_20+0x8] MOV dword ptr [RAX + 0xa4],EDX MOV RAX,qword ptr [RBP + local_30+0x8] PXOR XMM0,XMM0 MOVSD qword ptr [RAX + 0xb0],XMM0 MOV EBX,0x1 LAB_00259f12: LEA RAX=>local_21,[RBP + -0x19] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) CMP EBX,0x1 JMP LAB_00259f3d ;catch() {... } // from try @ 00259ebf with catch @ 00259f23 LAB_00259f23: MOV RBX,RAX LEA RAX,[RBP + -0x19] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_00259f38: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_00259f3d: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::play_next_pattern() { _AUDIO_LOCK_ if (!playback.playing || playback.loop_pattern) { return; } int order = playback.order; int pattern; while (true) { order++; if (order > ORDER_MAX) { return; } pattern = order_get(order); if (pattern == ORDER_EMPTY) { return; } else if (pattern!= ORDER_SKIP) { break; } } playback.order = order; playback.pattern = pattern; playback.pos = 0; }
void AudioAudio::get_play() { int i; for (i = 0; i < _play; i++) { _play[i] = _play[i]; } _play[i] = 0; _play[i] = 0; }
;************************************************************************************************************************************************************ ;* Song::stop() * ;************************************************************************************************************************************************************ ;undefined stop(Song * this) ;this Song * RDI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_1d undefined1 -1d ;local_30 undefined8 -30 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this LEA RAX=>local_1d,[RBP + -0x15] MOV this,RAX LAB_00259db2: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOV byte ptr [RAX + 0xa0],0x0 MOV RAX,qword ptr [RBP + local_30+0x8] MOV byte ptr [RAX + 0xc4],0x1 MOV RAX,qword ptr [RBP + local_30+0x8] MOV this,RAX ;try { // try from 00259dd4 to 00259e01 has its CatchHandler @ 00259e2e LAB_00259dd4: CALL Song::_restore_automations ;undefined _restore_automations(Song... MOV dword ptr [RBP + local_1c+0x8],0x0 JMP LAB_00259e06 LAB_00259de2: MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_1c+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::stop ;undefined stop(Track * this) ;} // end try from 00259dd4 to 00259e01 ADD dword ptr [RBP + local_1c+0x8],0x1 LAB_00259e06: MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_1c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00259de2 LEA RAX=>local_1d,[RBP + -0x15] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) JMP LAB_00259e48 ;catch() {... } // from try @ 00259dd4 with catch @ 00259e2e LAB_00259e2e: MOV RBX,RAX LEA RAX,[RBP + -0x15] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_00259e43: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_00259e48: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* Song::play_next_pattern() * ;************************************************************************************************************************************************************ ;undefined play_next_pattern(Song * this) ;this Song * RDI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_20 undefined4 -20 ;local_21 undefined1 -21 ;local_30 undefined8 -30 PUSH RBP
void Song::stop() { _AUDIO_LOCK_ playback.playing = false; playback.can_loop = true; //important, restore before stopping because stopping may call reset, which may still //restore to an own value/ _restore_automations(); for (int i = 0; i < tracks.size(); i++) { tracks[i]->stop(); } }
void Audio::stop() { stop(); stop(); }
;************************************************************************************************************************************************************ ;* Song::play_single_event(int, AudioEffect::Event const&) * ;************************************************************************************************************************************************************ ;undefined play_single_event(Song * this, int param_1, Event * param_2) ;this Song * RDI ;param_1 int ESI ;param_2 Event * RDX ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_34 undefined4 -34 ;local_40 undefined8 -40 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x38 MOV qword ptr [RBP + local_30+0x8],this MOV dword ptr [RBP + local_34+0x8],param_1 MOV qword ptr [RBP + local_40+0x8],param_2 LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOV EAX,dword ptr [RAX + 0x50e8] CMP EAX,0x400 JNZ LAB_00259ccd MOV EBX,0x0 JMP LAB_00259d88 LAB_00259ccd: CMP dword ptr [RBP + local_34+0x8],0x0 JS LAB_00259ce8 MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_34+0x8],EAX JL LAB_00259cef LAB_00259ce8: MOV EAX,0x1 JMP LAB_00259cf4 LAB_00259cef: MOV EAX,0x0 LAB_00259cf4: TEST AL,AL JZ LAB_00259d02 MOV EBX,0x0 JMP LAB_00259d88 LAB_00259d02: MOV RAX,qword ptr [RBP + local_30+0x8] MOV EAX,dword ptr [RAX + 0x50e8] MOV RCX,qword ptr [RBP + local_30+0x8] MOVSXD param_2,EAX MOV RAX,param_2 SHL RAX,0x2 ADD RAX,param_2 SHL RAX,0x2 ADD RAX,RCX LEA RCX,[RAX + 0xe0] MOV RAX,qword ptr [RBP + local_40+0x8] MOV param_2,qword ptr [RAX + 0x8] MOV RAX,qword ptr [RAX] MOV qword ptr [RCX + 0xc],RAX MOV qword ptr [RCX + 0x14],param_2 MOV RAX,qword ptr [RBP + local_30+0x8] MOV EAX,dword ptr [RAX + 0x50e8] MOV RCX,qword ptr [RBP + local_30+0x8] MOVSXD param_2,EAX MOV RAX,param_2 SHL RAX,0x2 ADD RAX,param_2 SHL RAX,0x2 ADD RAX,RCX LEA param_2,[RAX + 0xe8] MOV EAX,dword ptr [RBP + local_34+0x8] MOV dword ptr [param_2],EAX MOV RAX,qword ptr [RBP + local_30+0x8] MOV EAX,dword ptr [RAX + 0x50e8] LEA param_2,[RAX + 0x1] MOV RAX,qword ptr [RBP + local_30+0x8] MOV dword ptr [RAX + 0x50e8],param_2 MOV EBX,0x1 LAB_00259d88: LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) CMP EBX,0x1 MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::play_single_event(int p_track, const AudioEffect::Event &p_event) { _AUDIO_LOCK_ if (playback.single_event_count == SINGLE_EVENT_MAX) { return; } if (p_track < 0 || p_track >= tracks.size()) { return; } playback.single_event[playback.single_event_count].event = p_event; playback.single_event[playback.single_event_count].track = p_track; playback.single_event_count++; }
bool AudioEvent::event(int eventId, int eventId) const { for (int i = 0; i < m_event.size(); i++) { if (m_event[i].eventId == eventId) return true; } return false; }
;************************************************************************************************************************************************************ ;* Song::can_play() const * ;************************************************************************************************************************************************************ ;undefined can_play(Song * this) ;this Song * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 LAB_00259907: MOV EDX,dword ptr [RBP + local_c+0x8] MOV RAX,qword ptr [RBP + local_20+0x8] MOV ESI,EDX MOV this,RAX CALL Song::order_get ;undefined order_get(Song * this, int... MOV dword ptr [RBP + local_10+0x8],EAX CMP dword ptr [RBP + local_10+0x8],0xfffff JNZ LAB_0025992b MOV EAX,0x0 JMP LAB_00259950 LAB_0025992b: CMP dword ptr [RBP + local_c+0x8],0x3e7 JLE LAB_0025993b MOV EAX,0x0 JMP LAB_00259950 LAB_0025993b: CMP dword ptr [RBP + local_10+0x8],0xffffe JNZ LAB_0025994a ADD dword ptr [RBP + local_c+0x8],0x1 JMP LAB_00259907 LAB_0025994a: NOP MOV EAX,0x1 LAB_00259950: LEAVE RET ;************************************************************************************************************************************************************ ;* Song::play(int, unsigned long, bool) * ;************************************************************************************************************************************************************ ;undefined play(Song * this, int param_1, ulong param_2, bool param_3) ;this Song * RDI ;param_1 int ESI ;param_2 ulong RDX ;param_3 bool CL ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_1d undefined1 -1d ;local_30 undefined8 -30 ;local_34 undefined4 -34 ;local_38 undefined1 -38 ;local_40 undefined8 -40 PUSH RBP
bool Song::can_play() const { int from_order = 0; while (true) { int order = order_get(from_order); if (order == ORDER_EMPTY) { return false; //nothing to play } if (from_order > ORDER_MAX) { return false; } if (order!= ORDER_SKIP) { break; } from_order++; } return true; }
void SState::can_play(int n) const { for (int i = 0; i < n; i++) { if (n == 0) { break; } } }
;************************************************************************************************************************************************************ ;* Song::_restore_automations() * ;************************************************************************************************************************************************************ ;undefined _restore_automations(Song * this) ;this Song * RDI ;local_c undefined4 -c ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_002598d5 LAB_002598b1: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::automations_pre_play_restore ;undefined automations_pre_play_resto... ADD dword ptr [RBP + local_c+0x8],0x1 LAB_002598d5: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_002598b1 NOP NOP LEAVE RET ?? 90h
void Song::_restore_automations() { for (int i = 0; i < tracks.size(); i++) { tracks[i]->automations_pre_play_restore(); } }
void Track::play_pos() { for (int i = 0; i < _size; i++) { _size[i] = 0; } }
;************************************************************************************************************************************************************ ;* Song::_pre_capture_automations() * ;************************************************************************************************************************************************************ ;undefined _pre_capture_automations(Song * this) ;this Song * RDI ;local_c undefined4 -c ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_0025987d LAB_00259859: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::automations_pre_play_capture ;undefined automations_pre_play_captu... ADD dword ptr [RBP + local_c+0x8],0x1 LAB_0025987d: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00259859 NOP NOP LEAVE RET ?? 90h
void Song::_pre_capture_automations() { for (int i = 0; i < tracks.size(); i++) { tracks[i]->automations_pre_play_capture(); } }
void Track::pre_pre_pre_pre_pre() { for (int i = 0; i < _pre_pre_pre_pre_pre_pre_pre; i++) { pre_pre_pre_pre_pre_pre_pre[i]->pre_pre_pre_pre_pre(); } }
;************************************************************************************************************************************************************ ;* Song::set_sampling_rate(int) * ;************************************************************************************************************************************************************ ;undefined set_sampling_rate(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_1d undefined1 -1d ;local_30 undefined8 -30 ;local_34 undefined4 -34 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV dword ptr [RBP + local_34+0x8],param_1 LEA RAX=>local_1d,[RBP + -0x15] MOV this,RAX LAB_002597b7: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOV EDX,dword ptr [RBP + local_34+0x8] MOV dword ptr [RAX + 0x98],EDX MOV dword ptr [RBP + local_1c+0x8],0x0 JMP LAB_002597fb LAB_002597d2: MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_1c+0x8] MOV param_1,EAX MOV this,RDX ;try { // try from 002597e2 to 002597f6 has its CatchHandler @ 00259823 LAB_002597e2: CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV EDX,dword ptr [RBP + local_34+0x8] MOV param_1,EDX MOV this,RAX CALL Track::set_sampling_rate ;undefined set_sampling_rate(Track *... ;} // end try from 002597e2 to 002597f6 ADD dword ptr [RBP + local_1c+0x8],0x1 LAB_002597fb: MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_1c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_002597d2 LEA RAX=>local_1d,[RBP + -0x15] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) JMP LAB_0025983d ;catch() {... } // from try @ 002597e2 with catch @ 00259823 LAB_00259823: MOV RBX,RAX LEA RAX,[RBP + -0x15] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_00259838: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_0025983d: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::set_sampling_rate(int p_hz) { _AUDIO_LOCK_ sampling_rate = p_hz; for (int i = 0; i < tracks.size(); i++) { tracks[i]->set_sampling_rate(p_hz); } }
void Audio::set_size(int size) { for (int i = 0; i < size; i++) { _lock[i]->set_size(size); } }
;************************************************************************************************************************************************************ ;* Song::get_description() const * ;************************************************************************************************************************************************************ ;undefined get_description(void) ;local_10 undefined8 -10 ;local_18 undefined8 -18 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],RDI MOV qword ptr [RBP + local_18+0x8],RSI MOV RAX,qword ptr [RBP + local_18+0x8] LEA RDX,[RAX + 0x68] MOV RAX,qword ptr [RBP + local_10+0x8] MOV RSI,RDX MOV RDI,RAX CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
String Song::get_description() const { return description; }
String String::get_description() const { return m_description; }
;************************************************************************************************************************************************************ ;* Song::set_description(String) * ;************************************************************************************************************************************************************ ;undefined set_description(Song * this, String param_1) ;this Song * RDI ;param_1 String SIL ;local_10 undefined8 -10 ;local_20 undefined1 -20 ;local_30 undefined8 -30 ;local_38 undefined8 -38 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV qword ptr [RBP + local_38+0x8],param_1 MOV RDX,qword ptr [RBP + local_38+0x8] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RDX MOV this,RAX LAB_00259617: CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x68] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RAX MOV this,RDX ;try { // try from 0025962e to 00259632 has its CatchHandler @ 00259641 LAB_0025962e: CALL String::operator= ;undefined operator=(String * this, S... ;} // end try from 0025962e to 00259632 LEA RAX=>local_20,[RBP + -0x18] MOV this,RAX CALL String::~String ;undefined ~String(String * this) JMP LAB_0025965b ;catch() {... } // from try @ 0025962e with catch @ 00259641 LAB_00259641: MOV RBX,RAX LEA RAX,[RBP + -0x18] MOV RDI,RAX CALL String::~String ;undefined ~String(String * this) MOV RAX,RBX MOV RDI,RAX LAB_00259656: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_0025965b: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::set_description(String p_description) { description = p_description; }
String String::set_name(String name) { _name = name; return name; }
;************************************************************************************************************************************************************ ;* Song::get_author() const * ;************************************************************************************************************************************************************ ;undefined get_author(void) ;local_10 undefined8 -10 ;local_18 undefined8 -18 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],RDI MOV qword ptr [RBP + local_18+0x8],RSI MOV RAX,qword ptr [RBP + local_18+0x8] LEA RDX,[RAX + 0x60] MOV RAX,qword ptr [RBP + local_10+0x8] MOV RSI,RDX MOV RDI,RAX CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
String Song::get_author() const { return author; }
String String String::get_text() const { return m_text; }
;************************************************************************************************************************************************************ ;* Song::set_author(String) * ;************************************************************************************************************************************************************ ;undefined set_author(Song * this, String param_1) ;this Song * RDI ;param_1 String SIL ;local_10 undefined8 -10 ;local_20 undefined1 -20 ;local_30 undefined8 -30 ;local_38 undefined8 -38 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV qword ptr [RBP + local_38+0x8],param_1 MOV RDX,qword ptr [RBP + local_38+0x8] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RDX MOV this,RAX LAB_0025957f: CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x60] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RAX MOV this,RDX ;try { // try from 00259596 to 0025959a has its CatchHandler @ 002595a9 LAB_00259596: CALL String::operator= ;undefined operator=(String * this, S... ;} // end try from 00259596 to 0025959a LEA RAX=>local_20,[RBP + -0x18] MOV this,RAX CALL String::~String ;undefined ~String(String * this) JMP LAB_002595c3 ;catch() {... } // from try @ 00259596 with catch @ 002595a9 LAB_002595a9: MOV RBX,RAX LEA RAX,[RBP + -0x18] MOV RDI,RAX CALL String::~String ;undefined ~String(String * this) MOV RAX,RBX MOV RDI,RAX LAB_002595be: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_002595c3: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::set_author(String p_author) { author = p_author; }
void String::set(String s) { _s = s; }
;************************************************************************************************************************************************************ ;* Song::get_name() const * ;************************************************************************************************************************************************************ ;undefined get_name(void) ;local_10 undefined8 -10 ;local_18 undefined8 -18 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],RDI MOV qword ptr [RBP + local_18+0x8],RSI MOV RAX,qword ptr [RBP + local_18+0x8] LEA RDX,[RAX + 0x58] MOV RAX,qword ptr [RBP + local_10+0x8] MOV RSI,RDX MOV RDI,RAX CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
String Song::get_name() const { return name; }
String String::get_name() const { return name.c_str(); }
;************************************************************************************************************************************************************ ;* Song::set_name(String) * ;************************************************************************************************************************************************************ ;undefined set_name(Song * this, String param_1) ;this Song * RDI ;param_1 String SIL ;local_10 undefined8 -10 ;local_20 undefined1 -20 ;local_30 undefined8 -30 ;local_38 undefined8 -38 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV qword ptr [RBP + local_38+0x8],param_1 MOV RDX,qword ptr [RBP + local_38+0x8] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RDX MOV this,RAX LAB_002594e7: CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x58] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RAX MOV this,RDX ;try { // try from 002594fe to 00259502 has its CatchHandler @ 00259511 LAB_002594fe: CALL String::operator= ;undefined operator=(String * this, S... ;} // end try from 002594fe to 00259502 LEA RAX=>local_20,[RBP + -0x18] MOV this,RAX CALL String::~String ;undefined ~String(String * this) JMP LAB_0025952b ;catch() {... } // from try @ 002594fe with catch @ 00259511 LAB_00259511: MOV RBX,RAX LEA RAX,[RBP + -0x18] MOV RDI,RAX CALL String::~String ;undefined ~String(String * this) MOV RAX,RBX MOV RDI,RAX LAB_00259526: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_0025952b: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::set_name(String p_name) { name = p_name; }
void String::set_name(String name) { _name = name; }
;************************************************************************************************************************************************************ ;* Song::get_swing() const * ;************************************************************************************************************************************************************ ;undefined get_swing(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS XMM0,dword ptr [RAX + 0x44] POP RBP RET ?? 90h
float Song::get_swing() const { return swing; }
float Sing::get_end() const { return m_end; }
;************************************************************************************************************************************************************ ;* Song::set_swing(float) * ;************************************************************************************************************************************************************ ;undefined set_swing(Song * this, float param_1) ;this Song * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x44],param_1 NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Song::get_swing() const * ;************************************************************************************************************************************************************ ;undefined get_swing(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP
void Song::set_swing(float p_value) { swing = p_value; }
void Sing::set_zero(float p_zero) { zero = p_zero; }
;************************************************************************************************************************************************************ ;* Song::get_bpm() const * ;************************************************************************************************************************************************************ ;undefined get_bpm(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS XMM0,dword ptr [RAX + 0x40] POP RBP RET ?? 90h
float Song::get_bpm() const { return bpm; }
float S::get_pos() const { return m_pos; }
;************************************************************************************************************************************************************ ;* Song::set_bpm(float) * ;************************************************************************************************************************************************************ ;undefined set_bpm(Song * this, float param_1) ;this Song * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x40],param_1 NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Song::get_bpm() const * ;************************************************************************************************************************************************************ ;undefined get_bpm(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP
void Song::set_bpm(float p_value) { bpm = p_value; }
void Ssg::set_pos(float p_pos) { m_pos = p_pos; }
;************************************************************************************************************************************************************ ;* Song::get_event_column_note_column(int) const * ;************************************************************************************************************************************************************ ;undefined get_event_column_note_column(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_c undefined4 -c ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_00258bea LAB_00258b63: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_event_column_count ;undefined get_event_column_count(Tra... CMP dword ptr [RBP + local_24+0x8],EAX SETL AL TEST AL,AL JZ LAB_00258bc3 MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_column_count ;undefined get_column_count(Track * t... CMP dword ptr [RBP + local_24+0x8],EAX SETL AL TEST AL,AL JZ LAB_00258bbc MOV EAX,dword ptr [RBP + local_24+0x8] JMP LAB_00258c0d LAB_00258bbc: MOV EAX,0xffffffff JMP LAB_00258c0d LAB_00258bc3: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_event_column_count ;undefined get_event_column_count(Tra... SUB dword ptr [RBP + local_24+0x8],EAX ADD dword ptr [RBP + local_c+0x8],0x1 LAB_00258bea: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00258b63 MOV EAX,0xffffffff LAB_00258c0d: LEAVE RET ?? 90h
int Song::get_event_column_note_column(int p_column) const { for (int i = 0; i < tracks.size(); i++) { if (p_column < tracks[i]->get_event_column_count()) { if (p_column < tracks[i]->get_column_count()) { return p_column; } else { return -1; } } p_column -= tracks[i]->get_event_column_count(); } return -1; }
int get_column_count(int index) const { int count = 0; for (int i = 0; i < count; i++) { if (column_column[i].get_column_count(index)) count++; } return count; }
;************************************************************************************************************************************************************ ;* Song::get_event_column_event(int) const * ;************************************************************************************************************************************************************ ;undefined get_event_column_event(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_c undefined4 -c ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_00258b26 LAB_00258ad0: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_event_column_count ;undefined get_event_column_count(Tra... CMP dword ptr [RBP + local_24+0x8],EAX SETL AL TEST AL,AL JZ LAB_00258aff MOV EAX,dword ptr [RBP + local_24+0x8] JMP LAB_00258b45 LAB_00258aff: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_event_column_count ;undefined get_event_column_count(Tra... SUB dword ptr [RBP + local_24+0x8],EAX ADD dword ptr [RBP + local_c+0x8],0x1 LAB_00258b26: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00258ad0 MOV EAX,0xffffffff LAB_00258b45: LEAVE RET ?? 90h
int Song::get_event_column_event(int p_column) const { for (int i = 0; i < tracks.size(); i++) { if (p_column < tracks[i]->get_event_column_count()) { return p_column; } p_column -= tracks[i]->get_event_column_count(); } return -1; }
int get_column_count(int index) const { int count = 0; for (int i = 0; i < count; i++) { if (m_column[i].get_count(index)) count++; } return count; }
;************************************************************************************************************************************************************ ;* Song::get_event_column_track(int) const * ;************************************************************************************************************************************************************ ;undefined get_event_column_track(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_c undefined4 -c ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_00258a96 LAB_00258a40: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_event_column_count ;undefined get_event_column_count(Tra... CMP dword ptr [RBP + local_24+0x8],EAX SETL AL TEST AL,AL JZ LAB_00258a6f MOV EAX,dword ptr [RBP + local_c+0x8] JMP LAB_00258ab5 LAB_00258a6f: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_event_column_count ;undefined get_event_column_count(Tra... SUB dword ptr [RBP + local_24+0x8],EAX ADD dword ptr [RBP + local_c+0x8],0x1 LAB_00258a96: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00258a40 MOV EAX,0xffffffff LAB_00258ab5: LEAVE RET ?? 90h
int Song::get_event_column_track(int p_column) const { for (int i = 0; i < tracks.size(); i++) { if (p_column < tracks[i]->get_event_column_count()) { return i; } p_column -= tracks[i]->get_event_column_count(); } return -1; }
int get_column_count(int index) const { if (index < 0) return -1; if (column_count(column_count(column_count(column_count(column_count(column_count(column_count(column_count(column_count(column_count(column_count(column_count))); return 0; }
;************************************************************************************************************************************************************ ;* Song::get_event_column_count() const * ;************************************************************************************************************************************************************ ;undefined get_event_column_count(Song * this) ;this Song * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 MOV dword ptr [RBP + local_10+0x8],0x0 JMP LAB_00258a09 LAB_002589e2: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] MOV EAX,dword ptr [RBP + local_10+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<Track*>::operator[] ;undefined operator[](Vector<Track*>... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Track::get_event_column_count ;undefined get_event_column_count(Tra... ADD dword ptr [RBP + local_c+0x8],EAX ADD dword ptr [RBP + local_10+0x8],0x1 LAB_00258a09: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) CMP dword ptr [RBP + local_10+0x8],EAX SETL AL TEST AL,AL JNZ LAB_002589e2 MOV EAX,dword ptr [RBP + local_c+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* Song::get_event_column_track(int) const * ;************************************************************************************************************************************************************ ;undefined get_event_column_track(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_c undefined4 -c ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP
int Song::get_event_column_count() const { int cc = 0; for (int i = 0; i < tracks.size(); i++) cc += tracks[i]->get_event_column_count(); return cc; }
int get_column_count() const { int count = 0; for (int i = 0; i < count; i++) { count++; } return count; }
;************************************************************************************************************************************************************ ;* Song::add_track_at_pos(Track*, int) * ;************************************************************************************************************************************************************ ;undefined add_track_at_pos(Song * this, Track * param_1, int param_2) ;this Song * RDI ;param_1 Track * RSI ;param_2 int EDX ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_3c undefined4 -3c PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x38 MOV qword ptr [RBP + local_30+0x8],this MOV qword ptr [RBP + local_38+0x8],param_1 MOV dword ptr [RBP + local_3c+0x8],param_2 LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX LAB_00258543: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] LEA RCX,[RAX + 0x30] LEA param_2=>local_38,[RBP + -0x30] MOV EAX,dword ptr [RBP + local_3c+0x8] MOV param_1,EAX MOV this,RCX ;try { // try from 0025855c to 0025856c has its CatchHandler @ 0025857b LAB_0025855c: CALL Vector<Track*>::insert ;undefined insert(Vector<Track*> * th... MOV RAX,qword ptr [RBP + local_30+0x8] MOV this,RAX CALL Song::update_process_order ;undefined update_process_order(Song... ;} // end try from 0025855c to 0025856c LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) JMP LAB_00258595 ;catch() {... } // from try @ 0025855c with catch @ 0025857b LAB_0025857b: MOV RBX,RAX LEA RAX,[RBP + -0x11] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_00258590: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_00258595: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::add_track_at_pos(Track *p_track, int p_pos) { _AUDIO_LOCK_ tracks.insert(p_pos, p_track); update_process_order(); }
void Audio::update_track_pos(int pos, int pos) { m_track[pos].update_pos(pos); }
;************************************************************************************************************************************************************ ;* Song::add_track(Track*) * ;************************************************************************************************************************************************************ ;undefined add_track(Song * this, Track * param_1) ;this Song * RDI ;param_1 Track * RSI ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_38 undefined8 -38 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV qword ptr [RBP + local_38+0x8],param_1 LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX LAB_0025849c: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RBX,qword ptr [RBP + local_38+0x8] MOV RAX,qword ptr [RBP + local_30+0x8] ADD RAX,0x70 MOV this,RAX CALL Vector<AudioFrame>::size ;undefined size(Vector<AudioFrame> *... MOV param_1,EAX MOV this,RBX ;try { // try from 002584ba to 002584f9 has its CatchHandler @ 00258508 LAB_002584ba: CALL Track::set_process_buffer_size ;undefined set_process_buffer_size(Tr... MOV RAX,qword ptr [RBP + local_30+0x8] MOV EDX,dword ptr [RAX + 0x98] MOV RAX,qword ptr [RBP + local_38+0x8] MOV param_1,EDX MOV this,RAX CALL Track::set_sampling_rate ;undefined set_sampling_rate(Track *... MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x30] MOV RAX,qword ptr [RBP + local_38+0x8] MOV param_1,RAX MOV this,RDX CALL Vector<Track*>::push_back ;undefined push_back(Vector<Track*> *... MOV RAX,qword ptr [RBP + local_30+0x8] MOV this,RAX CALL Song::update_process_order ;undefined update_process_order(Song... ;} // end try from 002584ba to 002584f9 LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) JMP LAB_00258522 ;catch() {... } // from try @ 002584ba with catch @ 00258508 LAB_00258508: MOV RBX,RAX LEA RAX,[RBP + -0x11] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_0025851d: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_00258522: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* Song::add_track_at_pos(Track*, int) * ;************************************************************************************************************************************************************ ;undefined add_track_at_pos(Song * this, Track * param_1, int param_2) ;this Song * RDI ;param_1 Track * RSI ;param_2 int EDX ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_3c undefined4 -3c PUSH RBP
void Song::add_track(Track *p_track) { _AUDIO_LOCK_ //audio kill p_track->set_process_buffer_size(buffer.size()); p_track->set_sampling_rate(sampling_rate); tracks.push_back(p_track); update_process_order(); }
void Audio::set_update_frame(int p_frame) { update(); update(); update(); update(); }
;************************************************************************************************************************************************************ ;* Song::get_track_count() const * ;************************************************************************************************************************************************************ ;undefined get_track_count(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] ADD RAX,0x30 MOV this,RAX CALL Vector<Track*>::size ;undefined size(Vector<Track*> * this) LEAVE RET ;************************************************************************************************************************************************************ ;* Song::update_process_order() * ;************************************************************************************************************************************************************ ;undefined update_process_order(Song * this) ;this Song * RDI ;local_1c undefined4 -1c ;local_20 undefined4 -20 ;local_24 undefined4 -24 ;local_28 undefined4 -28 ;local_29 undefined1 -29 ;local_30 undefined4 -30 ;local_34 undefined4 -34 ;local_38 undefined4 -38 ;local_3c undefined4 -3c ;local_40 undefined4 -40 ;local_44 undefined4 -44 ;local_58 undefined1 -58 ;local_68 undefined1 -68 ;local_70 undefined8 -70 ;local_80 undefined8 -80 PUSH RBP
int Song::get_track_count() const { return tracks.size(); }
size_t Vector::get_process_count() const { return m_process_count; }
;************************************************************************************************************************************************************ ;* Song::order_get(int) const * ;************************************************************************************************************************************************************ ;undefined order_get(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX,[RAX + 0x18] LEA RAX=>local_14,[RBP + -0xc] MOV param_1,RAX MOV this,RDX CALL Map<int,int>::has ;undefined has(Map<int,int> * this, i... TEST AL,AL JZ LAB_00258157 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX,[RAX + 0x18] LEA RAX=>local_14,[RBP + -0xc] MOV param_1,RAX MOV this,RDX CALL Map<int,int>::operator[] ;undefined operator[](Map<int,int> *... MOV EAX,dword ptr [RAX] JMP LAB_0025815c LAB_00258157: MOV EAX,0xfffff LAB_0025815c: LEAVE RET ;************************************************************************************************************************************************************ ;* Song::get_track_count() const * ;************************************************************************************************************************************************************ ;undefined get_track_count(Song * this) ;this Song * RDI ;local_10 undefined8 -10 PUSH RBP
int Song::order_get(int p_order) const { if (order_list.has(p_order)) return order_list[p_order]; else return ORDER_EMPTY; }
int32_t Track::get_count(int32_t index) const { int32_t index = 0; if (index < 0) return index; return index; }
;************************************************************************************************************************************************************ ;* Song::pattern_get_swing_beat_divisor(int) const * ;************************************************************************************************************************************************************ ;undefined pattern_get_swing_beat_divisor(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::has ;undefined has(Map<int,Song::PatternC... XOR EAX,0x1 TEST AL,AL JZ LAB_00257f9e MOV EAX,0x0 JMP LAB_00257fb4 LAB_00257f9e: MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV EAX,dword ptr [RAX + 0x8] LAB_00257fb4: LEAVE RET ;************************************************************************************************************************************************************ ;* Song::order_set(int, int) * ;************************************************************************************************************************************************************ ;undefined order_set(Song * this, int param_1, int param_2) ;this Song * RDI ;param_1 int ESI ;param_2 int EDX ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_34 undefined4 -34 ;local_38 undefined4 -38 PUSH RBP
Song::SwingBeatDivisor Song::pattern_get_swing_beat_divisor(int p_pattern) const { if (!pattern_config.has(p_pattern)) return SWING_BEAT_DIVISOR_1; return pattern_config[p_pattern].swing_beat_divisor; }
bool Config::has_int(int i) const { if (i == 0) return false; else return false; }
;************************************************************************************************************************************************************ ;* Song::pattern_get_beats(int) const * ;************************************************************************************************************************************************************ ;undefined pattern_get_beats(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::has ;undefined has(Map<int,Song::PatternC... XOR EAX,0x1 TEST AL,AL JZ LAB_00257da8 MOV EAX,0x10 JMP LAB_00257dbe LAB_00257da8: MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV EAX,dword ptr [RAX + 0x4] LAB_00257dbe: LEAVE RET ;************************************************************************************************************************************************************ ;* Song::pattern_set_swing_beat_divisor(int, Song::SwingBeatDivisor) * ;************************************************************************************************************************************************************ ;undefined pattern_set_swing_beat_divisor(Song * this, int param_1, SwingBeatDivisor param_2) ;this Song * RDI ;param_1 int ESI ;param_2 SwingBeatDi... EDX ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_24 undefined8 -24 ;local_25 undefined1 -25 ;local_30 undefined8 -30 ;local_34 undefined4 -34 ;local_38 undefined4 -38 PUSH RBP
int Song::pattern_get_beats(int p_pattern) const { if (!pattern_config.has(p_pattern)) return DEFAULT_PATTERN_BEATS; return pattern_config[p_pattern].beats; }
bool Config::has_or_at(int i) const { return m_at.at(i); }
;************************************************************************************************************************************************************ ;* Song::pattern_set_beats(int, int) * ;************************************************************************************************************************************************************ ;undefined pattern_set_beats(Song * this, int param_1, int param_2) ;this Song * RDI ;param_1 int ESI ;param_2 int EDX ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_24 undefined8 -24 ;local_25 undefined1 -25 ;local_30 undefined8 -30 ;local_34 undefined4 -34 ;local_38 undefined4 -38 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV dword ptr [RBP + local_34+0x8],param_1 MOV dword ptr [RBP + local_38+0x8],param_2 LEA RAX=>local_25,[RBP + -0x1d] MOV this,RAX LAB_00257cd4: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] LEA param_2=>local_34,[RBP + -0x2c] MOV param_1,param_2 MOV this,RAX ;try { // try from 00257ce7 to 00257d48 has its CatchHandler @ 00257d57 LAB_00257ce7: CALL Map<int,Song::PatternConfig>::has ;undefined has(Map<int,Song::PatternC... XOR EAX,0x1 TEST AL,AL JZ LAB_00257d1f LEA RAX=>local_24,[RBP + -0x1c] MOV this,RAX CALL Song::PatternConfig::PatternConfig ;undefined PatternConfig(PatternConfi... MOV RAX,qword ptr [RBP + local_30+0x8] LEA param_2=>local_34,[RBP + -0x2c] MOV param_1,param_2 MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV param_2,qword ptr [RBP + local_24+0x8] MOV qword ptr [RAX],param_2 MOV param_2,dword ptr [RBP + local_1c+0x8] MOV dword ptr [RAX + 0x8],param_2 LAB_00257d1f: MOV EBX,dword ptr [RBP + local_38+0x8] MOV RAX,qword ptr [RBP + local_30+0x8] LEA param_2=>local_34,[RBP + -0x2c] MOV param_1,param_2 MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV dword ptr [RAX + 0x4],EBX MOV param_2=>local_34,dword ptr [RBP + -0x2c] MOV RAX,qword ptr [RBP + local_30+0x8] MOV param_1,param_2 MOV this,RAX CALL Song::_check_delete_pattern_config ;undefined _check_delete_pattern_conf... ;} // end try from 00257ce7 to 00257d48 LEA RAX=>local_25,[RBP + -0x1d] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) JMP LAB_00257d71 ;catch() {... } // from try @ 00257ce7 with catch @ 00257d57 LAB_00257d57: MOV RBX,RAX LEA RAX,[RBP + -0x1d] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_00257d6c: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_00257d71: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Song::pattern_set_beats(int p_pattern, int p_beats) { _AUDIO_LOCK_ if (!pattern_config.has(p_pattern)) pattern_config[p_pattern] = PatternConfig(); pattern_config[p_pattern].beats = p_beats; _check_delete_pattern_config(p_pattern); }
void CConfig::set_lock(int i, int i) { if (m_lock) m_lock = i; else m_lock = i; }
;************************************************************************************************************************************************************ ;* Song::pattern_get_beats_per_bar(int) const * ;************************************************************************************************************************************************************ ;undefined pattern_get_beats_per_bar(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::has ;undefined has(Map<int,Song::PatternC... XOR EAX,0x1 TEST AL,AL JZ LAB_00257ca2 MOV EAX,0x4 JMP LAB_00257cb7 LAB_00257ca2: MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV EAX,dword ptr [RAX] LAB_00257cb7: LEAVE RET ?? 90h
int Song::pattern_get_beats_per_bar(int p_pattern) const { if (!pattern_config.has(p_pattern)) return DEFAULT_BEATS_PER_BAR; return pattern_config[p_pattern].beats_per_bar; }
bool CConfig::has_int(int i) const { if (i == 0) return false; return m_bar->get_int(i); }
;************************************************************************************************************************************************************ ;* Song::_check_delete_pattern_config(int) * ;************************************************************************************************************************************************************ ;undefined _check_delete_pattern_config(Song * this, int param_1) ;this Song * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::has ;undefined has(Map<int,Song::PatternC... XOR EAX,0x1 TEST AL,AL JNZ LAB_00257bb3 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV EAX,dword ptr [RAX] CMP EAX,0x4 JNZ LAB_00257b95 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV EAX,dword ptr [RAX + 0x4] CMP EAX,0x10 JNZ LAB_00257b95 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::operator[] ;undefined operator[](Map<int,Song::P... MOV EAX,dword ptr [RAX + 0x8] TEST EAX,EAX JNZ LAB_00257b95 MOV EAX,0x1 JMP LAB_00257b9a LAB_00257b95: MOV EAX,0x0 LAB_00257b9a: TEST AL,AL JZ LAB_00257bb4 MOV RAX,qword ptr [RBP + local_10+0x8] LEA RDX=>local_14,[RBP + -0xc] MOV param_1,RDX MOV this,RAX CALL Map<int,Song::PatternConfig>::erase ;undefined erase(Map<int,Song::Patter... JMP LAB_00257bb4 LAB_00257bb3: NOP LAB_00257bb4: LEAVE RET ;************************************************************************************************************************************************************ ;* Song::pattern_set_beats_per_bar(int, int) * ;************************************************************************************************************************************************************ ;undefined pattern_set_beats_per_bar(Song * this, int param_1, int param_2) ;this Song * RDI ;param_1 int ESI ;param_2 int EDX ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_24 undefined8 -24 ;local_25 undefined1 -25 ;local_30 undefined8 -30 ;local_34 undefined4 -34 ;local_38 undefined4 -38 PUSH RBP
void Song::_check_delete_pattern_config(int p_pattern) { if (!pattern_config.has(p_pattern)) return; if (pattern_config[p_pattern].beats_per_bar == DEFAULT_BEATS_PER_BAR && pattern_config[p_pattern].beats == DEFAULT_PATTERN_BEATS && pattern_config[p_pattern].swing_beat_divisor == SWING_BEAT_DIVISOR_1) { pattern_config.erase(p_pattern); } }
bool CConfig::check_config(int value) { for (int i = 0; i < _config.size(); i++) { if (_config[i].is_value(value)) return true; } return false; }
;************************************************************************************************************************************************************ ;* Track::automations_pre_play_restore() * ;************************************************************************************************************************************************************ ;undefined automations_pre_play_restore(Track * this) ;this Track * RDI ;local_c undefined4 -c ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_00265d7d LAB_00265d59: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x60] MOV EAX,dword ptr [RBP + local_c+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<Automation*>::operator[] ;undefined operator[](Vector<Automati... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Automation::pre_play_restore ;undefined pre_play_restore(Automatio... ADD dword ptr [RBP + local_c+0x8],0x1 LAB_00265d7d: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x60 MOV this,RAX CALL Vector<Automation*>::size ;undefined size(Vector<Automation*> *... CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00265d59 NOP NOP LEAVE RET ?? 90h
void Track::automations_pre_play_restore() { for (int i = 0; i < automations.size(); i++) { automations[i]->pre_play_restore(); } }
void Sprite::play_pre_play() { for (int i = 0; i < num_pre_play; i++) { play_pre_play(i); } }
;************************************************************************************************************************************************************ ;* Track::automations_pre_play_capture() * ;************************************************************************************************************************************************************ ;undefined automations_pre_play_capture(Track * this) ;this Track * RDI ;local_c undefined4 -c ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_00265d25 LAB_00265d01: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x60] MOV EAX,dword ptr [RBP + local_c+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<Automation*>::operator[] ;undefined operator[](Vector<Automati... MOV RAX,qword ptr [RAX] MOV this,RAX CALL Automation::pre_play_capture ;undefined pre_play_capture(Automatio... ADD dword ptr [RBP + local_c+0x8],0x1 LAB_00265d25: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x60 MOV this,RAX CALL Vector<Automation*>::size ;undefined size(Vector<Automation*> *... CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00265d01 NOP NOP LEAVE RET ?? 90h
void Track::automations_pre_play_capture() { for (int i = 0; i < automations.size(); i++) { automations[i]->pre_play_capture(); } }
void R_pre_pre_play() { for (int i = 0; i < 3; i++) { _pre_play(); } }
;************************************************************************************************************************************************************ ;* Track::stop() * ;************************************************************************************************************************************************************ ;undefined stop(Track * this) ;this Track * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_00265c76 LAB_00265c3f: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x50] MOV EAX,dword ptr [RBP + local_c+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<AudioEffect*>::operator[] ;undefined operator[](Vector<AudioEff... MOV RAX,qword ptr [RAX] MOV qword ptr [RBP + local_18+0x8],RAX MOV RAX,qword ptr [RBP + local_18+0x8] MOV RAX,qword ptr [RAX] ADD RAX,0x50 MOV RDX,qword ptr [RAX] MOV RAX,qword ptr [RBP + local_18+0x8] MOV this,RAX CALL RDX ADD dword ptr [RBP + local_c+0x8],0x1 LAB_00265c76: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x50 MOV this,RAX CALL Vector<AudioEffect*>::size ;undefined size(Vector<AudioEffect*>... CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00265c3f MOV dword ptr [RBP + local_10+0x8],0x0 JMP LAB_00265cb5 LAB_00265c99: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x20] MOV EAX,dword ptr [RBP + local_10+0x8] MOV ESI,EAX MOV this,RDX CALL Vector<unsigned_char>::operator[] ;undefined operator[](Vector<unsigned... MOV byte ptr [RAX],0xff ADD dword ptr [RBP + local_10+0x8],0x1 LAB_00265cb5: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x20 MOV this,RAX CALL Vector<unsigned_char>::size ;undefined size(Vector<unsigned_char>... CMP dword ptr [RBP + local_10+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00265c99 MOV RAX,qword ptr [RBP + local_20+0x8] MOV dword ptr [RAX + 0x200d8],0x0 MOV RAX,qword ptr [RBP + local_20+0x8] MOV byte ptr [RAX + 0x200dc],0x1 NOP LEAVE RET ?? 90h
void Track::stop() { for (int i = 0; i < effects.size(); i++) { AudioEffect *fx = effects[i]; fx->reset(); } for (int i = 0; i < column_state.size(); i++) { column_state[i] = Note::EMPTY; } event_buffer_size = 0; first_mix = true; }
void Audio::stop() { for (int i = 0; i < size(); ++i) stop(i); }
;************************************************************************************************************************************************************ ;* Track::set_sampling_rate(int) * ;************************************************************************************************************************************************************ ;undefined set_sampling_rate(Track * this, int param_1) ;this Track * RDI ;param_1 int ESI ;local_c undefined4 -c ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV RAX,qword ptr [RBP + local_20+0x8] MOV EAX,dword ptr [RAX + 0xa0] CMP dword ptr [RBP + local_24+0x8],EAX JZ LAB_002646c2 MOV RAX,qword ptr [RBP + local_20+0x8] MOV EDX,dword ptr [RBP + local_24+0x8] MOV dword ptr [RAX + 0xa0],EDX MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_002646a6 LAB_00264676: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x50] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<AudioEffect*>::operator[] ;undefined operator[](Vector<AudioEff... MOV RAX,qword ptr [RAX] MOV RDX,qword ptr [RAX] ADD RDX,0x20 MOV RCX,qword ptr [RDX] MOV EDX,dword ptr [RBP + local_24+0x8] MOV param_1,EDX MOV this,RAX CALL RCX ADD dword ptr [RBP + local_c+0x8],0x1 LAB_002646a6: MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x50 MOV this,RAX CALL Vector<AudioEffect*>::size ;undefined size(Vector<AudioEffect*>... CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_00264676 JMP LAB_002646c3 LAB_002646c2: NOP LAB_002646c3: LEAVE RET ?? 90h
void Track::set_sampling_rate(int p_hz) { if (sampling_rate == p_hz) { return; } sampling_rate = p_hz; for (int i = 0; i < effects.size(); i++) { effects[i]->set_sampling_rate(p_hz); } }
void Audio::set_size(int size) { for (int i = 0; i < size; i++) { if (size[i] == size) size[i] = size; } }
;************************************************************************************************************************************************************ ;* Track::has_send(int) const * ;************************************************************************************************************************************************************ ;undefined has_send(Track * this, int param_1) ;this Track * RDI ;param_1 int ESI ;local_c undefined4 -c ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV dword ptr [RBP + local_c+0x8],0x0 JMP LAB_0026450d LAB_002644de: MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x80] MOV EAX,dword ptr [RBP + local_c+0x8] MOV param_1,EAX MOV this,RDX CALL Vector<Track::Send>::operator[] ;undefined operator[](Vector<Track::S... MOV EAX,dword ptr [RAX] CMP dword ptr [RBP + local_24+0x8],EAX SETZ AL TEST AL,AL JZ LAB_00264509 MOV EAX,0x1 JMP LAB_0026452c LAB_00264509: ADD dword ptr [RBP + local_c+0x8],0x1 LAB_0026450d: MOV RAX,qword ptr [RBP + local_20+0x8] SUB RAX,-0x80 MOV this,RAX CALL Vector<Track::Send>::size ;undefined size(Vector<Track::Send> *... CMP dword ptr [RBP + local_c+0x8],EAX SETL AL TEST AL,AL JNZ LAB_002644de MOV EAX,0x0 LAB_0026452c: LEAVE RET ;************************************************************************************************************************************************************ ;* Track::set_process_buffer_size(int) * ;************************************************************************************************************************************************************ ;undefined set_process_buffer_size(Track * this, int param_1) ;this Track * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_1d undefined1 -1d ;local_30 undefined8 -30 ;local_34 undefined4 -34 PUSH RBP
bool Track::has_send(int p_send) const { for (int i = 0; i < sends.size(); i++) { if (sends[i].track == p_send) { return true; } } return false; }
bool Sam::set_send_buffer(int size) const { for (int i = 0; i < size; i++) if (buffer[i].send_buffer == size) return true; return false; }
;************************************************************************************************************************************************************ ;* Track::get_send_count() * ;************************************************************************************************************************************************************ ;undefined get_send_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] SUB RAX,-0x80 MOV this,RAX CALL Vector<Track::Send>::size ;undefined size(Vector<Track::Send> *... LEAVE RET ;************************************************************************************************************************************************************ ;* Track::remove_send(int) * ;************************************************************************************************************************************************************ ;undefined remove_send(Track * this, int param_1) ;this Track * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_34 undefined4 -34 PUSH RBP
int Track::get_send_count() { return sends.size(); }
size_t max_count() override { return max_size(); }
;************************************************************************************************************************************************************ ;* Track::get_peak_volume_db_r() const * ;************************************************************************************************************************************************************ ;undefined get_peak_volume_db_r(Track * this) ;this Track * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV RAX,qword ptr [RBP + local_20+0x8] MOVSS XMM0,dword ptr [RAX + 0x200e4] MOVSS dword ptr [RBP + local_10+0x8],XMM0 MOV EAX,dword ptr [RBP + local_10+0x8] MOVD XMM0,EAX CALL std::log ;undefined log(float param_1) PXOR XMM1,XMM1 CVTSS2SD XMM1,XMM0 MOVSD XMM0,qword ptr [.rodata:DAT_00286940] ;= 40215F2CED384F29h MULSD XMM0,XMM1 CVTSD2SS XMM0,XMM0 MOVSS dword ptr [RBP + local_c+0x8],XMM0 MOV RAX,qword ptr [RBP + local_20+0x8] PXOR XMM0,XMM0 MOVSS dword ptr [RAX + 0x200e4],XMM0 MOVSS XMM0,dword ptr [RBP + local_c+0x8] LEAVE RET ?? 90h
float Track::get_peak_volume_db_r() const { float pvolume = linear2db(peak_volume_r); peak_volume_r = 0; return pvolume; }
float get_log_r() const { return log_r[0] * log_r[1] * log_r[2]; }
;************************************************************************************************************************************************************ ;* Track::get_peak_volume_db_l() const * ;************************************************************************************************************************************************************ ;undefined get_peak_volume_db_l(Track * this) ;this Track * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV RAX,qword ptr [RBP + local_20+0x8] MOVSS XMM0,dword ptr [RAX + 0x200e0] MOVSS dword ptr [RBP + local_10+0x8],XMM0 MOV EAX,dword ptr [RBP + local_10+0x8] MOVD XMM0,EAX CALL std::log ;undefined log(float param_1) PXOR XMM1,XMM1 CVTSS2SD XMM1,XMM0 MOVSD XMM0,qword ptr [.rodata:DAT_00286940] ;= 40215F2CED384F29h MULSD XMM0,XMM1 CVTSD2SS XMM0,XMM0 MOVSS dword ptr [RBP + local_c+0x8],XMM0 MOV RAX,qword ptr [RBP + local_20+0x8] PXOR XMM0,XMM0 MOVSS dword ptr [RAX + 0x200e0],XMM0 MOVSS XMM0,dword ptr [RBP + local_c+0x8] LEAVE RET ?? 90h
float Track::get_peak_volume_db_l() const { float pvolume = linear2db(peak_volume_l); peak_volume_l = 0; return pvolume; }
float get_log_pos() const { return log_pos / log_pos; }
;************************************************************************************************************************************************************ ;* Track::get_mix_volume_db() const * ;************************************************************************************************************************************************************ ;undefined get_mix_volume_db(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS XMM0,dword ptr [RAX + 0x90] POP RBP RET ;************************************************************************************************************************************************************ ;* Track::get_peak_volume_db_l() const * ;************************************************************************************************************************************************************ ;undefined get_peak_volume_db_l(Track * this) ;this Track * RDI ;local_c undefined4 -c ;local_10 undefined4 -10 ;local_20 undefined8 -20 PUSH RBP
float Track::get_mix_volume_db() const { return mix_volume; }
float get_l_left() const { return l_left; }
;************************************************************************************************************************************************************ ;* Track::set_mix_volume_db(float) * ;************************************************************************************************************************************************************ ;undefined set_mix_volume_db(Track * this, float param_1) ;this Track * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOVSS dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOVSS param_1,dword ptr [RBP + local_14+0x8] MOVSS dword ptr [RAX + 0x90],param_1 NOP POP RBP RET ?? 90h
void Track::set_mix_volume_db(float p_db) { mix_volume = p_db; }
void set_f(float f) { f = f; }
;************************************************************************************************************************************************************ ;* Track::is_muted() const * ;************************************************************************************************************************************************************ ;undefined is_muted(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0x4c] POP RBP RET ;************************************************************************************************************************************************************ ;* Track::set_mix_volume_db(float) * ;************************************************************************************************************************************************************ ;undefined set_mix_volume_db(Track * this, float param_1) ;this Track * RDI ;param_1 float XMM0_Da ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP
bool Track::is_muted() const { return muted; }
bool is_float() const { return _is_float; }
;************************************************************************************************************************************************************ ;* Track::set_muted(bool) * ;************************************************************************************************************************************************************ ;undefined set_muted(Track * this, bool param_1) ;this Track * RDI ;param_1 bool SIL ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_34 undefined1 -34 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV EAX,param_1 MOV byte ptr [RBP + local_34+0x8],AL LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] MOVZX EAX,byte ptr [RAX + 0x4c] CMP byte ptr [RBP + local_34+0x8],AL JNZ LAB_0026351c MOV EBX,0x0 JMP LAB_00263537 LAB_0026351c: MOV RAX,qword ptr [RBP + local_30+0x8] MOVZX EDX,byte ptr [RBP + local_34+0x8] MOV byte ptr [RAX + 0x4c],DL MOV RAX,qword ptr [RBP + local_30+0x8] MOV byte ptr [RAX + 0x200dc],0x1 MOV EBX,0x1 LAB_00263537: LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) CMP EBX,0x1 MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* Track::is_muted() const * ;************************************************************************************************************************************************************ ;undefined is_muted(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP
void Track::set_muted(bool p_mute) { _AUDIO_LOCK_ if (muted == p_mute) { return; } muted = p_mute; first_mix = true; //clear memories when unmuted }
bool AudioAudio::isLock(bool isLock) const { bool isLock = isLock; if (isLock) { isLock = isLock; } return isLock; }
;************************************************************************************************************************************************************ ;* Track::get_event_column_type(int) const * ;************************************************************************************************************************************************************ ;undefined get_event_column_type(Track * this, int param_1) ;this Track * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x18] CMP dword ptr [RBP + local_14+0x8],EAX JGE LAB_00262b0a MOV EAX,0x0 JMP LAB_00262b2b LAB_00262b0a: MOV RAX,qword ptr [RBP + local_10+0x8] MOV EDX,dword ptr [RAX + 0x18] MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x48] ADD EAX,EDX CMP dword ptr [RBP + local_14+0x8],EAX JGE LAB_00262b26 MOV EAX,0x1 JMP LAB_00262b2b LAB_00262b26: MOV EAX,0x2 LAB_00262b2b: POP RBP RET ?? 90h
Track::Event::Type Track::get_event_column_type(int p_column) const { if (p_column < note_columns) return Event::TYPE_NOTE; else if (p_column < note_columns + command_columns) return Event::TYPE_COMMAND; else return Event::TYPE_AUTOMATION; }
const char *Event::get_column_type(int index) const { if (index < 0 || index >= m_column_count) return NULL; return m_column_count[index]; }
;************************************************************************************************************************************************************ ;* Track::get_event_column_count() const * ;************************************************************************************************************************************************************ ;undefined get_event_column_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x18 MOV qword ptr [RBP + local_20+0x8],this MOV RAX,qword ptr [RBP + local_20+0x8] MOV EDX,dword ptr [RAX + 0x18] MOV RAX,qword ptr [RBP + local_20+0x8] MOV EAX,dword ptr [RAX + 0x48] LEA EBX,[RDX + RAX*0x1] MOV RAX,qword ptr [RBP + local_20+0x8] ADD RAX,0x60 MOV this,RAX CALL Vector<Automation*>::size ;undefined size(Vector<Automation*> *... ADD EAX,EBX MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* Track::set_event(int, int, unsigned long, Track::Event const&) * ;************************************************************************************************************************************************************ ;undefined set_event(Track * this, int param_1, int param_2, ulong param_3, Event * param_4) ;this Track * RDI ;param_1 int ESI ;param_2 int EDX ;param_3 ulong RCX ;param_4 Event * R8 ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_1d undefined1 -1d ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined8 -40 ;local_48 undefined8 -48 ;local_50 undefined8 -50 ;local_54 undefined4 -54 ;local_58 undefined4 -58 ;local_60 undefined8 -60 ;local_68 undefined8 -68 PUSH RBP
int Track::get_event_column_count() const { return note_columns + command_columns + automations.size(); }
int Event::get_column_count (int index) const { return m_column_count[index]; }
;************************************************************************************************************************************************************ ;* Track::get_command_count(int) const * ;************************************************************************************************************************************************************ ;undefined get_command_count(Track * this, int param_1) ;this Track * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x30] LEA RAX=>local_24,[RBP + -0x1c] MOV param_1,RAX MOV this,RDX CALL Map<int,ValueStream<Track::Pos,Track::Command>>::find ;undefined find(Map<int,ValueStream<T... MOV qword ptr [RBP + local_10+0x8],RAX CMP qword ptr [RBP + local_10+0x8],0x0 JNZ LAB_00261fe4 MOV EAX,0x0 JMP LAB_00262002 LAB_00261fe4: MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Map<int,ValueStream<Track::Pos,Track::Command>>::Element::get ;undefined get(Element * this) MOV qword ptr [RBP + local_18+0x8],RAX MOV RAX,qword ptr [RBP + local_18+0x8] MOV this,RAX CALL Vector<ValueStream<Track::Pos,Track::Command>::Value>::size ;undefined size(Vector<ValueStream<Tr... NOP NOP LAB_00262002: LEAVE RET ;************************************************************************************************************************************************************ ;* Track::get_command_by_index(int, int) const * ;************************************************************************************************************************************************************ ;undefined get_command_by_index(Track * this, int param_1, int param_2) ;this Track * RDI ;param_1 int ESI ;param_2 int EDX ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined8 -40 ;local_44 undefined4 -44 ;local_46 undefined2 -46 ;local_48 undefined2 -48 ;local_50 undefined8 -50 ;local_54 undefined4 -54 ;local_58 undefined4 -58 PUSH RBP
int Track::get_command_count(int p_pattern) const { const Map<int, ValueStream<Pos, Command> >::Element *E = command_data.find(p_pattern); if (!E) return 0; return E->get().size(); }
int32_t get_index_count(int32_t index) const { int32_t index = 0; for (int32_t i = 0; i < index; i++) { index += get_index_by_index(index); } return index; }
;************************************************************************************************************************************************************ ;* Track::get_command_column_count() const * ;************************************************************************************************************************************************************ ;undefined get_command_column_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x48] POP RBP RET ?? 90h
int Track::get_command_column_count() const { return command_columns; }
int get_column_count() const override { return m_column_count; }
;************************************************************************************************************************************************************ ;* Track::get_note_count(int) const * ;************************************************************************************************************************************************************ ;undefined get_note_count(Track * this, int param_1) ;this Track * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX=>local_24,[RBP + -0x1c] MOV param_1,RDX MOV this,RAX CALL Map<int,ValueStream<Track::Pos,Track::Note>>::find ;undefined find(Map<int,ValueStream<T... MOV qword ptr [RBP + local_10+0x8],RAX CMP qword ptr [RBP + local_10+0x8],0x0 JNZ LAB_0026133e MOV EAX,0x0 JMP LAB_0026135c LAB_0026133e: MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Map<int,ValueStream<Track::Pos,Track::Note>>::Element::get ;undefined get(Element * this) MOV qword ptr [RBP + local_18+0x8],RAX MOV RAX,qword ptr [RBP + local_18+0x8] MOV this,RAX CALL Vector<ValueStream<Track::Pos,Track::Note>::Value>::size ;undefined size(Vector<ValueStream<Tr... NOP NOP LAB_0026135c: LEAVE RET ;************************************************************************************************************************************************************ ;* Track::get_note_by_index(int, int) const * ;************************************************************************************************************************************************************ ;undefined get_note_by_index(Track * this, int param_1, int param_2) ;this Track * RDI ;param_1 int ESI ;param_2 int EDX ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_40 undefined8 -40 ;local_44 undefined4 -44 ;local_46 undefined2 -46 ;local_48 undefined2 -48 ;local_50 undefined8 -50 ;local_54 undefined4 -54 ;local_58 undefined4 -58 PUSH RBP
int Track::get_note_count(int p_pattern) const { const Map<int, ValueStream<Pos, Note> >::Element *E = note_data.find(p_pattern); if (!E) return 0; return E->get().size(); }
size_t get_index_by_index(int index) const { size_t count = 0; for (size_t i = 0; i < count; i++) { count += get_index(index, i); } return count; }
;************************************************************************************************************************************************************ ;* Track::get_column_count() const * ;************************************************************************************************************************************************************ ;undefined get_column_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x18] POP RBP RET ?? 90h
int Track::get_column_count() const { return note_columns; }
int get_column_count() const override { return m_column_count; }
;************************************************************************************************************************************************************ ;* Track::get_disabled_automation_count() const * ;************************************************************************************************************************************************************ ;undefined get_disabled_automation_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] ADD RAX,0x70 MOV this,RAX CALL Vector<Automation*>::size ;undefined size(Vector<Automation*> *... LEAVE RET ;************************************************************************************************************************************************************ ;* Track::add_disabled_automation(Automation*, int) * ;************************************************************************************************************************************************************ ;undefined add_disabled_automation(Track * this, Automation * param_1, int param_2) ;this Track * RDI ;param_1 Automation * RSI ;param_2 int EDX ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_3c undefined4 -3c PUSH RBP
int Track::get_disabled_automation_count() const { return disabled_automations.size(); }
int Track::get_count_count_count() const { return get_count_count(); }
;************************************************************************************************************************************************************ ;* Track::swap_automations(int, int) * ;************************************************************************************************************************************************************ ;undefined swap_automations(Track * this, int param_1, int param_2) ;this Track * RDI ;param_1 int ESI ;param_2 int EDX ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_34 undefined4 -34 ;local_38 undefined4 -38 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV dword ptr [RBP + local_34+0x8],param_1 MOV dword ptr [RBP + local_38+0x8],param_2 LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX LAB_00260822: CALL AudioLock::AudioLock ;undefined AudioLock(AudioLock * this) MOV RAX,qword ptr [RBP + local_30+0x8] LEA param_2,[RAX + 0x60] MOV EAX,dword ptr [RBP + local_38+0x8] MOV param_1,EAX MOV this,param_2 ;try { // try from 00260837 to 00260853 has its CatchHandler @ 0026086d LAB_00260837: CALL Vector<Automation*>::operator[] ;undefined operator[](Vector<Automati... MOV RBX,RAX MOV RAX,qword ptr [RBP + local_30+0x8] LEA param_2,[RAX + 0x60] MOV EAX,dword ptr [RBP + local_34+0x8] MOV param_1,EAX MOV this,param_2 CALL Vector<Automation*>::operator[] ;undefined operator[](Vector<Automati... ;} // end try from 00260837 to 00260853 MOV param_1,RBX MOV this,RAX CALL __swap_tmpl<Automation*> ;void __swap_tmpl<Automation*>(Automa... LEA RAX=>local_19,[RBP + -0x11] MOV this,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) JMP LAB_00260887 ;catch() {... } // from try @ 00260837 with catch @ 0026086d LAB_0026086d: MOV RBX,RAX LEA RAX,[RBP + -0x11] MOV RDI,RAX CALL AudioLock::~AudioLock ;undefined ~AudioLock(AudioLock * this) MOV RAX,RBX MOV RDI,RAX LAB_00260882: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_00260887: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ?? 90h
void Track::swap_automations(int p_which, int p_by_which) { _AUDIO_LOCK_ SWAP(automations[p_which], automations[p_by_which]); }
void AudioAudioAudio::swap(int i, int j) { _swap(i, j); }
;************************************************************************************************************************************************************ ;* Track::get_automation_count() const * ;************************************************************************************************************************************************************ ;undefined get_automation_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] ADD RAX,0x60 MOV this,RAX CALL Vector<Automation*>::size ;undefined size(Vector<Automation*> *... LEAVE RET ;************************************************************************************************************************************************************ ;* Track::add_automation(Automation*, int) * ;************************************************************************************************************************************************************ ;undefined add_automation(Track * this, Automation * param_1, int param_2) ;this Track * RDI ;param_1 Automation * RSI ;param_2 int EDX ;local_10 undefined8 -10 ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_3c undefined4 -3c PUSH RBP
int Track::get_automation_count() const { return automations.size(); }
size_t Track::get_size_count(void) const { return m_size.size(); }
;************************************************************************************************************************************************************ ;* Track::get_audio_effect_count() const * ;************************************************************************************************************************************************************ ;undefined get_audio_effect_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] ADD RAX,0x50 MOV this,RAX CALL Vector<AudioEffect*>::size ;undefined size(Vector<AudioEffect*>... LEAVE RET ;************************************************************************************************************************************************************ ;* Track::add_audio_effect(AudioEffect*, int) * ;************************************************************************************************************************************************************ ;undefined add_audio_effect(Track * this, AudioEffect * param_1, int param_2) ;this Track * RDI ;param_1 AudioEffect * RSI ;param_2 int EDX ;local_19 undefined1 -19 ;local_30 undefined8 -30 ;local_38 undefined8 -38 ;local_3c undefined4 -3c PUSH RBP
int Track::get_audio_effect_count() const { return effects.size(); }
size_t get_audio_audio_size(void) const { return m_audio_audio_size; }
;************************************************************************************************************************************************************ ;* Track::get_name() const * ;************************************************************************************************************************************************************ ;undefined get_name(void) ;local_10 undefined8 -10 ;local_18 undefined8 -18 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],RDI MOV qword ptr [RBP + local_18+0x8],RSI MOV RAX,qword ptr [RBP + local_18+0x8] LEA RDX,[RAX + 0x98] MOV RAX,qword ptr [RBP + local_10+0x8] MOV RSI,RDX MOV RDI,RAX CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* Track::get_audio_effect_count() const * ;************************************************************************************************************************************************************ ;undefined get_audio_effect_count(Track * this) ;this Track * RDI ;local_10 undefined8 -10 PUSH RBP
String Track::get_name() const { return name; }
const char *audio_audio::get_audio_name() const { return m_audio_name; }
;************************************************************************************************************************************************************ ;* Track::set_name(String) * ;************************************************************************************************************************************************************ ;undefined set_name(Track * this, String param_1) ;this Track * RDI ;param_1 String SIL ;local_10 undefined8 -10 ;local_20 undefined1 -20 ;local_30 undefined8 -30 ;local_38 undefined8 -38 PUSH RBP MOV RBP,RSP PUSH RBX SUB RSP,0x28 MOV qword ptr [RBP + local_30+0x8],this MOV qword ptr [RBP + local_38+0x8],param_1 MOV RDX,qword ptr [RBP + local_38+0x8] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RDX MOV this,RAX LAB_0025fb59: CALL String::String ;undefined String(String * this, Stri... MOV RAX,qword ptr [RBP + local_30+0x8] LEA RDX,[RAX + 0x98] LEA RAX=>local_20,[RBP + -0x18] MOV param_1,RAX MOV this,RDX ;try { // try from 0025fb73 to 0025fb77 has its CatchHandler @ 0025fb86 LAB_0025fb73: CALL String::operator= ;undefined operator=(String * this, S... ;} // end try from 0025fb73 to 0025fb77 LEA RAX=>local_20,[RBP + -0x18] MOV this,RAX CALL String::~String ;undefined ~String(String * this) JMP LAB_0025fba0 ;catch() {... } // from try @ 0025fb73 with catch @ 0025fb86 LAB_0025fb86: MOV RBX,RAX LEA RAX,[RBP + -0x18] MOV RDI,RAX CALL String::~String ;undefined ~String(String * this) MOV RAX,RBX MOV RDI,RAX LAB_0025fb9b: CALL .plt:<EXTERNAL>::_Unwind_Resume ;undefined _Unwind_Resume() LAB_0025fba0: MOV RBX,qword ptr [RBP + local_10+0x8] LEAVE RET ;************************************************************************************************************************************************************ ;* Track::get_name() const * ;************************************************************************************************************************************************************ ;undefined get_name(void) ;local_10 undefined8 -10 ;local_18 undefined8 -18 PUSH RBP
void Track::set_name(String p_name) { name = p_name; }
String String::get_name() const { return name; }
;************************************************************************************************************************************************************ ;* Automation::remove_notify() * ;************************************************************************************************************************************************************ ;undefined remove_notify(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Automation::pre_play_restore ;undefined pre_play_restore(Automatio... MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV EDX,0x0 MOV ESI,0x0 MOV this,RAX CALL ControlPort::set_ui_changed_callback ;undefined set_ui_changed_callback(Co... NOP LEAVE RET ?? 90h
void Automation::remove_notify() { pre_play_restore(); port->set_ui_changed_callback(NULL, NULL); }
void ui::set_changed_changed() { ui->set_changed_changed(0); }
;************************************************************************************************************************************************************ ;* Automation::add_notify() * ;************************************************************************************************************************************************************ ;undefined add_notify(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV byte ptr [RAX + 0x30],0x0 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV RDX,qword ptr [RBP + local_10+0x8] LEA RCX,[Automation::_ui_changed_callbacks] MOV RSI=>Automation::_ui_changed_callbacks,RCX MOV this,RAX CALL ControlPort::set_ui_changed_callback ;undefined set_ui_changed_callback(Co... NOP LEAVE RET ?? 90h
void Automation::add_notify() { has_pre_play_capture = false; //should be false but just in case port->set_ui_changed_callback(&_ui_changed_callbacks, this); }
void changed::changed_changed_changed() { m_changed_changed = false; m_changed_changed = false; }
;************************************************************************************************************************************************************ ;* Automation::pre_play_restore() * ;************************************************************************************************************************************************************ ;undefined pre_play_restore(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0x30] TEST AL,AL JZ LAB_0025fa62 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV RAX,qword ptr [RAX] ADD RAX,0x38 MOV RCX,qword ptr [RAX] MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV RDX,qword ptr [RBP + local_10+0x8] MOV EDX,dword ptr [RDX + 0x34] MOVD XMM0,EDX MOV this,RAX CALL RCX MOV RAX,qword ptr [RBP + local_10+0x8] MOV byte ptr [RAX + 0x30],0x0 LAB_0025fa62: NOP LEAVE RET ?? 90h
void Automation::pre_play_restore() { if (has_pre_play_capture) { port->set(pre_play_capture_value); has_pre_play_capture = false; }; }
void play::play_play() { _play_play = true; _play_play = false; }
;************************************************************************************************************************************************************ ;* Automation::pre_play_capture() * ;************************************************************************************************************************************************************ ;undefined pre_play_capture(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0x30] TEST AL,AL JNZ LAB_0025fa14 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV RAX,qword ptr [RAX] ADD RAX,0x28 MOV RDX,qword ptr [RAX] MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV this,RAX CALL RDX MOVD EAX,XMM0 MOV RDX,qword ptr [RBP + local_10+0x8] MOV dword ptr [RDX + 0x34],EAX MOV RAX,qword ptr [RBP + local_10+0x8] MOV byte ptr [RAX + 0x30],0x1 JMP LAB_0025fa15 LAB_0025fa14: NOP LAB_0025fa15: LEAVE RET ?? 90h
void Automation::pre_play_capture() { if (has_pre_play_capture) { return; //do not re-capture } pre_play_capture_value = port->get(); has_pre_play_capture = true; }
void play::play_pre_pre_pre_pre() { if (pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_pre_prepre_pre_pre_pre_prepre_pre_pre_pre_prepre_pre_pre_prepre_pre_prepre_pre_prepre_pre_prepre_pre_prepre_pre_prepre_prepre_pre_prepre_prepre_pre_prepre_prepre_prepre_prepre_prepre_pre_prepre_pre_prepre_prepre_prepre_prepre_preprepre_prepre_preprepre_prepre_preprepre_preprepre_prepreprepre_prepreprepre_preprepreprepre_prepreprepreprepre_preprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepreprepr
;************************************************************************************************************************************************************ ;* Automation::is_empty() const * ;************************************************************************************************************************************************************ ;undefined is_empty(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x10] TEST EAX,EAX JNZ LAB_0025f9c0 MOV RAX,qword ptr [RBP + local_10+0x8] ADD RAX,0x18 MOV this,RAX CALL Map<int,ValueStream<unsigned_long,unsigned_char>>::empty ;undefined empty(Map<int,ValueStream<... TEST AL,AL JZ LAB_0025f9c0 MOV EAX,0x1 JMP LAB_0025f9c5 LAB_0025f9c0: MOV EAX,0x0 LAB_0025f9c5: LEAVE RET ?? 90h
bool Automation::is_empty() const { return (display_mode == EDIT_ROWS_DISCRETE && data.empty()); }
bool Stream::is_empty() const { if (!is_empty()) return false; return is_empty(); }
;************************************************************************************************************************************************************ ;* Automation::get_edit_mode() const * ;************************************************************************************************************************************************************ ;undefined get_edit_mode(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV EAX,dword ptr [RAX + 0x10] POP RBP RET ?? 90h
Automation::EditMode Automation::get_edit_mode() const { return display_mode; }
int edit_edit::get_edit_mode() const { return m_edit_mode; }
;************************************************************************************************************************************************************ ;* Automation::set_edit_mode(Automation::EditMode) * ;************************************************************************************************************************************************************ ;undefined set_edit_mode(Automation * this, EditMode param_1) ;this Automation * RDI ;param_1 EditMode ESI ;local_10 undefined8 -10 ;local_14 undefined4 -14 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV RAX,qword ptr [RBP + local_10+0x8] MOV EDX,dword ptr [RBP + local_14+0x8] MOV dword ptr [RAX + 0x10],EDX NOP POP RBP RET ;************************************************************************************************************************************************************ ;* Automation::get_edit_mode() const * ;************************************************************************************************************************************************************ ;undefined get_edit_mode(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP
void Automation::set_edit_mode(EditMode p_mode) { display_mode = p_mode; }
void Mode::set_edit_mode(const int mode) { edit_mode = mode; }
;************************************************************************************************************************************************************ ;* Automation::get_owner() * ;************************************************************************************************************************************************************ ;undefined get_owner(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX] POP RBP RET ?? 90h
AudioEffect *Automation::get_owner() { return owner; }
char * Tag::get() { return m_name; }
;************************************************************************************************************************************************************ ;* Automation::get_control_port() * ;************************************************************************************************************************************************************ ;undefined get_control_port(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] POP RBP RET ;************************************************************************************************************************************************************ ;* Automation::get_owner() * ;************************************************************************************************************************************************************ ;undefined get_owner(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP
ControlPort *Automation::get_control_port() { return port; }
const char * control::get_port() { return m_port; }
;************************************************************************************************************************************************************ ;* Automation::get_point_count(int) const * ;************************************************************************************************************************************************************ ;undefined get_point_count(Automation * this, int param_1) ;this Automation * RDI ;param_1 int ESI ;local_10 undefined8 -10 ;local_18 undefined8 -18 ;local_20 undefined8 -20 ;local_24 undefined4 -24 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],this MOV dword ptr [RBP + local_24+0x8],param_1 MOV RAX,qword ptr [RBP + local_20+0x8] LEA RDX,[RAX + 0x18] LEA RAX=>local_24,[RBP + -0x1c] MOV param_1,RAX MOV this,RDX CALL Map<int,ValueStream<unsigned_long,unsigned_char>>::find ;undefined find(Map<int,ValueStream<u... MOV qword ptr [RBP + local_10+0x8],RAX CMP qword ptr [RBP + local_10+0x8],0x0 JNZ LAB_0025f35e MOV EAX,0x0 JMP LAB_0025f37c LAB_0025f35e: MOV RAX,qword ptr [RBP + local_10+0x8] MOV this,RAX CALL Map<int,ValueStream<unsigned_long,unsigned_char>>::Element::get ;undefined get(Element * this) MOV qword ptr [RBP + local_18+0x8],RAX MOV RAX,qword ptr [RBP + local_18+0x8] MOV this,RAX CALL Vector<ValueStream<unsigned_long,unsigned_char>::Value>::size ;undefined size(Vector<ValueStream<un... NOP NOP LAB_0025f37c: LEAVE RET ;************************************************************************************************************************************************************ ;* Automation::interpolate_offset(int, unsigned long) const * ;************************************************************************************************************************************************************ ;undefined interpolate_offset(Automation * this, int param_1, ulong param_2) ;this Automation * RDI ;param_1 int ESI ;param_2 ulong RDX ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_28 undefined8 -28 ;local_2c undefined4 -2c ;local_30 undefined4 -30 ;local_34 undefined4 -34 ;local_38 undefined4 -38 ;local_3c undefined4 -3c ;local_40 undefined4 -40 ;local_48 undefined8 -48 ;local_50 undefined8 -50 ;local_54 undefined4 -54 ;local_60 undefined8 -60 ;local_64 undefined4 -64 ;local_70 undefined8 -70 ;local_74 undefined4 -74 ;local_80 undefined8 -80 ;local_84 undefined4 -84 PUSH RBP
int Automation::get_point_count(int p_pattern) const { const Map<int, ValueStream<Tick, uint8_t> >::Element *E = data.find(p_pattern); if (!E) return 0; return E->get().size(); }
size_t Stream::get_count_count(int count) const { size_t count = 0; for (size_t i = 0; i < count; i++) { count += get_count(count); } return count; }
;************************************************************************************************************************************************************ ;* Automation::has_point(int, unsigned long) const * ;************************************************************************************************************************************************************ ;undefined has_point(Automation * this, int param_1, ulong param_2) ;this Automation * RDI ;param_1 int ESI ;param_2 ulong RDX ;local_10 undefined8 -10 ;local_14 undefined4 -14 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_10+0x8],this MOV dword ptr [RBP + local_14+0x8],param_1 MOV qword ptr [RBP + local_20+0x8],param_2 MOV RAX,qword ptr [RBP + local_10+0x8] LEA param_2,[RAX + 0x18] LEA RAX=>local_14,[RBP + -0xc] MOV param_1,RAX MOV this,param_2 CALL Map<int,ValueStream<unsigned_long,unsigned_char>>::has ;undefined has(Map<int,ValueStream<un... XOR EAX,0x1 TEST AL,AL JZ LAB_0025ea7a MOV EAX,0x0 JMP LAB_0025eaa8 LAB_0025ea7a: MOV RAX,qword ptr [RBP + local_10+0x8] LEA param_2,[RAX + 0x18] LEA RAX=>local_14,[RBP + -0xc] MOV param_1,RAX MOV this,param_2 CALL Map<int,ValueStream<unsigned_long,unsigned_char>>::operator[] ;undefined operator[](Map<int,ValueSt... MOV param_2,RAX MOV RAX,qword ptr [RBP + local_20+0x8] MOV param_1,RAX MOV this,param_2 CALL ValueStream<unsigned_long,unsigned_char>::find_exact ;undefined find_exact(ValueStream<uns... NOT EAX SHR EAX,0x1f LAB_0025eaa8: LEAVE RET ;************************************************************************************************************************************************************ ;* Automation::get_point(int, unsigned long) const * ;************************************************************************************************************************************************************ ;undefined get_point(Automation * this, int param_1, ulong param_2) ;this Automation * RDI ;param_1 int ESI ;param_2 ulong RDX ;local_10 undefined8 -10 ;local_1c undefined4 -1c ;local_28 undefined8 -28 ;local_2c undefined4 -2c ;local_40 undefined8 -40 ;local_44 undefined4 -44 ;local_50 undefined8 -50 PUSH RBP
bool Automation::has_point(int p_pattern, Tick p_offset) const { if (!data.has(p_pattern)) return false; return data[p_pattern].find_exact(p_offset) >= 0; }
bool Stream_has_point (int idx, int idx) const { if (idx < 0) return false; else return!has_point (idx, idx); }
;************************************************************************************************************************************************************ ;* Automation::_ui_changed_callback() * ;************************************************************************************************************************************************************ ;undefined _ui_changed_callback(Automation * this) ;this Automation * RDI ;local_10 undefined8 -10 PUSH RBP MOV RBP,RSP SUB RSP,0x10 MOV qword ptr [RBP + local_10+0x8],this MOV RAX,qword ptr [RBP + local_10+0x8] MOVZX EAX,byte ptr [RAX + 0x30] TEST AL,AL JZ LAB_0025e912 MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV RAX,qword ptr [RAX] ADD RAX,0x28 MOV RDX,qword ptr [RAX] MOV RAX,qword ptr [RBP + local_10+0x8] MOV RAX,qword ptr [RAX + 0x8] MOV this,RAX CALL RDX MOVD EAX,XMM0 MOV RDX,qword ptr [RBP + local_10+0x8] MOV dword ptr [RDX + 0x34],EAX LAB_0025e912: NOP LEAVE RET ?? 90h
void Automation::_ui_changed_callback() { if (has_pre_play_capture) { pre_play_capture_value = port->get(); //update pre play capture because UI modified it } }
void _changed::changed_changed() { if (_changed) _changed->changed(); }
;************************************************************************************************************************************************************ ;* Automation::_ui_changed_callbacks(void*) * ;************************************************************************************************************************************************************ ;undefined _ui_changed_callbacks(void * param_1) ;param_1 void * RDI ;local_10 undefined8 -10 ;local_20 undefined8 -20 PUSH RBP MOV RBP,RSP SUB RSP,0x20 MOV qword ptr [RBP + local_20+0x8],param_1 MOV RAX,qword ptr [RBP + local_20+0x8] MOV qword ptr [RBP + local_10+0x8],RAX MOV RAX,qword ptr [RBP + local_10+0x8] MOV param_1,RAX CALL Automation::_ui_changed_callback ;undefined _ui_changed_callback(Autom... NOP LEAVE RET ?? 90h
void Automation::_ui_changed_callbacks(void *p_ud) { Automation *automation = (Automation *)p_ud; automation->_ui_changed_callback(); }
void _changed_changed_callback(void *data) { ui_changed_changed(); }
;************************************************************************************************************************************************************ ;* AudioLock::unlock() * ;************************************************************************************************************************************************************ ;undefined unlock(void) PUSH RBP MOV RBP,RSP NOP POP RBP RET ?? 0Fh
void AudioLock::unlock() { }
void Lock::unlock() { }
;************************************************************************************************************************************************************ ;* AudioLock::lock() * ;************************************************************************************************************************************************************ ;undefined lock(void) PUSH RBP MOV RBP,RSP NOP POP RBP RET ?? 90h
void AudioLock::lock() { }
void Lock::lock() { }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined demo_block_callback() MOV RCX,RDI MOV RDI,qword ptr [.bss:stderr] MOV R8D,ESI MOV R9,RDX MOV ESI,0x1 LEA RDX,[.rodata:s_demo_block_callback(_buffer-poin_00104008] ;= "demo_block_callback( buffer-point... XOR EAX,EAX JMP .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() ?? 66h f
static void demo_block_callback (void *buffer, int buffersize, void *data) { fprintf (stderr, "demo_block_callback( buffer-pointer=%p" " buffer-size=%i data='%s' )\n", buffer,buffersize,(char*)data); }
static void block_callback_block_callback (void *data, const char *buf, int len) { fprintf (stderr, "block_callback_block_callback_block_callback\n"); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzipwrap_use_memory_io() MOV dword ptr [.bss:zzip_memory_blocksize],EDI LEA RAX,[.data.rel.ro:zzip_memory_io.0] MOV qword ptr [.bss:zzip_memory_callback],RSI MOV qword ptr [.bss:zzip_memory_callbackdata],RDX RET ?? 0Fh
zzip_plugin_io_t zzipwrap_use_memory_io(int blocksize, zzipwrap_pfn_t callback, void *callbackdata) { static const struct zzip_plugin_io zzip_memory_io = { (void *) zzip_memory_open, (void *) zzip_memory_close, (void *) zzip_memory_read, (void *) zzip_memory_lseek, (void *) zzip_filesize, 0 }; /* Store blocksize and block-processing callback data */ zzip_memory_blocksize = blocksize; zzip_memory_callback = callback; zzip_memory_callbackdata = callbackdata; return (zzip_plugin_io_t) &zzip_memory_io; }
static VALUE io_memory_memory_memory(int argc, VALUE *argv, VALUE self) { input_memory_memory = &io_memory_memory; input_memory_memory = &io_memory_memory; return self; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_memory_lseek() CMP dword ptr [.data:zzip_memory_fd],EDI ;= FFFFFFFFh JNZ LAB_00102600 MOV ECX,dword ptr [.bss:zzip_memory_size] CMP EDX,0x1 JZ LAB_001025e8 CMP EDX,0x2 JZ LAB_001025d8 MOV EAX,dword ptr [.bss:zzip_memory_pos] TEST EDX,EDX JZ LAB_001025c8 LAB_001025b2: CMP EAX,ECX JL LAB_001025bf LEA EAX,[RCX + -0x1] MOV dword ptr [.bss:zzip_memory_pos],EAX LAB_001025bf: CDQE RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001025c8: MOV dword ptr [.bss:zzip_memory_pos],ESI MOV EAX,ESI JMP LAB_001025b2 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001025d8: LEA EAX,[RCX + -0x1] MOV dword ptr [.bss:zzip_memory_pos],EAX JMP LAB_001025b2 ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001025e8: MOV EAX,dword ptr [.bss:zzip_memory_pos] ADD EAX,ESI MOV dword ptr [.bss:zzip_memory_pos],EAX JMP LAB_001025b2 ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00102600: MOV RAX,-0x1 RET ?? 0Fh
ZZIP_memory off_t zzip_memory_lseek(int fildes, off_t offset, int whence) { /* Check file descriptor */ if (fildes!=zzip_memory_fd) { return(-1); } /* Change position pointer */ switch (whence) { case SEEK_SET: zzip_memory_pos=offset; break; case SEEK_CUR: zzip_memory_pos += offset; break; case SEEK_END: zzip_memory_pos = zzip_memory_size-1; break; } /* Limit position to the last byte of the file */ if (zzip_memory_pos>(zzip_memory_size-1)) { zzip_memory_pos=zzip_memory_size-1; } /* Return current position */ return(zzip_memory_pos); }
void z_memory_memory_memory(int n, int n) { if (n == 0) return; if (n == 1) n = 1; else if (n == 1) n = 1; else if (n == 1) n = 1; else if (n == 1) n = 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_memory_close() CMP dword ptr [.data:zzip_memory_fd],EDI ;= FFFFFFFFh JNZ LAB_001027f0 PUSH RBP MOV EBP,EDI MOV RDI,qword ptr [.bss:zzip_memory_buffer] TEST RDI,RDI JZ LAB_001027ac CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_001027ac: MOV qword ptr [.bss:zzip_memory_buffer],0x0 MOV EDI,EBP POP RBP MOV dword ptr [.bss:zzip_memory_bufferblock],0x0 MOV dword ptr [.bss:zzip_memory_pos],0x0 MOV dword ptr [.bss:zzip_memory_size],0x0 MOV dword ptr [.data:zzip_memory_fd],0xffffffff ;= FFFFFFFFh JMP .plt:close ;int close(int __fd) ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001027f0: MOV EAX,0xffffffff RET ?? 66h f
ZZIP_memory int zzip_memory_close(int fd) { /* Check file descriptor */ if (fd!=zzip_memory_fd) { return(-1); } /* Clear any memory buffer that might be laying around */ if (zzip_memory_buffer) { free(zzip_memory_buffer); } /* Reset variables */ zzip_memory_reset(); /* Close file */ return(close(fd)); }
static void close_memory_memory(void) { if (memory_memory!= NULL) { close(memory_memory); memory_memory = NULL; } if (memory_memory!= NULL) { memory_memory = NULL; } if (memory_memory!= NULL) { memory_memory = NULL; } memory_memory = NULL; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_memory_open() ;local_20 undefined8 -20 ;local_88 undefined8 -88 PUSH R12 MOV R12,RDI PUSH RBP MOV EBP,ESI SUB RSP,0xa8 MOV RDI,qword ptr [.bss:zzip_memory_buffer] MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0xb8],RAX XOR EAX,EAX TEST RDI,RDI JZ LAB_00102833 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00102833: MOV qword ptr [.bss:zzip_memory_buffer],0x0 MOV RDI,R12 MOV ESI,EBP MOV dword ptr [.bss:zzip_memory_bufferblock],0x0 MOV dword ptr [.bss:zzip_memory_pos],0x0 MOV dword ptr [.bss:zzip_memory_size],0x0 MOV dword ptr [.data:zzip_memory_fd],0xffffffff ;= FFFFFFFFh CALL .plt:<EXTERNAL>::__open_2 ;undefined __open_2() MOV R12D,EAX TEST EAX,EAX JS LAB_001028e0 MOV RSI,RSP MOV EDI,R12D CALL .plt:<EXTERNAL>::fstat ;int fstat(int __fd, stat * __buf) TEST EAX,EAX JS LAB_001028e0 MOV RAX,qword ptr [RSP + local_88+0xb8] TEST RAX,RAX JLE LAB_001028e0 MOVSXD RDI,dword ptr [.bss:zzip_memory_blocksize] MOV dword ptr [.bss:zzip_memory_size],EAX CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV dword ptr [.data:zzip_memory_fd],R12D ;= FFFFFFFFh MOV qword ptr [.bss:zzip_memory_buffer],RAX MOV dword ptr [.bss:zzip_memory_bufferblock],0xffffffff LAB_001028ba: MOV RAX,qword ptr [RSP + local_20+0xb8] SUB RAX,qword ptr FS:[0x28] JNZ LAB_001028e8 ADD RSP,0xa8 MOV EAX,R12D POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001028e0: MOV R12D,0xffffffff JMP LAB_001028ba LAB_001028e8: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr [RAX]
ZZIP_memory int zzip_memory_open(const char *pathname, int flags) { int fd; struct stat stat_buffer; /* Deallocate any memory buffer laying around */ if (zzip_memory_buffer) { free(zzip_memory_buffer); } /* Reset variables */ zzip_memory_reset(); /* Open file */ fd=open(pathname, flags); if (fd<0) { return(-1); } else { /* Get filesize */ if (fstat(fd, &stat_buffer)<0) { return(-1); } if (stat_buffer.st_size<1) { return(-1); } /* Store filesize */ zzip_memory_size = stat_buffer.st_size; /* Allocate readbuffer */ zzip_memory_buffer = malloc(zzip_memory_blocksize); /* Invalidate buffer block */ zzip_memory_bufferblock = -1; /* Store file descriptor */ zzip_memory_fd=fd; /* Return file descriptor */ return(fd); } }
int memory_memory_open (void) { int ret; if (memory_memory_memory == NULL) return -1; ret =memory_memory_open (memory_memory_memory); if (ret < 0) return -1; if (memory_memory_memory!= NULL) { free (memory_memory_memory); memory_memory_memory = NULL; } return ret; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_closedir() PUSH RBP TEST RDI,RDI JZ LAB_0010288c MOV RBP,RDI MOV RDI,qword ptr [RDI + 0x58] TEST RDI,RDI JZ LAB_00102880 CALL .plt:<EXTERNAL>::closedir ;int closedir(DIR * __dirp) MOV RDI,qword ptr [RBP + 0x60] CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV RDI,RBP CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) XOR EAX,EAX POP RBP RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00102880: MOV RDI,RBP CALL zzip_dir_close ;undefined zzip_dir_close() XOR EAX,EAX POP RBP RET LAB_0010288c: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x9 MOV EAX,0xffffffff POP RBP RET ?? 66h f
int zzip_closedir(ZZIP_DIR * dir) { if (! dir) { errno = EBADF; return -1; } if (USE_DIRENT && dir->realdir) { _zzip_closedir(dir->realdir); free(dir->realname); free(dir); return 0; } else { zzip_dir_close(dir); return 0; } }
int z_dir_close (z_dir_t *dir) { if (!dir) return 0; z_dir_close (dir->dir); free (dir->dir); free (dir); return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_opendir_ext_io() ;local_30 undefined8 -30 ;local_b0 undefined4 -b0 ;local_c8 undefined1 -c8 ;local_cc undefined4 -cc PUSH R14 MOV R14,RCX PUSH R13 MOV R13,RDX PUSH R12 PUSH RBP MOV RBP,RDI PUSH RBX MOV EBX,ESI SUB RSP,0xb0 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_30+0xd8],RAX XOR EAX,EAX AND ESI,0x14000 JZ LAB_001027a8 LAB_00102745: LEA RSI=>local_cc,[RSP + 0xc] MOV RCX,R14 MOV RDX,R13 MOV RDI,RBP CALL zzip_dir_open_ext_io ;undefined zzip_dir_open_ext_io() MOV R12,RAX TEST RAX,RAX JZ LAB_001027a0 LAB_00102760: MOV EBP,dword ptr [RSP + local_cc+0xd8] TEST EBP,EBP JNZ LAB_00102810 LAB_0010276c: MOV RAX,qword ptr [RSP + local_30+0xd8] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010282e ADD RSP,0xb0 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 POP R14 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001027a0: TEST BH,0x40 JZ LAB_00102760 NOP dword ptr [RAX] LAB_001027a8: LEA RSI=>local_c8,[RSP + 0x10] MOV RDI,RBP CALL .plt:<EXTERNAL>::stat ;int stat(char * __file, stat * __buf) TEST EAX,EAX JS LAB_00102745 MOV EAX,dword ptr [RSP + local_b0+0xd8] AND EAX,0xf000 CMP EAX,0x4000 JNZ LAB_00102745 MOV RDI,RBP CALL .plt:<EXTERNAL>::opendir ;DIR * opendir(char * __name) MOV R13,RAX TEST RAX,RAX JZ LAB_00102826 MOV ESI,0x78 MOV EDI,0x1 CALL .plt:<EXTERNAL>::calloc ;void * calloc(size_t __nmemb, size_t... MOV R12,RAX TEST RAX,RAX JZ LAB_00102833 MOV qword ptr [RAX + 0x58],R13 MOV RDI,RBP CALL .plt:<EXTERNAL>::strdup ;char * strdup(char * __s) MOV qword ptr [R12 + 0x60],RAX JMP LAB_0010276c ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102810: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV EDI,EBP MOV RBX,RAX CALL zzip_errno ;undefined zzip_errno() MOV dword ptr [RBX],EAX JMP LAB_0010276c LAB_00102826: XOR R12D,R12D JMP LAB_0010276c LAB_0010282e: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() LAB_00102833: MOV RDI,R13 CALL .plt:<EXTERNAL>::closedir ;int closedir(DIR * __dirp) JMP LAB_0010276c ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_opendir() XOR ECX,ECX
ZZIP_DIR * zzip_opendir_ext_io(zzip_char_t * filename, int o_modes, zzip_strings_t * ext, zzip_plugin_io_t io) { zzip_error_t e; ZZIP_DIR *dir; # ifdef ZZIP_HAVE_SYS_STAT_H struct stat st; # endif if (o_modes & (ZZIP_PREFERZIP | ZZIP_ONLYZIP)) goto try_zzip; try_real: # ifdef ZZIP_HAVE_SYS_STAT_H if (stat(filename, &st) >= 0 && S_ISDIR(st.st_mode)) { if (USE_DIRENT) { _zzip_DIR *realdir = _zzip_opendir(filename); if (realdir) { if (! (dir = (ZZIP_DIR *) calloc(1, sizeof(*dir)))) { _zzip_closedir(realdir); return 0; } else { dir->realdir = realdir; dir->realname = strdup(filename); return dir; } } } return 0; } # endif /* HAVE_SYS_STAT_H */ try_zzip: dir = zzip_dir_open_ext_io(filename, &e, ext, io); if (! dir && (o_modes & ZZIP_PREFERZIP)) goto try_real; if (e) errno = zzip_errno(e); return dir; }
static int file_open(const char *path, const char *path, int flags, struct stat *buf, int flags) { struct stat st; struct stat st; struct stat st; struct stat st; if (!path) return 0; st.st_mode = flags; st.st_mode = flags; st.st_mode = flags; st.st_mode = flags; st.st_mode = flags; st.st_flags = flags; if (!st.st_mode) return 0; st.st_flags = flags; st.st_flags = flags; st.st_flags = flags; st.st_flags = flags; st.st_flags = flags; if (!st.st_flags) return 0; st.st_flags = flags; if (!st.st_flags) return 0; st.st_flags = flags; if (!st.st_flags) return 0; st.st_flags = st.st_flags; if (!st.st_flags) return 0; if (!S_ISDIR(st.st_flags)) return 0; if (!S_ISDIR(st.st_flags)) return 0; if (!S_ISDIR(st.st_flags)) return 0; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_opendir() XOR ECX,ECX XOR EDX,EDX XOR ESI,ESI JMP zzip_opendir_ext_io ;undefined zzip_opendir_ext_io() ?? 0Fh
ZZIP_DIR * zzip_opendir(zzip_char_t * filename) { return zzip_opendir_ext_io(filename, 0, 0, 0); }
void zio_ext_ext_ext(zio_ext_t *ext) { zio_ext_ext_ext(ext, 0, 0, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_seekdir32() JMP zzip_seekdir ?? 66h f
void zzip_seekdir32(ZZIP_DIR * dir, long offset) { zzip_seekdir(dir, offset); }
static int z_dir_seek (z_dir_t *dir, const char *path, int flags) { return z_dir_seek (dir, path, flags); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_telldir32() JMP zzip_telldir ?? 66h f
long zzip_telldir32(ZZIP_DIR * dir) { if (sizeof(zzip_off_t) == sizeof(long)) { return zzip_telldir(dir); } else { off_t off = zzip_telldir(dir); if (off >= 0) { register long off32 = off; if (off32 == off) return off32; errno = EOVERFLOW; } return -1; } }
static int z_dir(const char *dir, const char *dir) { return z_dirdir(dir, dir); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_readdir() PUSH RBX TEST RDI,RDI JZ LAB_00102648 CMP qword ptr [RDI + 0x58],0x0 MOV RBX,RDI JZ LAB_00102600 CALL real_readdir ;undefined real_readdir() TEST EAX,EAX JZ LAB_00102640 LAB_001025f9: LEA RAX,[RBX + 0x40] POP RBX RET ?? 90h LAB_00102600: MOV RAX,qword ptr [RDI + 0x30] TEST RAX,RAX JZ LAB_00102640 LEA RDX,[RAX + 0x15] MOVZX ECX,word ptr [RAX + 0x10] MOV qword ptr [RDI + 0x50],RDX MOVZX EDX,byte ptr [RAX + 0x14] MOV dword ptr [RDI + 0x40],EDX MOV EDX,dword ptr [RAX + 0x4] MOV dword ptr [RDI + 0x44],EDX MOV EDX,dword ptr [RAX] ADD RAX,RCX TEST CX,CX MOV dword ptr [RDI + 0x48],EDX MOV EDX,0x0 CMOVZ RAX,RDX MOV qword ptr [RDI + 0x30],RAX JMP LAB_001025f9 ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00102640: XOR EAX,EAX POP RBX RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00102648: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x9 XOR EAX,EAX POP RBX RET ?? 66h f
ZZIP_DIRENT * zzip_readdir(ZZIP_DIR * dir) { if (! dir) { errno=EBADF; return 0; } if (USE_DIRENT && dir->realdir) { if (! real_readdir(dir)) return 0; } else { if (! dir->hdr) return 0; dir->dirent.d_name = dir->hdr->d_name; dir->dirent.d_compr = dir->hdr->d_compr; dir->dirent.d_csize = dir->hdr->d_csize; dir->dirent.st_size = dir->hdr->d_usize; if (! dir->hdr->d_reclen) dir->hdr = 0; else dir->hdr = (struct zzip_dir_hdr *) ((char *) dir->hdr + dir->hdr->d_reclen); } return &dir->dirent; }
int z_z_errno(z_z_t *z) { if (!z) return 0; if (z->buf) { z->buf = z->buf; z->buf = z->buf; } else { z->buf = z->buf; z->buf = z->buf; } if (z->buf) { z->buf = z->buf; } else { z->buf = z->buf; } return z->buf; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined real_readdir() ;local_30 undefined8 -30 ;local_1038 undefined1 -1038 ;local_1098 undefined8 -1098 ;local_10b0 undefined4 -10b0 PUSH R14 MOV ECX,0x12 PUSH R13 PUSH R12 PUSH RBP PUSH RBX MOV RBX,RDI SUB RSP,0x10a0 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_30+0x10c8],RAX XOR EAX,EAX MOV R12,RSP MOV RDI,R12 STOSQ.REP RDI MOV RDI,qword ptr [RBX + 0x58] CALL .plt:<EXTERNAL>::readdir ;dirent * readdir(DIR * __dirp) MOV RDX,RAX XOR EAX,EAX TEST RDX,RDX JZ LAB_00102568 LEA RBP,[RDX + 0x13] LEA R14=>local_1038,[RSP + 0x90] MOV RSI,qword ptr [RBX + 0x60] MOV EDX,0x1000 MOV qword ptr [RBX + 0x50],RBP MOV RDI,R14 MOV R13,R14 CALL .plt:<EXTERNAL>::__stpcpy_chk ;undefined __stpcpy_chk() MOV EDX,0x1 LEA RSI,[.rodata:DAT_00105174] ;= 2Fh / SUB R13,RAX MOV RDI,RAX LEA RCX,[R13 + 0x1000] CALL .plt:<EXTERNAL>::__memcpy_chk ;undefined __memcpy_chk() MOV RSI,RBP LEA RDX,[R13 + 0xfff] MOV RDI,RAX ADD RDI,0x1 CALL .plt:<EXTERNAL>::__strcpy_chk ;undefined __strcpy_chk() MOV RSI,R12 MOV RDI,R14 CALL .plt:<EXTERNAL>::stat ;int stat(char * __file, stat * __buf) CMP EAX,-0x1 JZ LAB_00102568 MOV RAX,qword ptr [RSP + local_1098+0x10c8] MOV dword ptr [RBX + 0x48],EAX MOV dword ptr [RBX + 0x44],EAX MOV EAX,dword ptr [RSP + local_10b0+0x10c8] TEST EAX,EAX JZ LAB_00102590 MOV EDX,EAX AND EDX,0xf000 CMP EDX,0x8000 JZ LAB_00102590 OR EAX,0x80000000 MOV dword ptr [RBX + 0x40],EAX MOV EAX,0x1 NOP word ptr [RAX + RAX*0x1] LAB_00102568: MOV RDX,qword ptr [RSP + local_30+0x10c8] SUB RDX,qword ptr FS:[0x28] JNZ LAB_0010259e ADD RSP,0x10a0 POP RBX POP RBP POP R12 POP R13 POP R14 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102590: MOV dword ptr [RBX + 0x40],0x0 MOV EAX,0x1 JMP LAB_00102568 LAB_0010259e: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
static int real_readdir(ZZIP_DIR * dir) { struct stat st = { 0 }; char filename[PATH_MAX]; struct dirent *dirent = _zzip_readdir(dir->realdir); if (! dirent) return 0; dir->dirent.d_name = dirent->d_name; strcpy(filename, dir->realname); strcat(filename, "/"); strcat(filename, dirent->d_name); if (stat(filename, &st) == -1) return -1; dir->dirent.d_csize = dir->dirent.st_size = st.st_size; if (st.st_mode) { if (! S_ISREG(st.st_mode)) { dir->dirent.d_compr = st.st_mode; dir->dirent.d_compr |= 0x80000000; /* makes it effectively negative, * but can still be fed to S_ISXXX(x) */ } else { dir->dirent.d_compr = 0; /* stored */ } } else { dir->dirent.d_compr = 0; /* stored */ } return 1; }
static int file_stat(struct stat *st) { struct stat st; struct stat st; struct stat st; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; if (st.st_mode) { st.st_mode = st.st_mode; st.st_mode = st.st_mode; } if (st.st_mode) { st.st_mode = st.st_mode; } if (st.st_mode) { st.st_mode = st.st_mode; } if (st.st_mode) { st.st_mode = st.st_mode; } if (st.st_mode) { st.st_mode = st.st_mode; } if (st.st_mode) { st.st_mode = st.st_mode; } if (st.st_mode) { st.st_mode = st.st_mode; } return st.st_mode; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_rewinddir() TEST RDI,RDI JZ LAB_001025c6 MOV R8,qword ptr [RDI + 0x58] TEST R8,R8 JNZ LAB_001025d0 MOV RAX,qword ptr [RDI + 0x28] MOV qword ptr [RDI + 0x30],RAX LAB_001025c6: RET ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001025d0: MOV RDI,R8 JMP .plt:LAB_001020d0 ?? 0Fh
void zzip_rewinddir(ZZIP_DIR * dir) { if (! dir) return; if (USE_DIRENT && dir->realdir) { _zzip_rewinddir(dir->realdir); return; } if (dir->hdr0) dir->hdr = dir->hdr0; else dir->hdr = 0; }
void zwin_winwin(zwin_t *zwin) { if (zwin->zwin) { zwin->zwin = zwin->zwin; zwin->zwin = NULL; zwin->zwin = NULL; } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_errno() CMP EDI,-0x1 JGE LAB_00102968 MOV EAX,dword ptr [.data:errnolist] LEA RDX,[.data:errnolist] TEST EAX,EAX JNZ LAB_0010295b JMP LAB_00102980 ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00102950: MOV EAX,dword ptr [RDX + 0x8]=>.data:errnolist[8] ADD RDX,0x8 TEST EAX,EAX JZ LAB_00102980 LAB_0010295b: CMP EDI,EAX JNZ LAB_00102950 MOV EAX,dword ptr [RDX + 0x4]=>.data:errnolist[4] RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102968: SUB RSP,0x8 CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV EAX,dword ptr [RAX] ADD RSP,0x8 RET ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00102980: MOV EAX,0x16 RET ?? 66h f
int zzip_errno(int errcode) { if (errcode >= -1) { return errno; } else { struct errnolistentry *err = errnolist; for (; err->code; err++) { if (err->code == errcode) return err->e_no; } return EINVAL; } }
int zlist_errno(void) { int i; for (i = 0; i < errno; i++) { if (errno == EINTR) return i; } return -1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_strerror_of() TEST RDI,RDI JZ LAB_00102910 MOV EDI,dword ptr [RDI + 0x4] JMP zzip_strerror ;undefined zzip_strerror() ?? 0Fh ?? 1Fh ?? 00h LAB_00102910: SUB RSP,0x8 CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV EDI,dword ptr [RAX] ADD RSP,0x8 JMP .plt:LAB_00102200 ?? 66h f
zzip_char_t * zzip_strerror_of(ZZIP_DIR * dir) { if (! dir) return strerror(errno); return zzip_strerror(dir->errcode); }
void z_z_errno (z_int *z) { if (z->z_errno) z_errno_errno (z); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_seek32() JMP zzip_seek ?? 66h f
long zzip_seek32(ZZIP_FILE * fp, long offset, int whence) { if (sizeof(zzip_off_t) == sizeof(long)) { return zzip_seek(fp, offset, whence); } else { off_t off = zzip_seek(fp, offset, whence); if (off >= 0) { register long off32 = off; if (off32 == off) return off32; errno = EOVERFLOW; } return -1; } }
int32_t zstream_seek(zstream *s, int32_t offset, int32_t offset) { return zstream_seek(s, offset, offset); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_tell32() JMP zzip_tell ?? 66h f
long zzip_tell32(ZZIP_FILE * fp) { if (sizeof(zzip_off_t) == sizeof(long)) { return zzip_tell(fp); } else { off_t off = zzip_tell(fp); if (off >= 0) { register long off32 = off; if (off32 == off) return off32; errno = EOVERFLOW; } return -1; } }
static int zfile_parse(zfile_t *zfile) { return zfile_parse(zfile); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_rewind() PUSH R12 PUSH RBP PUSH RBX TEST RDI,RDI JZ LAB_001039a1 MOV RBX,qword ptr [RDI] MOV RBP,RDI TEST RBX,RBX JZ LAB_00103970 MOV R12,qword ptr [RBX + 0x38] CMP R12,RDI JZ LAB_00103904 TEST R12,R12 JZ LAB_00103900 MOV RCX,qword ptr [R12] MOV RAX,qword ptr [R12 + 0xb8] XOR ESI,ESI MOV EDX,0x1 MOV EDI,dword ptr [RCX] CALL qword ptr [RAX + 0x18] TEST RAX,RAX JS LAB_0010399a MOV qword ptr [R12 + 0x40],RAX LAB_00103900: MOV qword ptr [RBX + 0x38],RBP LAB_00103904: MOV RAX,qword ptr [RBP + 0xb8] XOR EDX,EDX MOV RSI,qword ptr [RBP + 0x30] MOV EDI,dword ptr [RBX] CALL qword ptr [RAX + 0x18] TEST RAX,RAX JS LAB_001039a1 MOV RAX,qword ptr [RBP + 0x20] MOV R12D,dword ptr [RBP + 0xc] MOV qword ptr [RBP + 0x10],RAX MOV RAX,qword ptr [RBP + 0x30] MOV qword ptr [RBP + 0x40],RAX TEST R12D,R12D JNZ LAB_00103940 LAB_00103938: MOV EAX,R12D POP RBX POP RBP POP R12 RET LAB_00103940: LEA RDI,[RBP + 0x48] CALL .plt:<EXTERNAL>::inflateReset ;undefined inflateReset() MOV R12D,EAX TEST EAX,EAX JNZ LAB_00103990 MOV RAX,qword ptr [RBP + 0x28] MOV dword ptr [RBP + 0x50],0x0 MOV qword ptr [RBP + 0x18],RAX MOV EAX,R12D POP RBX POP RBP POP R12 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103970: MOV RAX,qword ptr [RBP + 0xb8] XOR R12D,R12D MOV EDI,dword ptr [RDI + 0x8] XOR EDX,EDX XOR ESI,ESI CALL qword ptr [RAX + 0x18] MOV EAX,R12D POP RBX POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00103990: MOV RDI,RBP CALL zzip_file_close ;undefined zzip_file_close() JMP LAB_00103938 LAB_0010399a: MOV dword ptr [RBX + 0x4],0xffffefe9 LAB_001039a1: MOV R12D,0xffffffff JMP LAB_00103938 ?? 0Fh
int zzip_rewind(ZZIP_FILE * fp) { ZZIP_DIR *dir; int err; if (! fp) return -1; if (! fp->dir) { /* stat fd */ fp->io->fd.seeks(fp->fd, 0, SEEK_SET); return 0; } dir = fp->dir; /* * If this is other handle than previous, save current seek pointer */ if (dir->currentfp!= fp) { if (zzip_file_saveoffset(dir->currentfp) < 0) { dir->errcode = ZZIP_DIR_SEEK; return -1; } else { dir->currentfp = fp; } } /* seek to beginning of this file */ if (fp->io->fd.seeks(dir->fd, fp->dataoffset, SEEK_SET) < 0) return -1; /* reset the inflate init stuff */ fp->restlen = fp->usize; fp->offset = fp->dataoffset; if (fp->method) { /* method == 8, deflate */ err = inflateReset(&fp->d_stream); if (err!= Z_OK) goto error; /* start over at next inflate with a fresh read() */ fp->d_stream.avail_in = 0; fp->crestlen = fp->csize; } return 0; error: if (fp) zzip_file_close(fp); return err; }
static int zfile_close(zfile_t *zfile) { zfile_t *zfile = zfile->zfile; zfile_t *zfile = zfile->zfile; zfile_t *zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; zfile->zfile = zfile->zfile; return (0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_open_ext_io() PUSH R12 MOV R9,R8 POP R12 MOV R8,RCX MOV ECX,EDX MOV EDX,ESI MOV RSI,RDI XOR EDI,EDI JMP zzip_open_shared_io ;undefined zzip_open_shared_io() ?? 0Fh
ZZIP_FILE * zzip_open_ext_io(zzip_char_t * filename, int o_flags, int o_modes, zzip_strings_t * ext, zzip_plugin_io_t io) { return zzip_open_shared_io(0, filename, o_flags, o_modes, ext, io); }
int zio_io_open_io(zio_t *io, const char *name, int flags) { return zio_io_open_io(io, name, flags, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_open() MOV EDX,0x1b4 TEST ESI,0x400 JZ LAB_00103888 XOR ESI,0x400 MOV EDX,0x11b4 LAB_00103888: TEST ESI,0x200 JZ LAB_00103899 XOR ESI,0x200 OR DH,0x20 LAB_00103899: XOR R8D,R8D XOR ECX,ECX JMP zzip_open_ext_io ;undefined zzip_open_ext_io() ?? 66h f
ZZIP_FILE * zzip_open(zzip_char_t * filename, int o_flags) { /* backward compatibility */ int o_modes = 0664; if (o_flags & ZZIP_CASEINSENSITIVE) { o_flags ^= ZZIP_CASEINSENSITIVE; o_modes |= ZZIP_CASELESS; } if (o_flags & ZZIP_IGNOREPATH) { o_flags ^= ZZIP_IGNOREPATH; o_modes |= ZZIP_NOPATHS; } return zzip_open_ext_io(filename, o_flags, o_modes, 0, 0); }
int zio_open_ext(zio_t *zio) { return zio_open_ext(zio, 0, 0, 0, 0, 0, 0, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_fopen() XOR EDX,EDX JMP zzip_freopen ;undefined zzip_freopen() ?? 66h f
ZZIP_FILE * zzip_fopen(zzip_char_t * filename, zzip_char_t * mode) { return zzip_freopen(filename, mode, 0); }
int z_open(const char *filename, const char *name) { return z_open(filename, name, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_fread() TEST RSI,RSI MOV EAX,0x1 PUSH RBX MOV R8,RDI CMOVNZ RAX,RSI MOV RDI,RCX MOV RSI,R8 IMUL RDX,RAX MOV RBX,RAX CALL zzip_read ;undefined zzip_read() XOR EDX,EDX DIV RBX POP RBX RET ?? 0Fh
zzip_size_t zzip_fread(void *ptr, zzip_size_t size, zzip_size_t nmemb, ZZIP_FILE * file) { if (! size) size = 1; return zzip_read(file, ptr, size * nmemb) / size; }
uint64_t zio_read(const void *buf, size_t len, void *buf, size_t size) { uint64_t ret; ret = zio_read(buf, len, buf, size); if (ret < 0) return ret; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_pread() PUSH R13 MOV R13,RDX XOR EDX,EDX PUSH R12 MOV R12,RSI MOV RSI,RCX PUSH RBP MOV RBP,RDI CALL zzip_seek ;undefined zzip_seek() TEST RAX,RAX JS LAB_00103c40 MOV RDX,R13 MOV RSI,R12 MOV RDI,RBP POP RBP POP R12 POP R13 JMP zzip_read ;undefined zzip_read() LAB_00103c40: POP RBP MOV RAX,-0x1 POP R12 POP R13 RET ?? 0Fh
zzip_size_t zzip_pread(ZZIP_FILE *file, void *ptr, zzip_size_t size, zzip_off_t offset) { #ifdef ZZIP_HAVE_PREAD if (file->dir == NULL) { /* reading from a regular file */ return pread(file->fd, ptr, size, offset); } else if (file->method == 0) { /* uncompressed: can read directly from the ZIP file using pread() */ offset += file->dataoffset; return pread(file->dir->fd, ptr, size, offset); } else { #endif /* compressed (or no pread() system call): fall back to zzip_seek() + zzip_read() */ return zzip_pread_fallback(file, ptr, size, offset); #ifdef ZZIP_HAVE_PREAD } #endif }
static ssize_t z_read (const char *buf, size_t size, void *buf, size_t count) { return z_read (buf, size, buf, count); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_close() JMP zzip_fclose ?? 66h f
int zzip_close(ZZIP_FILE * fp) { return zzip_fclose(fp); }
static void z_close (void *handle) { z_z_close (handle); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined dirsep_strcasecmp() MOVZX ECX,byte ptr [RDI] LEA R9,[.rodata:mapping.0] ;= "@abcdefghijklmnopqrstuvwxyz[/]^_" TEST CL,CL JNZ LAB_001029de JMP LAB_001029f9 LAB_001029a0: MOV R8D,ECX AND R8D,0xffffffe0 CMP R8B,0x40 JNZ LAB_001029b5 AND ECX,0x1f MOVSX EAX,byte ptr [R9 + RCX*0x1]=>.rodata:mapping.0 ;= "@abcdefghijklmnopqrstuvwxyz[/]^_" LAB_001029b5: MOV ECX,EDX AND ECX,0xffffffe0 CMP CL,0x40 JNZ LAB_001029c7 AND EDX,0x1f MOVSX EDX,byte ptr [R9 + RDX*0x1]=>.rodata:mapping.0 ;= "@abcdefghijklmnopqrstuvwxyz[/]^_" LAB_001029c7: CMP EAX,EDX JNZ LAB_001029e8 MOVZX ECX,byte ptr [RDI + 0x1] ADD RDI,0x1 LEA RAX,[RSI + 0x1] TEST CL,CL JZ LAB_001029f0 MOV RSI,RAX LAB_001029de: MOVZX EDX,byte ptr [RSI] MOVZX EAX,CL TEST DL,DL JNZ LAB_001029a0 LAB_001029e8: SUB EAX,EDX RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001029f0: MOVZX EDX,byte ptr [RSI + 0x1] XOR EAX,EAX SUB EAX,EDX RET LAB_001029f9: MOVZX EDX,byte ptr [RSI] XOR EAX,EAX JMP LAB_001029e8 ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined strrchr_basename() PUSH RBX
static int dirsep_strcasecmp(zzip_char_t * s1, zzip_char_t * s2) { /* ASCII tolower - including mapping of backslash in normal slash */ static const char mapping[] = "@abcdefghijklmnopqrstuvwxyz[/]^_"; int c1, c2; while (*s1 && *s2) { c1 = (int) (unsigned char) *s1; c2 = (int) (unsigned char) *s2; if ((c1 & 0xE0) == 0x40) c1 = mapping[c1 & 0x1f]; if ((c2 & 0xE0) == 0x40) c2 = mapping[c2 & 0x1f]; if (c1!= c2) return (c1 - c2); s1++; s2++; } return (((int) (unsigned char) *s1) - ((int) (unsigned char) *s2)); }
static int is_strcasecmp(const char *s1, const char *s2) { int i; for (i = 0; *s1!= *s2; i++) { if (*s1 == *s2) return 1; } return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_init_io() TEST RDI,RDI JZ LAB_00103d1e MOVDQA XMM0,xmmword ptr [.data.rel.ro:default_io] MOVSXD RSI,ESI XOR EAX,EAX MOVDQA XMM1,xmmword ptr [.data.rel.ro:default_io[16]] MOVDQA XMM2,xmmword ptr [.data.rel.ro:default_io[32]] MOVDQA XMM3,xmmword ptr [.data.rel.ro:default_io[48]] MOVUPS xmmword ptr [RDI],XMM0 MOVUPS xmmword ptr [RDI + 0x20],XMM2 MOVUPS xmmword ptr [RDI + 0x10],XMM1 MOV qword ptr [RDI + 0x28],RSI MOVUPS xmmword ptr [RDI + 0x30],XMM3 RET LAB_00103d1e: MOV EAX,0xfffff000 RET ?? 66h f
int zzip_init_io(zzip_plugin_io_handlers_t io, int flags) { if (! io) { return ZZIP_ERROR; } memcpy(io, &default_io, sizeof(default_io)); io->fd.sys = flags; return 0; }
int zio_init_io(zio_io_t *io, zio_io_t *io) { if (!io) return EINVAL; io->io = io; io->io = io; io->io = io; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_get_default_io() LEA RAX,[.data.rel.ro:default_io] RET ?? 0Fh
zzip_plugin_io_t zzip_get_default_io(void) { return (zzip_plugin_io_t) & default_io; }
const char * ioio_get_default (void) { return &ioio_default; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_filesize() ;local_10 undefined8 -10 ;local_78 undefined8 -78 SUB RSP,0xa8 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_10+0xa8],RAX XOR EAX,EAX MOV RSI,RSP CALL .plt:<EXTERNAL>::fstat ;int fstat(int __fd, stat * __buf) TEST EAX,EAX JS LAB_00103cb6 MOV RAX,qword ptr [RSP + local_78+0xa8] LAB_00103c9b: MOV RDX,qword ptr [RSP + local_10+0xa8] SUB RDX,qword ptr FS:[0x28] JNZ LAB_00103cbf ADD RSP,0xa8 RET LAB_00103cb6: MOV RAX,-0x1 JMP LAB_00103c9b LAB_00103cbf: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
zzip_off_t zzip_filesize(int fd) { struct stat st; if (fstat(fd, &st) < 0) return -1; # if defined DEBUG &&! defined _WIN32 if (! st.st_size && st.st_blocks > 1) /* seen on some darwin 10.1 machines */ fprintf(stderr, "broken fstat(2)?? st_size=%ld st_blocks=%ld\n", (long) st.st_size, (long) st.st_blocks); # endif return st.st_size; }
static int z_cb(int fd) { struct stat st; if (fstat(fd, &st) < 0) return -1; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_read() TEST RDI,RDI JZ LAB_001046d8 MOV RAX,qword ptr [RDI + 0x30] TEST RSI,RSI JZ LAB_001046d8 TEST RAX,RAX JZ LAB_001046d8 MOVZX EDX,byte ptr [RAX + 0x14] MOV dword ptr [RSI],EDX MOV EDX,dword ptr [RAX + 0x4] MOV dword ptr [RSI + 0x4],EDX MOV EDX,dword ptr [RAX] MOV dword ptr [RSI + 0x8],EDX LEA RDX,[RAX + 0x15] MOV qword ptr [RSI + 0x10],RDX MOVZX EDX,word ptr [RAX + 0x10] TEST DX,DX JNZ LAB_001046c8 MOV qword ptr [RDI + 0x30],0x0 MOV EAX,0x1 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001046c8: ADD RAX,RDX MOV qword ptr [RDI + 0x30],RAX MOV EAX,0x1 RET ?? 0Fh ?? 1Fh ?? 00h LAB_001046d8: XOR EAX,EAX RET ?? 0Fh
int zzip_dir_read(ZZIP_DIR * dir, ZZIP_DIRENT * d) { if (! dir ||! dir->hdr ||! d) return 0; d->d_compr = dir->hdr->d_compr; d->d_csize = dir->hdr->d_csize; d->st_size = dir->hdr->d_usize; d->d_name = dir->hdr->d_name; if (! dir->hdr->d_reclen) { dir->hdr = 0; } else { dir->hdr = (struct zzip_dir_hdr *) ((char *) dir->hdr + dir->hdr->d_reclen); } return 1; }
int z_dir_read_dir(z_dir_t *zdir, z_dir_t *dir) { z_dir_t *zdir = zdir->zdir; z_dir_t *zdir = zdir->zdir; if (!zdir) return 0; zdir->zdir = zdir->zdir; zdir->zdir = zdir->zdir; zdir->zdir = zdir->zdir; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_open_ext_io() PUSH R14 MOV R14,RDI PUSH R13 MOV R13,RCX PUSH R12 MOV R12,RDX PUSH RBP MOV RBP,RSI SUB RSP,0x8 TEST RCX,RCX JZ LAB_00104660 LAB_001045ec: TEST R12,R12 LEA RAX,[.data.rel.ro:ext.0] MOV RDI,R14 CMOVZ R12,RAX XOR ESI,ESI XOR EAX,EAX CALL qword ptr [R13] MOV RCX,R13 MOV EDI,EAX MOV RDX,R12 CMP EAX,-0x1 JNZ LAB_00104629 MOV RDI,R14 XOR ESI,ESI CALL __zzip_try_open ;undefined __zzip_try_open() MOV EDI,EAX CMP EAX,-0x1 JZ LAB_00104640 MOV RCX,R13 MOV RDX,R12 LAB_00104629: ADD RSP,0x8 MOV RSI,RBP POP RBP POP R12 POP R13 POP R14 JMP zzip_dir_fdopen_ext_io ;undefined zzip_dir_fdopen_ext_io() ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00104640: TEST RBP,RBP JZ LAB_0010464c MOV dword ptr [RBP],0xffffefeb LAB_0010464c: ADD RSP,0x8 XOR EAX,EAX POP RBP POP R12 POP R13 POP R14 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00104660: CALL zzip_get_default_io ;undefined zzip_get_default_io() MOV R13,RAX JMP LAB_001045ec ?? 66h f
ZZIP_DIR * zzip_dir_open_ext_io(zzip_char_t * filename, zzip_error_t * e, zzip_strings_t * ext, zzip_plugin_io_t io) { int fd; if (! io) io = zzip_get_default_io(); if (! ext) ext = zzip_get_default_ext(); fd = (io->fd.open)(filename, O_RDONLY | O_BINARY); if (fd!= -1) { return zzip_dir_fdopen_ext_io(fd, e, ext, io); } else { fd = __zzip_try_open(filename, O_RDONLY | O_BINARY, ext, io); if (fd!= -1) { return zzip_dir_fdopen_ext_io(fd, e, ext, io); } else { if (e) { *e = ZZIP_DIR_OPEN; } return 0; } } }
static int zio_open_io(zio_t *zio, const char *name, const char *buf, size_t len) { return zio_open_io(zio, name, len, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_open() XOR ECX,ECX XOR EDX,EDX JMP zzip_dir_open_ext_io ;undefined zzip_dir_open_ext_io() ?? 0Fh
ZZIP_DIR * zzip_dir_open(zzip_char_t * filename, zzip_error_t * e) { return zzip_dir_open_ext_io(filename, e, 0, 0); }
int zio_zio_open (zio_zio_t *zio, const char *filename) { return zio_zio_open (zio, filename, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __zzip_try_open() ;local_40 undefined8 -40 PUSH R15 MOV R15,RDI PUSH R14 MOV R14,RDX PUSH R13 PUSH R12 MOV R12D,ESI PUSH RBP MOV RBP,RCX PUSH RBX SUB RSP,0x1018 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_40+0x1048],RAX XOR EAX,EAX CALL .plt:<EXTERNAL>::strlen ;size_t strlen(char * __s) MOV RBX,RAX ADD RAX,0x4 CMP RAX,0xfff JA LAB_001045ad MOV R13,RSP LEA RDX,[RBX + 0x1] MOV ECX,0x1000 MOV RSI,R15 MOV RDI,R13 CALL .plt:<EXTERNAL>::__memcpy_chk ;undefined __memcpy_chk() TEST RBP,RBP JZ LAB_001045a0 LAB_00104518: TEST R14,R14 JZ LAB_00104590 MOV RSI,qword ptr [R14] TEST RSI,RSI JZ LAB_00104580 LAB_00104525: ADD RBX,R13 JMP LAB_0010453d ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00104530: MOV RSI,qword ptr [R14 + 0x8] ADD R14,0x8 TEST RSI,RSI JZ LAB_00104580 LAB_0010453d: MOV RDI,RBX CALL .plt:<EXTERNAL>::strcpy ;char * strcpy(char * __dest, char *... XOR EAX,EAX MOV ESI,R12D MOV RDI,R13 CALL qword ptr [RBP] CMP EAX,-0x1 JZ LAB_00104530 LAB_00104555: MOV RDX,qword ptr [RSP + local_40+0x1048] SUB RDX,qword ptr FS:[0x28] JNZ LAB_001045bf ADD RSP,0x1018 POP RBX POP RBP POP R12 POP R13 POP R14 POP R15 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00104580: MOV EAX,0xffffffff JMP LAB_00104555 ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104590: LEA R14,[.data.rel.ro:ext.0] LEA RSI,[.rodata:DAT_001054a1] ;= 2Eh . JMP LAB_00104525 LAB_001045a0: CALL zzip_get_default_io ;undefined zzip_get_default_io() MOV RBP,RAX JMP LAB_00104518 LAB_001045ad: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x24 MOV EAX,0xffffffff JMP LAB_00104555 LAB_001045bf: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
int __zzip_try_open(zzip_char_t * filename, int filemode, zzip_strings_t * ext, zzip_plugin_io_t io) { auto char file[PATH_MAX]; int fd; zzip_size_t len = strlen(filename); if (len + 4 >= PATH_MAX) { errno = ENAMETOOLONG; return -1; } memcpy(file, filename, len + 1); if (! io) io = zzip_get_default_io(); if (! ext) ext = zzip_get_default_ext(); for (; *ext; ++ext) { strcpy(file + len, *ext); fd = (io->fd.open)(file, filemode); if (fd!= -1) return fd; } return -1; }
int zio_open(zio_t *zio, const char *name, const char *value, size_t len) { int ret; char *p; size_t len; if (!name) return -1; p = zio_open(zio, name, len); if (p == NULL) { return -1; } len = strlen(name); if (len == 0) { return -1; } p[len] = '\0'; p[len] = '\0'; p[len] = '\0'; p[len] = '\0'; ret = zio_open(zio, p, len); if (ret < 0) { return -1; } return ret; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_fdopen() XOR ECX,ECX XOR EDX,EDX JMP zzip_dir_fdopen_ext_io ;undefined zzip_dir_fdopen_ext_io() ?? 0Fh
ZZIP_DIR * zzip_dir_fdopen(int fd, zzip_error_t * errcode_p) { return zzip_dir_fdopen_ext_io(fd, errcode_p, 0, 0); }
int zio_ext_ext_ext_ext(zio_ext_t *zio, const char *ext) { return zio_ext_ext_ext_ext_ext(zio,ext, 0, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_close() AND qword ptr [RDI + 0x8],-0x10000001 JMP zzip_dir_free ;undefined zzip_dir_free() ?? 0Fh
int zzip_dir_close(ZZIP_DIR * dir) { dir->refcount &= ~0x10000000; /* explicit dir close */ return zzip_dir_free(dir); }
void zdir_free_dir(zdir_t *zdir) { zdir_close_dir(zdir); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_alloc() XOR ESI,ESI JMP zzip_dir_alloc_ext_io ;undefined zzip_dir_alloc_ext_io() ?? 66h f
ZZIP_DIR * zzip_dir_alloc(zzip_strings_t * fileext) { return zzip_dir_alloc_ext_io(fileext, 0); }
size_t zio_ext_alloc_ext(zio_ext_t *zio) { return zio_ext_alloc_ext(zio, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_alloc_ext_io() PUSH R12 PUSH RBP MOV RBP,RSI MOV ESI,0x78 PUSH RBX MOV RBX,RDI MOV EDI,0x1 CALL .plt:<EXTERNAL>::calloc ;void * calloc(size_t __nmemb, size_t... MOV R12,RAX TEST RAX,RAX JZ LAB_00103ffe TEST RBX,RBX LEA RAX,[.data.rel.ro:ext.0] CMOVZ RBX,RAX MOV qword ptr [R12 + 0x68],RBX TEST RBP,RBP JZ LAB_00104010 LAB_00103ff9: MOV qword ptr [R12 + 0x70],RBP LAB_00103ffe: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104010: CALL zzip_get_default_io ;undefined zzip_get_default_io() MOV RBP,RAX JMP LAB_00103ff9 ?? 66h f
ZZIP_DIR * zzip_dir_alloc_ext_io(zzip_strings_t * ext, const zzip_plugin_io_t io) { ZZIP_DIR *dir; if ((dir = (ZZIP_DIR *) calloc(1, sizeof(*dir))) == NULL) return 0; /* dir->fileext is currently unused - so what, still initialize it */ dir->fileext = ext? ext : zzip_get_default_ext(); dir->io = io? io : zzip_get_default_io(); return dir; }
static void * zio_get_io_io_alloc (zio_io_t *io, void *data, size_t size) { zio_io_io_t *io = zio_alloc (sizeof (zio_io_io_t)); if (!io) return NULL; if (!io) return NULL; io->io = zio_io_alloc (io, size); return io; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() PUSH R13 PUSH R12 PUSH RBP CMP EDI,0x1 JLE LAB_001022c8 MOV R13,qword ptr [RSI + 0x8] MOV EBP,EDI MOV R12,RSI LEA RSI,[.rodata:s_--help_00105004] ;= "--help" MOV RDI,R13 CALL .plt.got:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JZ LAB_001022c8 LEA RSI,[.rodata:s_--version_0010500b] ;= "--version" MOV RDI,R13 CALL .plt.got:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JZ LAB_001022e3 MOV RSI,R12 MOV EDI,EBP POP RBP POP R12 POP R13 JMP rezzip_make ;undefined rezzip_make() LAB_001022c8: LEA RSI,[.rodata:usage] ;= "zzip <dir> files... \n - zzip th... MOV EDI,0x1 XOR EAX,EAX CALL .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() LAB_001022db: POP RBP XOR EAX,EAX POP R12 POP R13 RET LAB_001022e3: LEA RDI,[.rodata:s_./bins/zzip.c_version_zziplib_0._00105018] ;= "./bins/zzip.c version zziplib 0.1... CALL .plt:<EXTERNAL>::puts ;int puts(char * __s) JMP LAB_001022db ?? 66h f
int main (int argc, char ** argv) { int argn; int exitcode = 0; ZZIP_DIR * dir; if (argc <= 1 ||! strcmp (argv[1], "--help")) { printf (usage); return 0; } if (! strcmp (argv[1], "--version")) { # if defined _ZZIP_ENABLE_WRITE printf (__FILE__ " version " ZZIP_PACKAGE_NAME " " ZZIP_PACKAGE_VERSION " - W/ -D_ZZIP_ENABLE_WRITE\n"); # else printf (__FILE__ " version " ZZIP_PACKAGE_NAME " " ZZIP_PACKAGE_VERSION " - NO -D_ZZIP_ENABLE_WRITE\n"); # endif return 0; } return rezzip_make(argc, argv); }
int main(int argc, char **argv) { if (argc!= 2) { printf("Usage: %s\n", argv[0]); return 0; } if (argc!= 2) { printf("Usage: %s\n", argv[1]); return 0; } if (argc!= 2) { printf("Usage: %s\n", argv[1]); return 0; } printf("Usage: %s\n", argv[2]); return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_fwrite() IMUL RDX,RSI MOV R8,RDI SUB RSP,0x8 MOV RDI,RCX MOV RSI,R8 CALL zzip_write ;undefined zzip_write() XOR EDX,EDX CMP RAX,-0x1 CMOVZ RAX,RDX ADD RSP,0x8 RET ?? 66h f
zzip_size_t zzip_fwrite(const void *ptr, zzip_size_t len, zzip_size_t multiply, ZZIP_FILE * file) { zzip_ssize_t value = zzip_write(file, ptr, len * multiply); if (value == -1) value = 0; return (zzip_size_t) value; }
size_t zz_write(const void *buf, size_t size, const void *buf, size_t size) { return zz_write(buf, size, buf, size); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_file_write() SUB RSP,0x8 CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x1e MOV RAX,-0x1 ADD RSP,0x8 RET ?? 0Fh
zzip_ssize_t zzip_file_write(ZZIP_FILE * file, const void *ptr, zzip_size_t len) { if (! _ZZIP_TRY) { /* not implemented */ errno = EROFS; return -1; } else { /* add calls to zlib here... */ errno = EROFS; return -1; } }
static int write_file_write (void) { errno = 0; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_file_creat() TEST RDI,RDI JZ LAB_00103b50 SUB RSP,0x8 CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x1e XOR EAX,EAX ADD RSP,0x8 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103b50: MOV RDI,RSI MOV ESI,EDX JMP zzip_open ;undefined zzip_open() ?? 66h f
ZZIP_FILE * zzip_file_creat(ZZIP_DIR * dir, zzip_char_t * name, int o_mode) { if (! dir) return zzip_open(name, o_mode); if (! _ZZIP_TRY) { /* not implemented */ errno = EROFS; return 0; } else { errno = EROFS; return 0; } }
int z_file_open (z_file_t file, const char *filename) { if (file == NULL) return 0; z_file_open (file, 1); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_file_mkdir() TEST RDI,RDI JNZ LAB_00103b10 MOV RDI,RSI MOV ESI,EDX JMP .plt:<EXTERNAL>::mkdir ;int mkdir(char * __path, __mode_t __... ?? 90h LAB_00103b10: SUB RSP,0x8 CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x1e MOV EAX,0xffffffff ADD RSP,0x8 RET ?? 0Fh
int zzip_file_mkdir(ZZIP_DIR * dir, zzip_char_t * name, int o_mode) { if (! dir) return _zzip_mkdir(name, o_mode); if (! _ZZIP_TRY) { /* not implemented */ errno = EROFS; return -1; } else { errno = EROFS; return -1; } }
int z_file_mode (const char *path, const char *mode) { if (!path) { errno = EINVAL; return -1; } else { errno = EINVAL; return -1; } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_createdir() PUSH RBP MOV RBP,RDI TEST SIL,0x10 JZ LAB_00103ae0 CALL .plt:<EXTERNAL>::mkdir ;int mkdir(char * __path, __mode_t __... CMP EAX,-0x1 JNZ LAB_00103ace CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) CMP dword ptr [RAX],0x11 JNZ LAB_00103af0 LAB_00103ace: MOV RDI,RBP POP RBP JMP zzip_opendir ;undefined zzip_opendir() ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103ae0: POP RBP JMP zzip_dir_creat ;undefined zzip_dir_creat() ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103af0: XOR EAX,EAX POP RBP RET ?? 66h f
ZZIP_DIR * zzip_createdir(zzip_char_t * name, int o_mode) { if (o_mode & S_IWGRP) { if (-1 == _zzip_mkdir(name, o_mode) && errno!= EEXIST) /* fail */ return 0; return zzip_opendir(name); } else return zzip_dir_creat(name, o_mode); }
int z_dir (const char *path) { int result = 0; if (path == NULL) { result = 1; } return result; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_creat() XOR ECX,ECX XOR EDX,EDX JMP zzip_dir_creat_ext_io ;undefined zzip_dir_creat_ext_io() ?? 0Fh
ZZIP_DIR * zzip_dir_creat(zzip_char_t * name, int o_mode) { return zzip_dir_creat_ext_io(name, o_mode, 0, 0); }
int zio_ext_ext_ext(zio_ext_t *zio, zio_ext_t *ext) { return zio_ext_ext_ext_ext_ext(zio, ext, 0, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_mem_disk_cat_file() ;local_20 undefined8 -20 PUSH R12 MOV R12,RDX PUSH RBP PUSH RBX SUB RSP,0x410 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x428],RAX XOR EAX,EAX CALL zzip_mem_disk_fopen ;undefined zzip_mem_disk_fopen() TEST RAX,RAX JZ LAB_001027cc MOV RBP,RAX MOV RBX,RSP JMP LAB_001027ab ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102798: MOVSXD RDX,EAX MOV RCX,R12 MOV ESI,0x1 MOV RDI,RBX CALL .plt:<EXTERNAL>::fwrite ;size_t fwrite(void * __ptr, size_t _... LAB_001027ab: MOV RCX,RBP MOV EDX,0x400 MOV ESI,0x1 MOV RDI,RBX CALL zzip_mem_disk_fread ;undefined zzip_mem_disk_fread() TEST EAX,EAX JG LAB_00102798 MOV RDI,RBP CALL zzip_mem_disk_fclose ;undefined zzip_mem_disk_fclose() LAB_001027cc: MOV RAX,qword ptr [RSP + local_20+0x428] SUB RAX,qword ptr FS:[0x28] JNZ LAB_001027eb ADD RSP,0x410 POP RBX POP RBP POP R12 RET LAB_001027eb: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_cat() ;local_40 undefined8 -40 ;local_44 undefined4 -44 PUSH R15
static void unzzip_mem_disk_cat_file(ZZIP_MEM_DISK* disk, char* name, FILE* out) { ZZIP_DISK_FILE* file = zzip_mem_disk_fopen (disk, name); if (file) { char buffer[1025]; int len; while (0 < (len = zzip_mem_disk_fread (buffer, 1, 1024, file))) { fwrite (buffer, 1, len, out); } zzip_mem_disk_fclose (file); } }
int z_mem_mem_mem_mem(FILE *fp, FILE *fp) { FILE *fp; FILE *fp; fp = z_mem_mem_mem(fp, fp); if (!fp) return 0; fp = z_mem_mem_mem(fp, fp); z_mem_mem_mem(fp, fp); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_mem_entry_fprint() ;local_20 undefined8 -20 PUSH R12 MOV R12,RDX PUSH RBP PUSH RBX SUB RSP,0x410 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x428],RAX XOR EAX,EAX CALL zzip_mem_entry_fopen ;undefined zzip_mem_entry_fopen() TEST RAX,RAX JZ LAB_0010273c MOV RBP,RAX MOV RBX,RSP JMP LAB_0010271b ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102708: MOVSXD RSI,EAX MOV RCX,R12 MOV EDX,0x1 MOV RDI,RBX CALL .plt:<EXTERNAL>::fwrite ;size_t fwrite(void * __ptr, size_t _... LAB_0010271b: MOV RCX,RBP MOV EDX,0x1 MOV ESI,0x400 MOV RDI,RBX CALL zzip_mem_disk_fread ;undefined zzip_mem_disk_fread() TEST EAX,EAX JG LAB_00102708 MOV RDI,RBP CALL zzip_mem_disk_fclose ;undefined zzip_mem_disk_fclose() LAB_0010273c: MOV RAX,qword ptr [RSP + local_20+0x428] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010275b ADD RSP,0x410 POP RBX POP RBP POP R12 RET LAB_0010275b: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_mem_disk_cat_file() ;local_20 undefined8 -20 PUSH R12
static void unzzip_mem_entry_fprint(ZZIP_MEM_DISK* disk, ZZIP_MEM_ENTRY* entry, FILE* out) { ZZIP_DISK_FILE* file = zzip_mem_entry_fopen (disk, entry); if (file) { char buffer[1024]; int len; while (0 < (len = zzip_mem_disk_fread (buffer, 1024, 1, file))) fwrite (buffer, len, 1, out); zzip_mem_disk_fclose (file); } }
int mem_mem_mem_entry(FILE *file, FILE *fp, FILE *fp) { FILE *fp; FILE *fp; FILE *fp; fp = mem_mem_mem_mem(file, fp); if (fp == NULL) return 0; fp = mem_mem_mem_mem(fp, fp); if (fp == NULL) return 0; return mem_mem_mem_entry(fp, fp); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_realfd() MOV EAX,dword ptr [RDI + 0x8] RET ?? 66h f
int zzip_realfd(ZZIP_FILE * fp) { return fp->fd; }
static int z_real_real(z_real_t *z_real) { return z_real->real; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_realdir() MOV RAX,qword ptr [RDI + 0x58] RET ?? 66h f
void * zzip_realdir(ZZIP_DIR * dir) { return dir->realdir; }
const char * zz_dirdir_real(z_dirdir_t *dir) { return dir->real; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_file_real() XOR EAX,EAX CMP qword ptr [RDI],0x0 SETZ AL RET ?? 66h f
int zzip_file_real(ZZIP_FILE * fp) { return fp->dir == 0; /* ie. not dependent on a zip-arch-dir */ }
int zfile_real_file (zfile_t *file) { return file->file; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_real() XOR EAX,EAX CMP qword ptr [RDI + 0x58],0x0 SETNZ AL RET ?? 0Fh
int zzip_dir_real(ZZIP_DIR * dir) { return dir->realdir!= 0; }
gboolean z_dir_real_dir (zdir_real_t *zdir) { return zdir->dir!= NULL; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_compr_str() CMP EDI,0xa JBE LAB_00104068 LEA EDX,[RDI + -0x1] LEA RAX,[.rodata:s_zipped_00105561] ;= "zipped" CMP EDX,0xfe JBE LAB_00104064 AND EDI,0xf000 LEA RAX,[.rodata:s_directory_00105568] ;= "directory" CMP EDI,0x4000 JZ LAB_00104064 LEA RAX,[.rodata:s_is/chr_00105572] ;= "is/chr" CMP EDI,0x2000 JZ LAB_00104064 LEA RAX,[.rodata:s_is/blk_00105579] ;= "is/blk" CMP EDI,0x6000 JZ LAB_00104064 LEA RAX,[.rodata:s_is/fifo_00105580] ;= "is/fifo" CMP EDI,0x1000 JZ LAB_00104064 LEA RAX,[.rodata:s_is/sock_00105588] ;= "is/sock" CMP EDI,0xc000 JZ LAB_00104064 CMP EDI,0xa000 LEA RAX,[.rodata:s_is/lnk_00105590] ;= "is/lnk" LEA RDX,[.rodata:s_special_00105597] ;= "special" CMOVNZ RAX,RDX LAB_00104064: RET ?? 0Fh ?? 1Fh ?? 00h LAB_00104068: MOVSXD RDI,EDI LEA RAX,[.data.rel.ro:comprlevel] MOV RAX=>.data.rel.ro:comprlevel,qword ptr [RAX + RDI*0x8] RET ?? 66h f
zzip_char_t * zzip_compr_str(int compr) { if (0 <= compr && (unsigned) compr < LENGTH(comprlevel)) { return comprlevel[compr]; } else if (0 < compr && compr < 256) { return "zipped"; } else { # ifdef S_ISDIR if (S_ISDIR(compr)) return "directory"; # endif # ifdef S_ISCHR if (S_ISCHR(compr)) return "is/chr"; # endif # ifdef S_ISBLK if (S_ISBLK(compr)) return "is/blk"; # endif # ifdef S_ISFIFO if (S_ISFIFO(compr)) return "is/fifo"; # endif # ifdef S_ISSOCK if (S_ISSOCK(compr)) return "is/sock"; # endif # ifdef S_ISLNK if (S_ISLNK(compr)) return "is/lnk"; # endif return "special"; } }
const char * is_str(int c) { switch (c) { case 0: return "r"; case 1: return "r"; case 3: return "r"; case 3: return "r"; case 3: return "r"; default: return "r"; } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dirfd() MOV EAX,dword ptr [RDI] RET ?? 66h f
int zzip_dirfd(ZZIP_DIR * dir) { return dir->fd; }
int zdir_fd (zdir_t *zdir) { return zdir->fd; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dirhandle() MOV RAX,qword ptr [RDI] RET ?? 66h f
ZZIP_DIR * zzip_dirhandle(ZZIP_FILE * fp) { return fp->dir; }
size_t zhandle_dir (zhandle_t *zhandle) { return zhandle->dir; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_seterror() MOV dword ptr [RDI + 0x4],ESI RET ?? 66h f
void zzip_seterror(ZZIP_DIR * dir, int errcode) { dir->errcode = errcode; }
void z_parser_z(z_parser_t *parser, int z) { parser->z = z; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_error() MOV EAX,dword ptr [RDI + 0x4] RET ?? 66h f
int zzip_error(ZZIP_DIR * dir) { return dir->errcode; }
int zerror_error(zerror_t *zerror ) { return zerror->error; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined our_read() PUSH RBX MOV RBX,RSI CALL .plt:read ;ssize_t read(int __fd, void * __buf,... TEST RAX,RAX JLE LAB_001025c4 MOV RSI,RBX LEA RDX,[RBX + RAX*0x1] NOP dword ptr [RAX] LAB_001025b8: XOR byte ptr [RSI],0x55 ADD RSI,0x1 CMP RSI,RDX JNZ LAB_001025b8 LAB_001025c4: POP RBX RET ?? 66h f
static zzip_ssize_t our_read(int fd, void* buf, zzip_size_t len) { const zzip_ssize_t bytes = read(fd, buf, len); zzip_ssize_t i; char* pch = (char*)buf; for (i=0; i<bytes; ++i) { pch[i] ^= 0x55; } return bytes; }
static ssize_t read(int fd, void *buf, size_t count) { ssize_t i; for (i = 0; i < count; i++) buf[i] = 0; return i; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_direntry_done() MOV RAX,qword ptr [.bss:sum_usize] PUSH R12 MOV RDX,0x100000003ff CMP RAX,RDX JLE LAB_00102990 SAR RAX,0x3c MOV R12D,0x47 MOV qword ptr [.bss:sum_usize],RAX LAB_00102939: MOV EAX,dword ptr [.bss:option_verbose] TEST EAX,EAX JNZ LAB_001029db LAB_00102947: LEA RDI,[.rodata:s__--------_----_00105168] ;= " -------- ----" CALL .plt:<EXTERNAL>::puts ;int puts(char * __s) MOV R8,qword ptr [.bss:sum_files] MOV ECX,R12D LEA RAX,[.rodata:s_files_00105009] ;= "files" LEA R9,[.rodata:DAT_00105004] ;= 66h f MOV RDX,qword ptr [.bss:sum_usize] LEA RSI,[.rodata:s__%8li%c_%8li_%s_0010500f] ;= " %8li%c %8li %s\n" POP R12 CMP R8,0x1 MOV EDI,0x1 CMOVNZ R9,RAX XOR EAX,EAX JMP .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() ?? 90h LAB_00102990: CMP RAX,0x40000000 JLE LAB_00102a55 MOV RDX,qword ptr [.bss:sum_csize] SAR RAX,0x14 MOV R12D,0x4d MOV qword ptr [.bss:sum_usize],RAX TEST RDX,RDX LEA RAX,[RDX + 0xfffff] CMOVNS RAX,RDX SAR RAX,0x14 MOV qword ptr [.bss:sum_csize],RAX MOV EAX,dword ptr [.bss:option_verbose] TEST EAX,EAX JZ LAB_00102947 LAB_001029db: LEA RDI,[.rodata:s_--------_------_-------_-----_--_00105128] ;= "-------- ------ ------- ----- ... CALL .plt:<EXTERNAL>::puts ;int puts(char * __s) MOV RDX,qword ptr [.bss:sum_files] MOV R9D,R12D LEA RCX,[.rodata:s_files_00105009] ;= "files" LEA RAX,[.rodata:DAT_00105004] ;= 66h f MOV R8,qword ptr [.bss:sum_csize] MOV R10,qword ptr [.bss:sum_usize] LEA RSI,[.rodata:s_%8li%c_%8li%c_%3li%%_%8li_%s_00105190] ;= "%8li%c %8li%c %3li%% ... CMP RDX,0x1 MOV EDI,0x1 CMOVNZ RAX,RCX SUB RSP,0x8 MOV ECX,R12D PUSH RAX LEA RAX,[R8 + R8*0x4] LEA RAX,[RAX + RAX*0x4] PUSH RDX SHL RAX,0x2 CQO IDIV R10 MOV EDX,0x64 SUB RDX,RAX XOR EAX,EAX PUSH RDX MOV RDX,R10 CALL .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() ADD RSP,0x20 POP R12 RET LAB_00102a55: CMP RAX,segment_2.1:Elf64_Ehdr_00100000 JLE LAB_00102a93 MOV RDX,qword ptr [.bss:sum_csize] SAR RAX,0xa MOV R12D,0x4b MOV qword ptr [.bss:sum_usize],RAX TEST RDX,RDX LEA RAX,[RDX + 0x3ff] CMOVNS RAX,RDX SAR RAX,0xa MOV qword ptr [.bss:sum_csize],RAX JMP LAB_00102939 LAB_00102a93: MOV R12D,0x20 JMP LAB_00102939 ?? 66h f
static void zzip_mem_entry_direntry_done (void) { char exp =''; if (sum_usize / 1024 > 1024*1024*1024) { exp = 'G'; sum_usize /= 1024*1024*1024; sum_usize /= 1024*1024*1024; } if (sum_usize > 1024*1024*1024) { exp = 'M'; sum_usize /= 1024*1024; sum_csize /= 1024*1024; } if (sum_usize > 1024*1024) { exp = 'K'; sum_usize /= 1024; sum_csize /= 1024; } if (option_verbose) goto verbose; printf(" -------- ----\n"); printf(" %8li%c %8li %s\n", L sum_usize, exp, L sum_files, sum_files == 1? "file" : "files"); return; verbose: printf("-------- ------ ------- ----- ----\n"); printf("%8li%c %8li%c %3li%% %8li %s\n", L sum_usize, exp, L sum_csize, exp, L (100 - (sum_csize*100/sum_usize)), L sum_files, sum_files == 1? "file" : "files"); }
static void print_entry (void) { int i; for (i = 0; i < NUM_SIZE; i++) { if (entry[i] == 0) { printf ("%s\n", entry[i]); printf ("%s\n", entry[i]); } else { printf ("%s\n", entry[i]); } } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zzip_ctime() PUSH R12 LEA R12,[.bss:_zzip_time_] CALL .plt:<EXTERNAL>::localtime ;tm * localtime(time_t * __timer) SUB RSP,0x8 MOV RDI=>.bss:_zzip_time_,R12 MOV ESI,0x1 MOV EDX,dword ptr [RAX + 0x4] MOV R9D,dword ptr [RAX + 0xc] MOV R8D,dword ptr [RAX + 0x10] PUSH RDX MOV EDX,dword ptr [RAX + 0x8] PUSH RDX MOVSXD RAX,dword ptr [RAX + 0x14] MOV RDX,RAX IMUL RAX,RAX,0x51eb851f MOV ECX,EDX SAR ECX,0x1f SAR RAX,0x25 SUB EAX,ECX LEA RCX,[.rodata:s_%02i-%02i-%02i_%02i:%02i_0010502a] ;= "%02i-%02i-%02i %02i:%02i" IMUL EAX,EAX,0x64 SUB EDX,EAX XOR EAX,EAX PUSH RDX MOV EDX,0x1e CALL .plt:<EXTERNAL>::__sprintf_chk ;undefined __sprintf_chk() ADD RSP,0x20 MOV RAX=>.bss:_zzip_time_,R12 POP R12 RET ?? 66h f
static char* _zzip_ctime (const time_t* timeval) { struct tm* date = localtime (timeval); sprintf (_zzip_time_, "%02i-%02i-%02i %02i:%02i", date->tm_mon, date->tm_mday, date->tm_year%100, date->tm_hour, date->tm_min); return _zzip_time_; }
static char * _time_to_time (void) { struct tm *tm; time_t t; time_t t; t = time (NULL); t = time (NULL); t = time (NULL); return t; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_make() PUSH R12 MOV R12,RDI PUSH RBP PUSH RBX MOV RDI,qword ptr [RSI + 0x8] MOV RBX,RSI LEA RSI,[.rodata:DAT_001050b7] ;= 77h w CALL .plt:<EXTERNAL>::fopen ;FILE * fopen(char * __filename, char... TEST RAX,RAX JZ LAB_00102f18 MOV RBP,RAX MOV RDI,R12 MOV RDX,RAX MOV RSI,RBX CALL zzip_mem_entry_pipe ;undefined zzip_mem_entry_pipe() MOV RDI,RBP CALL .plt:<EXTERNAL>::fclose ;int fclose(FILE * __stream) LAB_00102f18: MOV RDI,qword ptr [RBX + 0x8] CALL .plt:<EXTERNAL>::perror ;void perror(char * __s) MOV EAX,dword ptr [.bss:status] TEST EAX,EAX JG LAB_00102f35 MOV dword ptr [.bss:status],0x1 LAB_00102f35: POP RBX POP RBP POP R12 RET ?? 66h f
static void zzip_mem_entry_make(ZZIP_MEM_DISK* disk, ZZIP_MEM_ENTRY* entry) { FILE* file = fopen (entry->zz_name, "wb"); if (file) { zzip_mem_entry_pipe (disk, entry, file); fclose (file); } perror (entry->zz_name); if (status < EXIT_WARNINGS) status = EXIT_WARNINGS; }
static int file_write_entry(const char *path, FILE *f) { FILE *fp; FILE *fp; fp = fopen(path, "rb"); if (!fp) return 0; fp = fopen(path, "rb"); fclose(fp); fclose(fp); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_pipe() ;local_20 undefined8 -20 PUSH R12 MOV R12,RDX PUSH RBP PUSH RBX SUB RSP,0x410 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x428],RAX XOR EAX,EAX CALL zzip_mem_entry_fopen ;undefined zzip_mem_entry_fopen() TEST RAX,RAX JZ LAB_00102d6c MOV RBP,RAX MOV RBX,RSP JMP LAB_00102d4b ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102d38: MOVSXD RSI,EAX MOV RCX,R12 MOV EDX,0x1 MOV RDI,RBX CALL .plt:<EXTERNAL>::fwrite ;size_t fwrite(void * __ptr, size_t _... LAB_00102d4b: MOV RCX,RBP MOV EDX,0x1 MOV ESI,0x400 MOV RDI,RBX CALL zzip_mem_disk_fread ;undefined zzip_mem_disk_fread() TEST EAX,EAX JG LAB_00102d38 MOV RDI,RBP CALL zzip_mem_disk_fclose ;undefined zzip_mem_disk_fclose() LAB_00102d6c: MOV RAX,qword ptr [RSP + local_20+0x428] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00102d8b ADD RSP,0x410 POP RBX POP RBP POP R12 RET LAB_00102d8b: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_test() ;local_30 undefined8 -30 PUSH R13
static void zzip_mem_entry_pipe(ZZIP_MEM_DISK* disk, ZZIP_MEM_ENTRY* entry, FILE* out) { ZZIP_DISK_FILE* file = zzip_mem_entry_fopen (disk, entry); if (file) { char buffer[1024]; int len; while (0 < (len = zzip_mem_disk_fread (buffer, 1024, 1, file))) fwrite (buffer, len, 1, out); zzip_mem_disk_fclose (file); } }
int mem_mem_mem_mem_mem(FILE *fp, FILE *fp) { FILE *fp; FILE *fp; fp = mem_mem_mem_mem(fp, fp); if (!fp) return 0; fp = mem_mem_mem_mem(fp, fp); if (!fp) return 0; return mem_mem_mem_mem_mem(fp, fp); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_entry_get_mktime() ;local_10 undefined8 -10 ;local_34 undefined4 -34 ;local_38 undefined4 -38 ;local_3c undefined4 -3c ;local_40 undefined4 -40 ;local_44 undefined4 -44 ;local_48 undefined4 -48 SUB RSP,0x48 MOVZX EDX,word ptr [RDI + 0xc] MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_10+0x48],RAX XOR EAX,EAX MOVZX EAX,word ptr [RDI + 0xe] MOV RDI,RSP MOV ECX,EDX AND ECX,0x1f MOV dword ptr [RSP]=>local_48,ECX MOV ECX,EDX SHR DX,0xb MOVZX EDX,DX SHR CX,0x5 MOV dword ptr [RSP + local_40+0x48],EDX MOV EDX,EAX AND ECX,0x3f AND EDX,0x1f MOV dword ptr [RSP + local_44+0x48],ECX MOV dword ptr [RSP + local_3c+0x48],EDX MOV EDX,EAX SHR AX,0x9 SHR DX,0x5 ADD EAX,0x50 AND EDX,0xf MOVZX EAX,AX MOV dword ptr [RSP + local_38+0x48],EDX MOV dword ptr [RSP + local_34+0x48],EAX CALL .plt:<EXTERNAL>::mktime ;time_t mktime(tm * __tp) MOV RDX,qword ptr [RSP + local_10+0x48] SUB RDX,qword ptr FS:[0x28] JNZ LAB_0010340d ADD RSP,0x48 RET LAB_0010340d: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
long zzip_disk_entry_get_mktime(ZZIP_DISK_ENTRY * entry) { uint16_t dostime = ZZIP_GET16(entry->z_dostime.time); uint16_t dosdate = ZZIP_GET16(entry->z_dostime.date); struct tm date; date.tm_sec = (dostime) & 0x1F; /* bits 0..4 */ date.tm_min = (dostime >> 5) & 0x3F; /* bits 5..10 */ date.tm_hour = (dostime >> 11); /* bits 11..15 */ date.tm_mday = (dosdate) & 0x1F; /* bits 16..20 */ date.tm_mon = (dosdate >> 5) & 0xF; /* bits 21..24 */ date.tm_year = (dosdate >> 9) + 80; /* bits 25..31 */ return mktime(&date); /* well, unix has that function... */ }
static uint32_t entry_get_time_entry(struct entry *entry) { struct entry *entry; entry = entry->data; entry->data.tv_nsec = entry->data.tv_nsec; entry->data.tv_nsec = entry->data.tv_nsec; entry->data.tv_nsec = entry->data.tv_nsec; entry->data.tv_nsec = entry->data.tv_nsec; entry->data.tv_nsec = entry->data.tv_nsec; return entry->data.tv_nsec; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_feof() JMP zzip_disk_feof ?? 66h f
int zzip_mem_disk_feof(ZZIP_MEM_DISK_FILE * file) { return zzip_disk_feof(file); }
size_t z_mem_disk(void) { return z_disk_disk_disk(disk); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_fclose() JMP zzip_disk_fclose ?? 66h f
int zzip_mem_disk_fclose(ZZIP_MEM_DISK_FILE * file) { return zzip_disk_fclose(file); }
void z_mem_disk_mem (z_mem_disk_t *disk, size_t size) { z_mem_disk_mem (disk, size); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_fread() JMP zzip_disk_fread ?? 66h f
_zzip_size_t zzip_mem_disk_fread(void *ptr, _zzip_size_t size, _zzip_size_t nmemb, ZZIP_MEM_DISK_FILE * file) { return zzip_disk_fread(ptr, size, nmemb, file); }
void z_mem_disk_mem(void *ptr, size_t size) { z_mem_disk_mem(ptr, size); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_fopen() PUSH RBP XOR ECX,ECX XOR EDX,EDX MOV RBP,RDI CALL zzip_mem_disk_findfile ;undefined zzip_mem_disk_findfile() TEST RAX,RAX JZ LAB_00103350 MOV RDI,RBP MOV RSI,RAX POP RBP JMP zzip_mem_entry_fopen ;undefined zzip_mem_entry_fopen() ?? 66h f ?? 90h LAB_00103350: XOR EAX,EAX POP RBP RET ?? 66h f
zzip__new__ ZZIP_MEM_DISK_FILE * zzip_mem_disk_fopen(ZZIP_MEM_DISK * dir, char *filename) { ZZIP_MEM_ENTRY *entry = zzip_mem_disk_findfile(dir, filename, 0, 0); if (! entry) return 0; else return zzip_mem_entry_fopen(dir, entry); }
size_t file_mem_entry_find(const char *file_name, const char *file_name, size_t file_size) { return file_mem_entry_find(file_name, file_name, file_size, 0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_fopen() PUSH R12 PUSH RBP MOV RBP,RSI PUSH RBX MOV RBX,RDI MOV EDI,0x90 CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV R12,RAX TEST RAX,RAX JZ LAB_00103250 MOV RAX,qword ptr [RBX] MOV RDX,qword ptr [RAX] MOV RAX,qword ptr [RAX + 0x8] MOV qword ptr [R12 + 0x8],RAX MOV RAX,qword ptr [RBP + 0x38] MOV qword ptr [R12],RDX MOV RDX,qword ptr [RBP + 0x10] MOV qword ptr [R12 + 0x10],RAX TEST RAX,RAX JZ LAB_00103248 MOV EAX,dword ptr [RBP + 0x1c] TEST EAX,EAX JNZ LAB_00103260 LAB_00103248: MOV qword ptr [R12 + 0x88],RDX LAB_00103250: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103260: MOV R8,qword ptr [RBP + 0x30] MOV RAX,qword ptr [->stderr] ;= 00109100 MOV qword ptr [R12 + 0x18],RDX LEA RCX,[.rodata:__func__.0] ;= "zzip_mem_entry_fopen" MOV qword ptr [R12 + 0x68],0x0 LEA RDX,[.rodata:s_DEBUG:_%s_:_compressed_size_%i_00105680] ;= "DEBUG: %s : compressed size %i\n" MOV ESI,0x1 MOV qword ptr [R12 + 0x88],0x0 MOV RDI,qword ptr [RAX]=>EXTERNAL:stderr ;=?? XOR EAX,EAX MOV qword ptr [R12 + 0x58],0x0 MOV qword ptr [R12 + 0x60],0x0 MOV dword ptr [R12 + 0x20],R8D CALL .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() MOV RDX,qword ptr [R12 + 0x18] MOV EAX,dword ptr [R12 + 0x20] ADD RAX,RDX CMP qword ptr [R12 + 0x8],RAX JBE LAB_00103310 CMP RDX,qword ptr [R12] JC LAB_00103310 CMP dword ptr [RBP + 0x1c],0x8 JNZ LAB_001032fc LEA RDI,[R12 + 0x18] MOV ECX,0x70 MOV ESI,0xfffffff1 LEA RDX,[.rodata:s_1.2.11_001057d8] ;= "1.2.11" CALL .plt:<EXTERNAL>::inflateInit2_ ;undefined inflateInit2_() TEST EAX,EAX JZ LAB_00103250 LAB_001032fc: MOV RDI,R12 XOR R12D,R12D CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) JMP LAB_00103250 ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00103310: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R12D,R12D MOV dword ptr [RAX],0x4a MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 66h f
zzip__new__ ZZIP_MEM_DISK_FILE * zzip_mem_entry_fopen(ZZIP_MEM_DISK * dir, ZZIP_MEM_ENTRY * entry) { /* keep this in sync with zzip_disk_entry_fopen */ ZZIP_DISK_FILE *file = malloc(sizeof(ZZIP_MEM_DISK_FILE)); if (! file) return file; file->buffer = dir->disk->buffer; file->endbuf = dir->disk->endbuf; file->avail = zzip_mem_entry_usize(entry); if (! file->avail || zzip_mem_entry_data_stored(entry)) { file->stored = zzip_mem_entry_to_data (entry); return file; } file->stored = 0; file->zlib.opaque = 0; file->zlib.zalloc = Z_NULL; file->zlib.zfree = Z_NULL; file->zlib.avail_in = zzip_mem_entry_csize(entry); file->zlib.next_in = zzip_mem_entry_to_data(entry); debug2("compressed size %i", (int) file->zlib.avail_in); if (file->zlib.next_in + file->zlib.avail_in >= file->endbuf) goto error; if (file->zlib.next_in < file->buffer) goto error; if (! zzip_mem_entry_data_deflated(entry) || inflateInit2(&file->zlib, -MAX_WBITS)!= Z_OK) { free (file); return 0; } return file; error: errno = EBADMSG; return NULL; }
int z_mem_entry_init(z_mem_entry_t *entry, const void *key, size_t key_size) { z_mem_entry_t *entry; if (entry == NULL) { return (0); } entry = (z_mem_entry_t *) malloc(sizeof(z_mem_entry_t)); if (entry == NULL) { return (0); } entry->key_size = entry->key_size; entry->key_size = entry->key_size; entry->key_size = entry->key_size; entry->key_size = entry->key_size; entry->key_size = entry->key_size; entry->key_size = entry->key_size; entry->key_size = entry->key_size; return (0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_findmatch() PUSH R13 MOV R13D,R8D PUSH R12 PUSH RBP MOV RBP,RSI PUSH RBX MOV RBX,RCX SUB RSP,0x8 TEST RDX,RDX JZ LAB_001031e8 MOV R12,qword ptr [RDX] TEST RBX,RBX JNZ LAB_001031cd JMP LAB_001031f1 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001031b8: MOV RSI,qword ptr [R12 + 0x8] MOV EDX,R13D MOV RDI,RBP CALL RBX=>EXTERNAL:<EXTERNAL>::fnmatch ;int fnmatch(char * __pattern, char *... TEST EAX,EAX JZ LAB_001031d5 MOV R12,qword ptr [R12] LAB_001031cd: TEST R12,R12 JNZ LAB_001031b8 XOR R12D,R12D LAB_001031d5: ADD RSP,0x8 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001031e8: MOV R12,qword ptr [RDI + 0x8] TEST RBX,RBX JNZ LAB_001031cd LAB_001031f1: MOV RBX,qword ptr [-><EXTERNAL>::fnmatch] ;= 00109058 JMP LAB_001031cd ?? 66h f
ZZIP_MEM_ENTRY * zzip_mem_disk_findmatch(ZZIP_MEM_DISK * dir, char *filespec, ZZIP_MEM_ENTRY * after, zzip_fnmatch_fn_t compare, int flags) { ZZIP_MEM_ENTRY *entry = (! after? dir->list : after->zz_next); if (! compare) compare = (zzip_fnmatch_fn_t) _zzip_fnmatch; for (; entry; entry = entry->zz_next) { if (! compare(filespec, entry->zz_name, flags)) { return entry; } } return 0; }
int zmatch_find_match(const char *name, const char *match, const char *match) { int ret; ret = zmatch_find(name,match,match); if (ret) return ret; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_findfile() PUSH R12 PUSH RBP MOV RBP,RSI PUSH RBX MOV RBX,RCX TEST RDX,RDX JZ LAB_00103178 MOV R12,qword ptr [RDX] TEST RBX,RBX JNZ LAB_00103162 JMP LAB_00103181 ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103150: MOV RSI,qword ptr [R12 + 0x8] MOV RDI,RBP CALL RBX=>EXTERNAL:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JZ LAB_0010316a MOV R12,qword ptr [R12] LAB_00103162: TEST R12,R12 JNZ LAB_00103150 XOR R12D,R12D LAB_0010316a: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103178: MOV R12,qword ptr [RDI + 0x8] TEST RBX,RBX JNZ LAB_00103162 LAB_00103181: MOV RBX,qword ptr [-><EXTERNAL>::strcmp] ;= 00109118 JMP LAB_00103162 ?? 66h f
ZZIP_MEM_ENTRY * zzip_mem_disk_findfile(ZZIP_MEM_DISK * dir, char *filename, ZZIP_MEM_ENTRY * after, zzip_strcmp_fn_t compare) { ZZIP_MEM_ENTRY *entry = (! after? dir->list : after->zz_next); if (! compare) compare = (zzip_strcmp_fn_t) (strcmp); for (; entry; entry = entry->zz_next) { if (! compare(filename, entry->zz_name)) { return entry; } } return 0; }
static int file_find_mem(const char *name, const char *file, const char *file, const char *value) { struct file_entry *entry; if (!file) return 0; entry = (struct file_entry *)file; while (entry) { if (strcmp(entry->name, file) == 0) return 1; entry = entry->next; } return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_close() TEST RDI,RDI JZ LAB_00103120 PUSH RBP MOV RBP,RDI CALL zzip_mem_disk_unload ;undefined zzip_mem_disk_unload() MOV RDI,qword ptr [RBP] CALL zzip_disk_close ;undefined zzip_disk_close() MOV RDI,RBP POP RBP JMP .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00103120: RET ?? 66h f
void zzip_mem_disk_close(ZZIP_MEM_DISK * _zzip_restrict dir) { if (dir) { zzip_mem_disk_unload(dir); zzip_disk_close(dir->disk); free(dir); } }
void z_mem_close(z_mem_t *mem) { if (mem == NULL) z_mem_close(mem); z_mem_close(mem); z_mem_free(mem); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_unload() PUSH RBP MOV RBP,RDI PUSH RBX SUB RSP,0x8 MOV RBX,qword ptr [RDI + 0x8] TEST RBX,RBX JZ LAB_001030d8 NOP word ptr [RAX + RAX*0x1] LAB_001030c8: MOV RDI,RBX MOV RBX,qword ptr [RBX] CALL zzip_mem_entry_free ;undefined zzip_mem_entry_free() TEST RBX,RBX JNZ LAB_001030c8 LAB_001030d8: MOV qword ptr [RBP + 0x10],0x0 MOV RDI,qword ptr [RBP] MOV qword ptr [RBP + 0x8],0x0 CALL zzip_disk_close ;undefined zzip_disk_close() MOV qword ptr [RBP],0x0 ADD RSP,0x8 POP RBX POP RBP RET ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_close() TEST RDI,RDI
void zzip_mem_disk_unload(ZZIP_MEM_DISK * dir) { ZZIP_MEM_ENTRY *item = dir->list; while (item) { ZZIP_MEM_ENTRY *next = item->zz_next; zzip_mem_entry_free(item); item = next; } dir->list = dir->last = 0; zzip_disk_close(dir->disk); dir->disk = 0; }
void mem_close_disk_mem(struct mem_disk_mem *disk) { struct mem_disk_mem *disk; disk = (struct mem_disk_mem *)disk->disk_mem; mem_close(disk); disk->disk_mem = NULL; mem_disk_mem_free(disk); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_free() TEST RDI,RDI JZ LAB_00103010 PUSH RBP MOV RBP,RDI MOV RDI,qword ptr [RDI + 0x58] TEST RDI,RDI JZ LAB_00102fc7 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00102fc7: MOV RDI,qword ptr [RBP + 0x60] TEST RDI,RDI JZ LAB_00102fd5 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00102fd5: MOV RDI,qword ptr [RBP + 0x68] TEST RDI,RDI JZ LAB_00102fe3 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00102fe3: MOV RDI,qword ptr [RBP + 0x50] TEST RDI,RDI JZ LAB_00102ff1 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00102ff1: MOV RDI,qword ptr [RBP + 0x8] TEST RDI,RDI JZ LAB_00102fff CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00102fff: MOV RDI,RBP POP RBP JMP .plt:<EXTERNAL>::free ;void free(void * __ptr) ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103010: RET ?? 66h f
void zzip_mem_entry_free(ZZIP_MEM_ENTRY * _zzip_restrict item) { if (item) { /* *INDENT-OFF* */ if (item->zz_ext[0]) free (item->zz_ext[0]); if (item->zz_ext[1]) free (item->zz_ext[1]); if (item->zz_ext[2]) free (item->zz_ext[2]); if (item->zz_comment) free (item->zz_comment); if (item->zz_name) free (item->zz_name); free (item); /* *INDENT-ON* */ } }
void zmem_entry_free(zmem_entry_t *entry) { if (entry == NULL) return; if (entry->name!= NULL) zmem_free(entry->name); if (entry->name!= NULL) zmem_free(entry->name); if (entry->name!= NULL) zmem_free(entry->name); if (entry->name!= NULL) zmem_free(entry->name); zmem_free(entry); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_find_extra_block() LEA R10,[RDI + 0x68] MOV R11,RDX ADD RDI,0x50 MOVSX ESI,SI LEA R9,[RDX + 0x4] LAB_00103042: MOV RAX,qword ptr [R10] TEST RAX,RAX JNZ LAB_00103060 LAB_0010304a: SUB R10,0x8 CMP RDI,R10 JNZ LAB_00103042 XOR EAX,EAX RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103060: MOV R8,qword ptr [R10 + 0x18] LEA RDX,[RAX + R9*0x1] ADD R8,RAX CMP R8,RDX JNC LAB_00103086 JMP LAB_0010304a ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103078: LEA RAX,[RAX + RDX*0x1 + 0x4] LEA RDX,[RAX + R9*0x1] CMP R8,RDX JC LAB_0010304a LAB_00103086: MOVZX ECX,word ptr [RAX] MOVZX EDX,word ptr [RAX + 0x2] CMP ECX,ESI JNZ LAB_00103078 MOVZX ECX,DX ADD RCX,0x4 CMP RCX,R11 JC LAB_00103078 RET ?? 66h f
ZZIP_EXTRA_BLOCK * zzip_mem_entry_find_extra_block(ZZIP_MEM_ENTRY * entry, short datatype, zzip_size_t blocksize) { int i = 2; while (1) { char* ext = (char*)( entry->zz_ext[i] ); char* ext_end = ext + entry->zz_extlen[i]; if (ext) { /* * Make sure that * 1) the extra block header * AND * 2) the block we're looking for * fit into the extra block! */ while (ext + zzip_extra_block_headerlength + blocksize <= ext_end) { if (datatype == zzip_extra_block_get_datatype(ext)) { if (blocksize <= zzip_extra_block_get_datasize(ext) + zzip_extra_block_headerlength) { return ((ZZIP_EXTRA_BLOCK*) ext); } } /* skip to start of next extra_block */ ___ zzip_size_t datasize = zzip_extra_block_get_datasize(ext); ext += zzip_extra_block_headerlength; ext += datasize; ____; } } if (! i) return 0; i--; } }
size_t zz_block_find_block_block (z_block_t block, size_t block_size) { size_t i; for (i = 0; i < block_size; i++) { if (block_size == block_size) return 0; } return block_size; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_entry_extra_block() MOVSX ESI,SI MOV EDX,0x10 JMP zzip_mem_entry_find_extra_block ;undefined zzip_mem_entry_find_extra_... ?? 0Fh
ZZIP_EXTRA_BLOCK * zzip_mem_entry_extra_block(ZZIP_MEM_ENTRY * entry, short datatype) { return zzip_mem_entry_find_extra_block(entry, datatype, 16); }
uint16_t zbar_block_entry_find_entry(ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_buffer() PUSH R12 PUSH RBP PUSH RBX MOV RBX,RDI CALL zzip_disk_buffer ;undefined zzip_disk_buffer() TEST RAX,RAX JZ LAB_00103907 MOV RBP,RAX CALL zzip_mem_disk_new ;undefined zzip_mem_disk_new() MOV RSI,RBP MOV RDI,RAX MOV R12,RAX CALL zzip_mem_disk_load ;undefined zzip_mem_disk_load() CMP RAX,-0x1 JZ LAB_001038d8 LAB_001038cd: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 00h LAB_001038d8: MOV RAX,qword ptr [->stderr] ;= 00109100 MOV R8,RBX LEA RCX,[.rodata:__func__.3] ;= "zzip_mem_disk_buffer" LEA RDX,[.rodata:s_DEBUG:_%s_:_unable_to_load_disk_b_001057b0] ;= "DEBUG: %s : unable to load disk b... MOV ESI,0x1 MOV RDI,qword ptr [RAX]=>EXTERNAL:stderr ;=?? XOR EAX,EAX CALL .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() MOV RAX,R12 POP RBX POP RBP POP R12 RET LAB_00103907: MOV RAX,qword ptr [->stderr] ;= 00109100 MOV R8,RBX XOR R12D,R12D LEA RCX,[.rodata:__func__.3] ;= "zzip_mem_disk_buffer" LEA RDX,[.rodata:s_DEBUG:_%s_:_can_not_open_disk_bu_00105788] ;= "DEBUG: %s : can not open disk buf... MOV ESI,0x1 MOV RDI,qword ptr [RAX]=>EXTERNAL:stderr ;=?? XOR EAX,EAX CALL .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() JMP LAB_001038cd ?? 66h f
zzip__new__ ZZIP_MEM_DISK * zzip_mem_disk_buffer(char *buffer, size_t buflen) { ZZIP_DISK *disk = zzip_disk_buffer(buffer, buflen); if (! disk) { debug2("can not open disk buf %p", buffer); return 0; } ___ ZZIP_MEM_DISK *dir = zzip_mem_disk_new(); if (zzip_mem_disk_load(dir, disk) == -1) { debug2("unable to load disk buf %p", buffer); } return dir; ____; }
int z_new_mem(const char *filename) { FILE *fp; FILE *fp; fp = z_mem_new(); if (fp == NULL) return -1; fp = z_mem_new(); z_mem_set_mem(fp, fp); z_mem_free(fp); return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_fdopen() PUSH R12 PUSH RBP PUSH RBX MOV EBX,EDI CALL zzip_disk_mmap ;undefined zzip_disk_mmap() TEST RAX,RAX JZ LAB_00103867 MOV RBP,RAX CALL zzip_mem_disk_new ;undefined zzip_mem_disk_new() MOV RSI,RBP MOV RDI,RAX MOV R12,RAX CALL zzip_mem_disk_load ;undefined zzip_mem_disk_load() CMP RAX,-0x1 JZ LAB_00103838 LAB_0010382c: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00103838: MOV RAX,qword ptr [->stderr] ;= 00109100 MOV R8D,EBX LEA RCX,[.rodata:__func__.4] ;= "zzip_mem_disk_fdopen" LEA RDX,[.rodata:s_DEBUG:_%s_:_unable_to_load_disk_f_00105760] ;= "DEBUG: %s : unable to load disk f... MOV ESI,0x1 MOV RDI,qword ptr [RAX]=>EXTERNAL:stderr ;=?? XOR EAX,EAX CALL .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() MOV RAX,R12 POP RBX POP RBP POP R12 RET LAB_00103867: MOV RAX,qword ptr [->stderr] ;= 00109100 MOV R8D,EBX XOR R12D,R12D LEA RCX,[.rodata:__func__.4] ;= "zzip_mem_disk_fdopen" LEA RDX,[.rodata:s_DEBUG:_%s_:_can_not_open_disk_fd_00105738] ;= "DEBUG: %s : can not open disk fd... MOV ESI,0x1 MOV RDI,qword ptr [RAX]=>EXTERNAL:stderr ;=?? XOR EAX,EAX CALL .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() JMP LAB_0010382c ?? 66h f
zzip__new__ ZZIP_MEM_DISK * zzip_mem_disk_fdopen(int fd) { ZZIP_DISK *disk = zzip_disk_mmap(fd); if (! disk) { debug2("can not open disk fd %i", fd); return 0; } ___ ZZIP_MEM_DISK *dir = zzip_mem_disk_new(); if (zzip_mem_disk_load(dir, disk) == -1) { debug2("unable to load disk fd %i", fd); } return dir; ____; }
int z_mem_load(const char *filename) { FILE *fp; FILE *fp; fp = z_mem_new(); if (!fp) return -1; fp = z_mem_open(fp, fp); if (!fp) return -1; z_mem_load(fp, fp); return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_open() PUSH R12 PUSH RBP PUSH RBX MOV RBX,RDI CALL zzip_disk_open ;undefined zzip_disk_open() TEST RAX,RAX JZ LAB_001037c7 MOV RBP,RAX CALL zzip_mem_disk_new ;undefined zzip_mem_disk_new() MOV RSI,RBP MOV RDI,RAX MOV R12,RAX CALL zzip_mem_disk_load ;undefined zzip_mem_disk_load() CMP RAX,-0x1 JZ LAB_00103798 LAB_0010378d: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 0Fh ?? 1Fh ?? 00h LAB_00103798: MOV RAX,qword ptr [->stderr] ;= 00109100 MOV R8,RBX LEA RCX,[.rodata:__func__.5] ;= "zzip_mem_disk_open" LEA RDX,[.rodata:s_DEBUG:_%s_:_unable_to_load_disk_%_00105710] ;= "DEBUG: %s : unable to load disk %... MOV ESI,0x1 MOV RDI,qword ptr [RAX]=>EXTERNAL:stderr ;=?? XOR EAX,EAX CALL .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() MOV RAX,R12 POP RBX POP RBP POP R12 RET LAB_001037c7: MOV RAX,qword ptr [->stderr] ;= 00109100 MOV R8,RBX XOR R12D,R12D LEA RCX,[.rodata:__func__.5] ;= "zzip_mem_disk_open" LEA RDX,[.rodata:s_DEBUG:_%s_:_can_not_open_disk_fi_001056e8] ;= "DEBUG: %s : can not open disk fil... MOV ESI,0x1 MOV RDI,qword ptr [RAX]=>EXTERNAL:stderr ;=?? XOR EAX,EAX CALL .plt:<EXTERNAL>::__fprintf_chk ;undefined __fprintf_chk() JMP LAB_0010378d ?? 66h f
zzip__new__ ZZIP_MEM_DISK * zzip_mem_disk_open(char *filename) { ZZIP_DISK *disk = zzip_disk_open(filename); if (! disk) { debug2("can not open disk file %s", filename); return 0; } ___ ZZIP_MEM_DISK *dir = zzip_mem_disk_new(); if (zzip_mem_disk_load(dir, disk) == -1) { debug2("unable to load disk %s", filename); } return dir; ____; }
FILE * z_open_mem(const char *filename) { FILE *f; FILE *f; f = z_open_mem(filename, "r"); if (!f) return NULL; f = z_open_mem(f); if (!f) return NULL; z_open_mem(f, f); return f; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_mem_disk_new() MOV ESI,0x18 MOV EDI,0x1 JMP .plt:<EXTERNAL>::calloc ;void * calloc(size_t __nmemb, size_t... ?? 90h
zzip__new__ ZZIP_MEM_DISK * zzip_mem_disk_new(void) { return calloc(1, sizeof(ZZIP_MEM_DISK)); }
size_t zmem_mem_new(void) { return zmem_mem_calloc(1, sizeof(zmem_mem_t)); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_feof() TEST RDI,RDI JZ LAB_0010446d CMP qword ptr [RDI + 0x10],0x1 SBB EAX,EAX RET LAB_0010446d: MOV EAX,0xffffffff RET ?? 66h f
int zzip_disk_feof(ZZIP_DISK_FILE * file) { if (! file ||! file->avail) return EOF; return 0; }
int zz_disk_disk_disk_disk(zz_disk *disk) { if (!disk) return -1; if (disk->disk_disk == NULL) return -1; returndisk->disk_disk; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_fclose() TEST RDI,RDI JZ LAB_00104440 PUSH RBP CMP qword ptr [RDI + 0x88],0x0 MOV RBP,RDI JZ LAB_00104448 MOV RDI,RBP CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) XOR EAX,EAX POP RBP RET ?? 90h LAB_00104440: XOR EAX,EAX RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00104448: LEA RDI,[RDI + 0x18] CALL .plt:<EXTERNAL>::inflateEnd ;undefined inflateEnd() MOV RDI,RBP CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) XOR EAX,EAX POP RBP RET ?? 0Fh
int zzip_disk_fclose(ZZIP_DISK_FILE * file) { if (file) { if (! file->stored) inflateEnd(&file->zlib); free(file); } return 0; }
int zz_diskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdiskdis
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_fread() TEST RDI,RDI PUSH R12 SETZ AL TEST RCX,RCX PUSH RBP PUSH RBX MOV RBX,RCX SETZ CL OR AL,CL JNZ LAB_001043a4 TEST RSI,RSI JZ LAB_001043a4 MOV R12,RSI MOV RAX,qword ptr [RBX + 0x10] MOV R8,qword ptr [RBX + 0x88] IMUL R12,RDX CMP R12,RAX CMOVA R12,RAX TEST R8,R8 JZ LAB_001043d0 LEA RAX,[R8 + R12*0x1] CMP qword ptr [RBX + 0x8],RAX JA LAB_001043b0 LAB_001043a4: XOR R12D,R12D LAB_001043a7: MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 90h LAB_001043b0: MOV RDX,R12 MOV RSI,R8 CALL .plt:<EXTERNAL>::memcpy ;void * memcpy(void * __dest, void *... ADD qword ptr [RBX + 0x88],R12 MOV RAX,R12 SUB qword ptr [RBX + 0x10],R12 POP RBX POP RBP POP R12 RET ?? 66h f ?? 90h LAB_001043d0: IMUL ESI,EDX MOV qword ptr [RBX + 0x30],RDI LEA RDI,[RBX + 0x18] MOV RBP,qword ptr [RBX + 0x40] MOV dword ptr [RBX + 0x38],ESI XOR ESI,ESI CALL .plt:<EXTERNAL>::inflate ;undefined inflate() CMP EAX,0x1 JZ LAB_00104408 TEST EAX,EAX JNZ LAB_001043a4 MOV R12,qword ptr [RBX + 0x40] MOV RAX,RBP SUB RAX,R12 ADD qword ptr [RBX + 0x10],RAX LAB_00104400: SUB R12,RBP JMP LAB_001043a7 ?? 0Fh ?? 1Fh ?? 00h LAB_00104408: MOV qword ptr [RBX + 0x10],0x0 MOV R12,qword ptr [RBX + 0x40] JMP LAB_00104400 ?? 66h f
zzip_size_t zzip_disk_fread(void *ptr, zzip_size_t sized, zzip_size_t nmemb, ZZIP_DISK_FILE * file) { zzip_size_t size = sized * nmemb; if (! ptr ||! sized ||! file) return 0; if (size > file->avail) size = file->avail; if (file->stored) { if (file->stored + size >= file->endbuf) { DBG1("try to read beyond end of file"); return 0; /* ESPIPE */ } DBG3("copy stored %p %i", file->stored, (int)size); memcpy(ptr, file->stored, size); file->stored += size; file->avail -= size; return size; } file->zlib.avail_out = sized * nmemb; file->zlib.next_out = ptr; ___ zzip_size_t total_old = file->zlib.total_out; ___ int err = inflate(&file->zlib, Z_NO_FLUSH); if (err == Z_STREAM_END) file->avail = 0; else if (err == Z_OK) file->avail -= file->zlib.total_out - total_old; else return 0; return file->zlib.total_out - total_old; ____; ____; }
int z_disk_read(z_disk_t *disk, FILE *fp) { z_disk_t *disk; z_disk_t *disk; if (disk == NULL) return 0; disk = (z_disk_t *)disk->disk; if (disk == NULL) return 0; disk = (z_disk_t *)disk->disk; disk->disk = (disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk); if (disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->disk->diskdis
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_fopen() PUSH RBP XOR ECX,ECX XOR EDX,EDX MOV RBP,RDI CALL zzip_disk_findfile ;undefined zzip_disk_findfile() TEST RAX,RAX JZ LAB_00104350 MOV RDI,RBP MOV RSI,RAX POP RBP JMP zzip_disk_entry_fopen ;undefined zzip_disk_entry_fopen() ?? 66h f ?? 90h LAB_00104350: XOR EAX,EAX POP RBP RET ?? 66h f
zzip__new__ ZZIP_DISK_FILE * zzip_disk_fopen(ZZIP_DISK * disk, char *filename) { ZZIP_DISK_ENTRY *entry = zzip_disk_findfile(disk, filename, 0, 0); if (! entry) return 0; /* EBADMSG */ return zzip_disk_entry_fopen(disk, entry); }
char * file_entry_find_file (const char *filename, const char *file) { return file_entry_find_file (filename, file, NULL, NULL); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_findmatch() PUSH R15 MOV R15,RSI PUSH R14 MOV R14D,R8D PUSH R13 MOV R13,RCX PUSH R12 PUSH RBP PUSH RBX MOV RBX,RDI SUB RSP,0x8 TEST RDX,RDX JZ LAB_00104168 MOV RSI,RDX CALL zzip_disk_findnext ;undefined zzip_disk_findnext() MOV RBP,RAX LAB_001040ce: TEST R13,R13 JNZ LAB_00104115 JMP LAB_00104150 ?? 0Fh ?? 1Fh ?? 00h LAB_001040d8: MOV RSI,RBP MOV RDI,RBX CALL zzip_disk_entry_strdup_name ;undefined zzip_disk_entry_strdup_name() MOV R12,RAX TEST RAX,RAX JZ LAB_00104181 MOV RDI,R15 MOV EDX,R14D MOV RSI,RAX CALL R13=>EXTERNAL:<EXTERNAL>::fnmatch ;int fnmatch(char * __pattern, char *... MOV RDI,R12 TEST EAX,EAX JNZ LAB_00104140 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV RSI,RBP MOV RDI,RBX CALL zzip_disk_findnext ;undefined zzip_disk_findnext() MOV RBP,RAX LAB_00104115: TEST RBP,RBP JNZ LAB_001040d8 CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR EBP,EBP MOV dword ptr [RAX],0x2 LAB_00104127: ADD RSP,0x8 MOV RAX,RBP POP RBX POP RBP POP R12 POP R13 POP R14 POP R15 RET ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104140: CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) JMP LAB_00104127 ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104150: TEST byte ptr [RBX + 0x20],0x1 JZ LAB_00104178 MOV R13,qword ptr [-><EXTERNAL>::fnmatch] ;= 00109058 OR R14D,0x10 JMP LAB_00104115 ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00104168: CALL zzip_disk_findfirst ;undefined zzip_disk_findfirst() MOV RBP,RAX JMP LAB_001040ce ?? 0Fh ?? 1Fh ?? 00h LAB_00104178: MOV R13,qword ptr [-><EXTERNAL>::fnmatch] ;= 00109058 JMP LAB_00104115 LAB_00104181: XOR EBP,EBP JMP LAB_00104127 ?? 66h f
struct zzip_disk_entry * zzip_disk_findmatch(ZZIP_DISK * disk, char *filespec, struct zzip_disk_entry *after, zzip_fnmatch_fn_t compare, int flags) { struct zzip_disk_entry *entry = (! after? zzip_disk_findfirst(disk) : zzip_disk_findnext(disk, after)); if (! compare) { compare = (zzip_fnmatch_fn_t) _zzip_fnmatch; if (disk->flags & ZZIP_DISK_FLAGS_MATCH_NOCASE) flags |= _zzip_FNM_CASEFOLD; } for (; entry; entry = zzip_disk_findnext(disk, entry)) { /* filenames within zip files are often not null-terminated! */ char *realname = zzip_disk_entry_strdup_name(disk, entry); if (! realname) { return 0; /* ENOMEM | EBADMSG */ } if (compare(filespec, realname, flags)) { free(realname); return entry; /* found */ } free(realname); } errno = ENOENT; return 0; }
int z_match_entry(const char *name, const char *name, const char *name, const char *value) { struct z_match_entry *entry; int ret; if (!name) return 0; entry = z_find_entry(name); if (!entry) return 0; ret = z_match_entry(name, name, value); if (!ret) { free(entry); return 0; } ret = z_match_entry(entry, name, value); if (ret) { free(entry); return ret; } return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_findfile() PUSH R14 MOV R14,RSI PUSH R13 MOV R13,RCX PUSH R12 PUSH RBP PUSH RBX MOV RBX,RDI TEST RDX,RDX JZ LAB_00104080 MOV RSI,RDX CALL zzip_disk_findnext ;undefined zzip_disk_findnext() MOV RBP,RAX LAB_00103fe5: TEST R13,R13 JNZ LAB_0010402a JMP LAB_00104068 ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00103ff0: MOV RSI,RBP MOV RDI,RBX CALL zzip_disk_entry_strdup_name ;undefined zzip_disk_entry_strdup_name() MOV R12,RAX TEST RAX,RAX JZ LAB_00104099 MOV RDI,R14 MOV RSI,RAX CALL R13=>EXTERNAL:<EXTERNAL>::strcasecmp ;int strcasecmp(char * __s1, char * _... MOV RDI,R12 TEST EAX,EAX JZ LAB_00104050 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV RSI,RBP MOV RDI,RBX CALL zzip_disk_findnext ;undefined zzip_disk_findnext() MOV RBP,RAX LAB_0010402a: TEST RBP,RBP JNZ LAB_00103ff0 CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR EBP,EBP MOV dword ptr [RAX],0x2 LAB_0010403c: POP RBX MOV RAX,RBP POP RBP POP R12 POP R13 POP R14 RET ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104050: CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) POP RBX MOV RAX,RBP POP RBP POP R12 POP R13 POP R14 RET ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104068: TEST byte ptr [RBX + 0x20],0x1 JZ LAB_00104090 MOV R13,qword ptr [-><EXTERNAL>::strcasecmp] ;= 00109008 JMP LAB_0010402a ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104080: CALL zzip_disk_findfirst ;undefined zzip_disk_findfirst() MOV RBP,RAX JMP LAB_00103fe5 ?? 0Fh ?? 1Fh ?? 00h LAB_00104090: MOV R13,qword ptr [-><EXTERNAL>::strcmp] ;= 00109118 JMP LAB_0010402a LAB_00104099: XOR EBP,EBP JMP LAB_0010403c ?? 0Fh
struct zzip_disk_entry * zzip_disk_findfile(ZZIP_DISK * disk, char *filename, struct zzip_disk_entry *after, zzip_strcmp_fn_t compare) { struct zzip_disk_entry *entry = (! after? zzip_disk_findfirst(disk) : zzip_disk_findnext(disk, after)); if (! compare) compare = (zzip_strcmp_fn_t) ((disk->flags & ZZIP_DISK_FLAGS_MATCH_NOCASE)? (_zzip_strcasecmp) : (strcmp)); for (; entry; entry = zzip_disk_findnext(disk, entry)) { /* filenames within zip files are often not null-terminated! */ char *realname = zzip_disk_entry_strdup_name(disk, entry); if (! realname) { return 0; /* ENOMEM | EBADMSG */ } if (! compare(filename, realname)) { free(realname); return entry; /* found */ } free(realname); } errno = ENOENT; return 0; }
int file_find_entry(const char *name, const char *file, const char *name, const char *value) { FILE *f; int ret; if (!name) return 0; f = fopen(name, "r"); if (!f) return 0; f->name = strdup(name); if (!f->name) { free(f); return 0; } ret = file_find_entry(f, name, value); if (!ret) { free(f); return 0; } return ret; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_findnext() SUB RSP,0x8 TEST RDI,RDI JZ LAB_00103fa0 MOV RAX,RSI TEST RSI,RSI JZ LAB_00103fa0 CMP qword ptr [RDI],RSI JA LAB_00103f88 MOV RCX,qword ptr [RDI + 0x8] LEA RDX,[RCX + -0x8] CMP RDX,RSI JC LAB_00103f88 CMP byte ptr [RSI],0x50 JNZ LAB_00103f88 CMP byte ptr [RSI + 0x1],0x4b JNZ LAB_00103f88 CMP byte ptr [RSI + 0x2],0x1 JNZ LAB_00103f88 CMP byte ptr [RSI + 0x3],0x2 JNZ LAB_00103f88 MOVZX R10D,word ptr [RAX + 0x1e] MOVZX ESI,word ptr [RSI + 0x1c] MOVZX EDI,word ptr [RAX + 0x20] MOV R9,RSI MOV R8,R10 ADD ESI,R10D MOVZX R10D,DI ADD ESI,R10D CMP ESI,0xffd2 JG LAB_00103f88 LEA RSI,[R9 + R8*0x1 + 0x2e] ADD RSI,RDI ADD RAX,RSI CMP RDX,RAX JC LAB_00103f70 CMP byte ptr [RAX],0x50 JNZ LAB_00103f70 CMP byte ptr [RAX + 0x1],0x4b JNZ LAB_00103f70 CMP byte ptr [RAX + 0x2],0x1 JNZ LAB_00103f70 CMP byte ptr [RAX + 0x3],0x2 JNZ LAB_00103f70 MOVZX ESI,word ptr [RAX + 0x1e] MOVZX EDX,word ptr [RAX + 0x1c] ADD EDX,ESI MOVZX ESI,word ptr [RAX + 0x20] ADD EDX,ESI MOVSXD RDX,EDX LEA RSI,[RDX + 0x2e] CMP RSI,0x10000 JA LAB_00103f70 LEA RDX,[RAX + RDX*0x1 + 0x36] CMP RCX,RDX JNC LAB_00103f95 LAB_00103f70: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x2 XOR EAX,EAX ADD RSP,0x8 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103f88: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x4a XOR EAX,EAX LAB_00103f95: ADD RSP,0x8 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103fa0: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x16 XOR EAX,EAX ADD RSP,0x8 RET ?? 66h f
struct zzip_disk_entry * zzip_disk_findnext(ZZIP_DISK * disk, struct zzip_disk_entry *entry) { if (! disk ||! entry) { errno = EINVAL; return 0; } if ((zzip_byte_t *) entry < disk->buffer || (zzip_byte_t *) entry > disk->endbuf - sizeof(entry) || ! zzip_disk_entry_check_magic(entry) || zzip_disk_entry_sizeto_end(entry) > 64 * 1024) { errno = EBADMSG; return 0; } entry = zzip_disk_entry_to_next_entry(entry); if ((zzip_byte_t *) entry > disk->endbuf - sizeof(entry) || ! zzip_disk_entry_check_magic(entry) || zzip_disk_entry_sizeto_end(entry) > 64 * 1024 || zzip_disk_entry_skipto_end(entry) + sizeof(entry) > disk->endbuf) { errno = ENOENT; return 0; } return entry; }
int z_find_next (z_file_t *file, const char *name, int flags) { if (!file ||!name ||!name[0]) return 0; if (file->data[0] == '\0') return 0; if (file->data[1] == '\0') return 0; if (file->data[1] == '\0') return 0; if (file->data[2] == '\0') return 0; if (file->data[3] == '\0') return 0; if (file->data[3] == '\0') return 0; if (file->data[4] == '\0') return 0; if (file->data[4] == '\0') return 0; if (file->data[5] == '\0') return 0; if (file->data[5] == '\0') return 0; if (file->data[5] == '\0') return 0; if (file->data[5] == '\0') return 0; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_findfirst() SUB RSP,0x8 TEST RDI,RDI JZ LAB_00103e8c MOV RSI,qword ptr [RDI] MOV RDI,qword ptr [RDI + 0x8] LEA RAX,[RDI + -0x16] LEA RDX,[RSI + -0x1] CMP RSI,RAX JBE LAB_00103dcd JMP LAB_00103e76 ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103dc0: SUB RAX,0x1 CMP RDX,RAX JZ LAB_00103e60 LAB_00103dcd: CMP byte ptr [RAX],0x50 JNZ LAB_00103dc0 CMP byte ptr [RAX + 0x1],0x4b JNZ LAB_00103dc0 MOVZX ECX,byte ptr [RAX + 0x2] CMP CL,0x5 JZ LAB_00103e30 CMP CL,0x6 JNZ LAB_00103dc0 CMP byte ptr [RAX + 0x3],0x6 JNZ LAB_00103dc0 MOV R8,qword ptr [RAX + 0x30] ADD R8,RSI CMP R8,RAX JA LAB_00103dc0 MOV RCX,qword ptr [RAX + 0x28] LAB_00103dfc: CMP RSI,R8 JA LAB_00103e76 CMP RDI,R8 JBE LAB_00103e76 ADD RCX,R8 CMP RDI,RCX JBE LAB_00103e76 CMP byte ptr [R8],0x50 JNZ LAB_00103dc0 CMP byte ptr [R8 + 0x1],0x4b JNZ LAB_00103dc0 CMP byte ptr [R8 + 0x2],0x1 JNZ LAB_00103dc0 CMP byte ptr [R8 + 0x3],0x2 JNZ LAB_00103dc0 JMP LAB_00103e6e ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103e30: CMP byte ptr [RAX + 0x3],0x6 JNZ LAB_00103dc0 MOV R8D,dword ptr [RAX + 0x10] MOV ECX,dword ptr [RAX + 0xc] ADD R8,RSI CMP R8,RAX JBE LAB_00103dfc LEA R8,[RSI + RCX*0x1] CMP RAX,R8 JC LAB_00103dc0 MOV R8,RAX SUB R8,RCX JMP LAB_00103dfc ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103e60: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R8D,R8D MOV dword ptr [RAX],0x2 LAB_00103e6e: MOV RAX,R8 ADD RSP,0x8 RET LAB_00103e76: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R8D,R8D MOV dword ptr [RAX],0x4a MOV RAX,R8 ADD RSP,0x8 RET LAB_00103e8c: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R8D,R8D MOV dword ptr [RAX],0x16 JMP LAB_00103e6e ?? 0Fh
struct zzip_disk_entry * zzip_disk_findfirst(ZZIP_DISK * disk) { DBG1("findfirst"); if (! disk) { DBG1("non arg"); errno = EINVAL; return 0; } if (disk->buffer > disk->endbuf - sizeof(struct zzip_disk_trailer)) { DBG1("not enough data for a disk trailer"); errno = EBADMSG; return 0; } ___ zzip_byte_t *p = disk->endbuf - sizeof(struct zzip_disk_trailer); for (; p >= disk->buffer; p--) { zzip_byte_t *root; /* (struct zzip_disk_entry*) */ zzip_size_t rootsize; /* Size of root central directory */ if (zzip_disk_trailer_check_magic(p)) { struct zzip_disk_trailer *trailer = (struct zzip_disk_trailer *) p; zzip_size_t rootseek = zzip_disk_trailer_get_rootseek(trailer); rootsize = zzip_disk_trailer_get_rootsize(trailer); root = disk->buffer + rootseek; DBG2("disk rootseek at %lli", (long long)rootseek); if (root > p) { /* the first disk_entry is after the disk_trailer? can't be! */ DBG2("have rootsize at %lli", (long long)rootsize); if (disk->buffer + rootsize > p) continue; /* a common brokeness that can be fixed: we just assume the * central directory was written directly before the trailer:*/ root = p - rootsize; } } else if (zzip_disk64_trailer_check_magic(p)) { struct zzip_disk64_trailer *trailer = (struct zzip_disk64_trailer *) p; if (sizeof(void *) < 8) { DBG1("disk64 trailer in non-largefile part"); errno = EFBIG; return 0; } zzip_size_t rootseek = zzip_disk64_trailer_get_rootseek(trailer); rootsize = zzip_disk64_trailer_get_rootsize(trailer); DBG2("disk64 rootseek at %lli", (long long)rootseek); root = disk->buffer + rootseek; if (root > p) continue; } else { continue; } DBG4("buffer %p root %p endbuf %p", disk->buffer, root, disk->endbuf); if (root < disk->buffer) { DBG1("root before buffer should be impossible"); errno = EBADMSG; return 0; } if (root >= disk->endbuf || (root + rootsize) >= disk->endbuf) { DBG1("root behind endbuf should be impossible"); errno = EBADMSG; return 0; } if (zzip_disk_entry_check_magic(root)) { DBG2("found the disk root %p", root); return (struct zzip_disk_entry *) root; } } ____; /* not found */ errno = ENOENT; return 0; }
struct zparser * zparser_find_first(struct zparser *zparser) { struct zparser *zparser; struct zparser *zparser; zparser = zparser->zparser; if (!zparser) return NULL; zparser->zparser = zparser->zparser; zparser->zparser = zparser->zparser; zparser->zparser = zparser->zparser; zparser->zparser = zparser->zparser; zparser->zparser = zparser->zparser; zparser->zparser = zparser->zparser; zparser->zparser = zparser->zparser; zparser->zparser = zparser->zparser; return zparser; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_entry_strdup_comment() SUB RSP,0x8 TEST RDI,RDI JZ LAB_00103d68 TEST RSI,RSI JZ LAB_00103d68 MOVZX R8D,word ptr [RSI + 0x20] TEST R8,R8 JZ LAB_00103d80 MOVZX ECX,word ptr [RSI + 0x1c] MOVZX EDX,word ptr [RSI + 0x1e] MOV RAX,RDI LEA RDX,[RCX + RDX*0x1 + 0x2e] LEA RDI,[RSI + RDX*0x1] CMP qword ptr [RAX],RDI JA LAB_00103d50 LEA RDX,[RDI + R8*0x1] CMP qword ptr [RAX + 0x8],RDX JC LAB_00103d50 MOV RSI,R8 ADD RSP,0x8 JMP .plt:LAB_001020d0 ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103d50: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x4a XOR EAX,EAX ADD RSP,0x8 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103d68: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x16 XOR EAX,EAX ADD RSP,0x8 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103d80: LEA RDI,[.rodata:s__00105089+24] ;= "" ADD RSP,0x8 JMP .plt:LAB_001021b0 ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_findfirst() SUB RSP,0x8
zzip__new__ char * zzip_disk_entry_strdup_comment(ZZIP_DISK * disk, struct zzip_disk_entry *entry) { if (! disk ||! entry) { errno = EINVAL; return 0; } ___ zzip_size_t len = zzip_disk_entry_comment(entry); if (! len) { return strdup(""); /* ENOMEM */ } ___ char *text = zzip_disk_entry_to_comment(entry); if ((zzip_byte_t *) text < disk->buffer || (zzip_byte_t *) text + len > disk->endbuf) { errno = EBADMSG; return 0; } return _zzip_strndup(text, len); /* ENOMEM */ ____; ____; }
int z_z_entry_get_and_comment (z_entry_t *z_entry, const char *comment, const char *comment) { if (!z_entry ||!comment) return 0; z_entry->comment = z_strdup (comment); if (comment) z_entry->comment = z_strdup (comment); else z_entry->comment = z_strdup (comment); return z_entry->comment; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_entry_strdup_name() PUSH RBX TEST RDI,RDI JZ LAB_00103cf0 TEST RSI,RSI JZ LAB_00103cf0 MOVZX R8D,word ptr [RSI + 0x1c] MOV RBX,RDI LEA RDI,[RSI + 0x2e] TEST R8,R8 JZ LAB_00103cc0 LAB_00103c8c: CMP qword ptr [RBX],RDI JA LAB_00103ca8 LEA RAX,[RDI + R8*0x1] CMP qword ptr [RBX + 0x8],RAX JC LAB_00103ca8 MOV RSI,R8 POP RBX JMP .plt:LAB_001020d0 ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00103ca8: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x4a LAB_00103cb3: XOR EAX,EAX POP RBX RET ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103cc0: MOV RDI,RBX CALL zzip_disk_entry_to_file_header ;undefined zzip_disk_entry_to_file_he... TEST RAX,RAX JZ LAB_00103cb3 MOVZX R8D,word ptr [RAX + 0x1a] LEA RDI,[RAX + 0x1e] TEST R8,R8 JNZ LAB_00103c8c LEA RDI,[.rodata:s__00105089+24] ;= "" POP RBX JMP .plt:LAB_001021b0 ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103cf0: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x16 XOR EAX,EAX POP RBX RET ?? 90h
zzip__new__ char * zzip_disk_entry_strdup_name(ZZIP_DISK * disk, struct zzip_disk_entry *entry) { if (! disk ||! entry) { errno=EINVAL; return 0; } ___ char *name = 0; zzip_size_t len = len = zzip_disk_entry_namlen(entry); if (len) { name = zzip_disk_entry_to_filename(entry); } else { struct zzip_file_header *file = zzip_disk_entry_to_file_header(disk, entry); if (! file) return 0; /* EBADMSG */ len = zzip_file_header_namlen(file); if (! len) { /* neither a name in disk_entry nor in file_header */ return strdup(""); /* ENOMEM */ } name = zzip_file_header_to_filename(file); } if ((zzip_byte_t *) name < disk->buffer || (zzip_byte_t *) name + len > disk->endbuf) { errno=EBADMSG; return 0; } return _zzip_strndup(name, len); /* ENOMEM */ ____; }
int z_file_entry_to_header(z_file_entry_t *z_file, const char *name) { z_file_entry_t *z_entry; if (!z_file ||!name) { return 0; } z_entry = z_file_entry_to_header(z_file); if (z_entry == NULL) { return 0; } z_entry->name = z_strdup(name); if (z_entry->name == NULL) { return 0; } z_entry->name = z_strdup(name); if (z_entry->name == NULL) { return 0; } return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_entry_to_data() SUB RSP,0x8 CALL zzip_disk_entry_to_file_header ;undefined zzip_disk_entry_to_file_he... TEST RAX,RAX JZ LAB_00103c5e MOVZX ECX,word ptr [RAX + 0x1a] MOVZX EDX,word ptr [RAX + 0x1c] LEA RDX,[RCX + RDX*0x1 + 0x1e] ADD RAX,RDX LAB_00103c5e: ADD RSP,0x8 RET ?? 66h f
zzip_byte_t * zzip_disk_entry_to_data(ZZIP_DISK * disk, struct zzip_disk_entry * entry) { struct zzip_file_header *file = zzip_disk_entry_to_file_header(disk, entry); if (! file) return 0; /* EBADMSG */ return zzip_file_header_to_data(file); }
size_t z_file_to_entry_to_header(const char *file, size_t file_size, size_t file_size) { return z_file_to_entry_to_header(file, file_size, file_size, file_size); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_close() TEST RDI,RDI JZ LAB_00103b98 PUSH RBP CMP qword ptr [RDI + 0x28],-0x1 MOV RBP,RDI JNZ LAB_00103b78 TEST byte ptr [RDI + 0x20],0x2 JNZ LAB_00103b80 MOV RDI,RBP CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) XOR EAX,EAX POP RBP RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103b78: POP RBP JMP zzip_disk_munmap ;undefined zzip_disk_munmap() ?? 66h f ?? 90h LAB_00103b80: MOV RDI,qword ptr [RDI] CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV RDI,RBP CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) XOR EAX,EAX POP RBP RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00103b98: XOR EAX,EAX RET ?? 0Fh
int zzip_disk_close(ZZIP_DISK * disk) { if (! disk) return 0; if (disk->mapped!= -1) return zzip_disk_munmap(disk); if (disk->flags & ZZIP_DISK_FLAGS_OWNED_BUFFER) free(disk->buffer); free(disk); return 0; }
int z_disk_close (zdisk_t *disk) { if (disk == NULL) return 0; if (disk->disk!= NULL) { free (disk->disk); free (disk->disk); free (disk); } return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_buffer() PUSH RBP MOV RBP,RSI PUSH RBX MOV RBX,RDI SUB RSP,0x8 CALL zzip_disk_new ;undefined zzip_disk_new() TEST RAX,RAX JZ LAB_00103b48 MOV qword ptr [RAX],RBX ADD RBX,RBP MOV qword ptr [RAX + 0x8],RBX MOV qword ptr [RAX + 0x28],-0x1 LAB_00103b48: ADD RSP,0x8 POP RBX POP RBP RET ?? 90h
zzip__new__ ZZIP_DISK * zzip_disk_buffer(void *buffer, size_t buflen) { ZZIP_DISK *disk = zzip_disk_new(); if (disk) { disk->buffer = (zzip_byte_t *) buffer; disk->endbuf = (zzip_byte_t *) buffer + buflen; disk->mapped = -1; } return disk; }
void * z_buffer_new(const char *s, size_t len) { if (!s) return NULL; s = z_buffer_new(); if (!s) return NULL; s[len] = '\0'; s[len] = '\0'; return s; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_open() ;local_30 undefined8 -30 ;local_98 undefined8 -98 PUSH R13 PUSH R12 PUSH RBP MOV RBP,RDI PUSH RBX SUB RSP,0xa8 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_30+0xc8],RAX XOR EAX,EAX MOV RSI,RSP CALL .plt:<EXTERNAL>::stat ;int stat(char * __file, stat * __buf) TEST EAX,EAX JNZ LAB_00103ae0 CMP qword ptr [RSP + local_98+0xc8],0x0 JZ LAB_00103ae0 MOV RDI,RBP XOR ESI,ESI XOR EAX,EAX CALL .plt:<EXTERNAL>::open ;int open(char * __file, int __oflag,... MOV EBP,EAX TEST EAX,EAX JLE LAB_00103ae0 MOV EDI,EAX CALL zzip_disk_mmap ;undefined zzip_disk_mmap() MOV R12,RAX TEST RAX,RAX JNZ LAB_00103ae3 MOV RBX,qword ptr [RSP + local_98+0xc8] MOV RDI,RBX CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV R13,RAX TEST RAX,RAX JZ LAB_00103ae0 MOV RDX,RBX MOV RSI,RAX MOV EDI,EBP CALL .plt:<EXTERNAL>::read ;ssize_t read(int __fd, void * __buf,... CMP RBX,RAX JL LAB_00103b0c CALL zzip_disk_new ;undefined zzip_disk_new() MOV R12,RAX TEST RAX,RAX JZ LAB_00103b0c MOV qword ptr [RAX],R13 ADD R13,qword ptr [RSP + local_98+0xc8] OR qword ptr [RAX + 0x20],0x2 MOV qword ptr [RAX + 0x8],R13 MOV qword ptr [RAX + 0x28],-0x1 JMP LAB_00103ae3 ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103ae0: XOR R12D,R12D LAB_00103ae3: MOV RAX,qword ptr [RSP + local_30+0xc8] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00103b07 ADD RSP,0xa8 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 RET LAB_00103b07: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() LAB_00103b0c: MOV RDI,R13 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) JMP LAB_00103ae3 ?? 66h f
zzip__new__ ZZIP_DISK * zzip_disk_open(char *filename) { # ifndef O_BINARY # define O_BINARY 0 # endif struct stat st; if (stat(filename, &st) ||! st.st_size) return 0; /* ENOENT */ ___ int fd = open(filename, O_RDONLY | O_BINARY); if (fd <= 0) return 0; /* EACCESS */ ___ ZZIP_DISK *disk = zzip_disk_mmap(fd); if (disk) return disk; ___ zzip_byte_t *buffer = malloc(st.st_size); if (! buffer) { return 0; /* ENOMEM */ } if ((st.st_size < read(fd, buffer, st.st_size))) { free (buffer); return 0; /* EIO */ } disk = zzip_disk_new(); if (! disk) { free (buffer); return 0; /* ENOMEM */ } disk->buffer = buffer; disk->endbuf = buffer + st.st_size; disk->mapped = -1; disk->flags |= ZZIP_DISK_FLAGS_OWNED_BUFFER; return disk; ____; ____; ____; }
int file_open(const char *path, const char *path) { struct stat st; struct stat st; if (!path) return 0; st.st_mode = 0; st.st_mode = path; st.st_mode = path; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; st.st_mode = 0; if (st.st_mode) { st.st_mode = st.st_mode; st.st_mode = st.st_mode; if (st.st_mode) st.st_mode = st.st_mode; if (st.st_mode) st.st_mode = st.st_mode; else st.st_mode = st.st_mode; } return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_munmap() TEST RDI,RDI JZ LAB_00103a28 SUB RSP,0x8 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) XOR EAX,EAX ADD RSP,0x8 RET ?? 0Fh ?? 1Fh ?? 00h LAB_00103a28: XOR EAX,EAX RET ?? 0Fh
int zzip_disk_munmap(ZZIP_DISK * disk) { if (! disk) return 0; _zzip_munmap(disk->mapped, disk->buffer, disk->endbuf - disk->buffer); free(disk); return 0; }
int z_diskdisk_free (zdiskdisk *disk) { if (disk == NULL) return 0; free (disk); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_mmap() ;local_10 undefined8 -10 ;local_78 undefined8 -78 SUB RSP,0xa8 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_10+0xa8],RAX XOR EAX,EAX MOV RSI,RSP CALL .plt:<EXTERNAL>::fstat ;int fstat(int __fd, stat * __buf) TEST EAX,EAX JNZ LAB_001039ce CMP qword ptr [RSP + local_78+0xa8],0x0 JNZ LAB_001039f0 LAB_001039ce: MOV RAX,qword ptr [RSP + local_10+0xa8] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00103a04 XOR EAX,EAX ADD RSP,0xa8 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001039f0: CALL zzip_disk_new ;undefined zzip_disk_new() MOV RDI,RAX TEST RAX,RAX JZ LAB_001039ce CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) JMP LAB_001039ce LAB_00103a04: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr [RAX]
zzip__new__ ZZIP_DISK * zzip_disk_mmap(int fd) { struct stat st; if (fstat(fd, &st) ||! st.st_size) return 0; /* EACCESS */ ___ ZZIP_DISK *disk = zzip_disk_new(); if (! disk) return 0; /* ENOMEM */ disk->buffer = _zzip_mmap(disk->mapped, fd, 0, st.st_size); if (disk->buffer == MAP_FAILED) { free (disk); return 0; /* EFAULT */ } disk->endbuf = disk->buffer + st.st_size; return disk; ____; }
int z_disk_new(const char *name) { struct stat st; int ret; ret = zdisk_disk_new(name, &st); if (ret < 0) return (ret); if (ret < 0) return (ret); return (ret); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_new() PUSH R12 MOV EDI,0x40 CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV R12,RAX TEST RAX,RAX JZ LAB_00103990 XOR EDX,EDX XOR ESI,ESI MOV RDI,RAX CALL zzip_disk_init ;undefined zzip_disk_init() LAB_00103990: MOV RAX,R12 POP R12 RET ?? 66h f
zzip__new__ ZZIP_DISK * zzip_disk_new(void) { ZZIP_DISK *disk = malloc(sizeof(ZZIP_DISK)); if (! disk) return disk; /* ENOMEM */ zzip_disk_init(disk, 0, 0); return disk; }
size_t z_disk_init(void) { z_disk_t *disk; disk = (z_disk_t *) malloc(sizeof(z_disk_t)); if (!disk) return 0; disk->disk = z_disk_new(); return (disk); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_disk_init() MOV qword ptr [RDI],RSI ADD RSI,RDX XOR EAX,EAX MOV qword ptr [RDI + 0x8],RSI MOV qword ptr [RDI + 0x10],0x0 MOV qword ptr [RDI + 0x20],0x0 MOV qword ptr [RDI + 0x28],0x0 RET ?? 66h f
int zzip_disk_init(ZZIP_DISK * disk, void *buffer, zzip_size_t buflen) { disk->buffer = (zzip_byte_t *) buffer; disk->endbuf = (zzip_byte_t *) buffer + buflen; disk->reserved = 0; disk->flags = 0; disk->mapped = 0; /* do not touch disk->user */ /* do not touch disk->code */ return 0; }
int z_disk_disk_init(z_disk_disk_t *disk, zdisk_disk_t *disk, zdisk_disk_t *disk) { disk->disk =disk; disk->disk =disk; disk->disk =disk; disk->disk =disk; disk->disk =disk; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined makedirs() PUSH R12 MOV ESI,0x2f PUSH RBP MOV RBP,RDI SUB RSP,0x8 CALL .plt:<EXTERNAL>::strrchr ;char * strrchr(char * __s, int __c) TEST RAX,RAX JZ LAB_0010249a SUB RAX,RBP MOV RDI,RBP MOV RSI,RAX CALL .plt:<EXTERNAL>::strndup ;char * strndup(char * __string, size... MOV R12,RAX MOV RDI,RAX CALL makedirs ;undefined makedirs() MOV RDI,R12 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_0010249a: MOV RDI,RBP MOV ESI,0x1fd CALL .plt:<EXTERNAL>::mkdir ;int mkdir(char * __path, __mode_t __... CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x0 ADD RSP,0x8 POP RBP POP R12 RET ?? 66h f
static void makedirs(const char* name) { char* p = strrchr(name, '/'); if (p) { char* dir_name = _zzip_strndup(name, p-name); makedirs(dir_name); free (dir_name); } if (_zzip_mkdir(name, 0775) == -1 && errno!= EEXIST) { DBG3("while mkdir %s : %s", name, strerror(errno)); } errno = 0; }
char * getpath(const char *path) { char *path; path = strrchr(path, '/'); if (path == NULL) { errno = EINVAL; return NULL; } path = strrchr(path, '/'); if (path == NULL) { errno = EINVAL; return NULL; } free(path); return path; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined exitcode() CMP EDI,0xffffefed JGE LAB_001024f0 CMP EDI,0xffffefdf JL switchD_001024e9::caseD_ffffefe2 ADD EDI,0x1021 CMP EDI,0xd JA switchD_001024e9::caseD_ffffefe2 LEA RDX,[.rodata:switchD_001024e9::switchdataD_00104004] ;= FFFFE4FCh MOVSXD RAX,dword ptr [RDX + RDI*offset.rodata:switchD_001024e9::switchdataD_00104004 &0xff] ;= FFFFE4FCh ADD RAX,RDX switchD: ; FWD[7,0]: 00102500,00102510,00102520,00102530 ; 00102540,00102550,00102560 JMP RAX ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001024f0: XOR EAX,EAX TEST EDI,EDI SETNZ AL ADD EAX,EAX RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h caseD_ffffefe0: caseD_ffffefe1: caseD_ffffefe6: caseD_ffffefe7: caseD_ffffefe8: caseD_ffffefe9: caseD_ffffefea: caseD_ffffefdf: MOV EAX,0x3 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h caseD_ffffefe2: MOV EAX,0x2 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h caseD_ffffefe5: MOV EAX,0x33 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h caseD_ffffefe3: MOV EAX,0x51 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h caseD_ffffefe4: MOV EAX,0xb RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h caseD_ffffefeb: MOV EAX,0x9 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h caseD_ffffefec: MOV EAX,0x4 RET ?? 66h f
int exitcode(int e) { switch (e) { case ZZIP_NO_ERROR: return EXIT_OK; case ZZIP_OUTOFMEM: /* out of memory */ return EXIT_ENOMEM; case ZZIP_DIR_OPEN: /* failed to open zipfile, see errno for details */ return EXIT_ZIP_NOT_FOUND; case ZZIP_DIR_STAT: /* failed to fstat zipfile, see errno for details */ case ZZIP_DIR_SEEK: /* failed to lseek zipfile, see errno for details */ case ZZIP_DIR_READ: /* failed to read zipfile, see errno for details */ case ZZIP_DIR_TOO_SHORT: case ZZIP_DIR_EDH_MISSING: return EXIT_FILEFORMAT; case ZZIP_DIRSIZE: return EXIT_EARLY_END_OF_FILE; case ZZIP_ENOENT: return EXIT_FILE_NOT_FOUND; case ZZIP_UNSUPP_COMPR: return EXIT_UNSUPPORTED_COMPRESSION; case ZZIP_CORRUPTED: case ZZIP_UNDEF: case ZZIP_DIR_LARGEFILE: return EXIT_FILEFORMAT; } return EXIT_ERRORS; }
const char * log_code_code(int code) { switch (code) { case AF_INET6: return "code"; case AF_INET6: return "code"; case AF_INET6: return "code"; case AF_INET6: return "code"; default: return NULL; } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_extract() MOV EDX,0x1 JMP unzzip_cat ;undefined unzzip_cat() ?? 66h f
int unzzip_extract (int argc, char ** argv) { return unzzip_cat(argc, argv, 1); }
static int ip_ip(const char *s1, const char *s2) { return (ip_ip(s1, s2, 1)); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_print() XOR EDX,EDX JMP unzzip_cat ;undefined unzzip_cat() ?? 66h f
int unzzip_print (int argc, char ** argv) { return unzzip_cat(argc, argv, 0); }
int ip_print(const char *s, const char *s) { return (ip_print(s, s, 0)); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_cat_file() ;local_20 undefined8 -20 PUSH R12 MOV R12,RDX PUSH RBP PUSH RBX SUB RSP,0x410 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x428],RAX XOR EAX,EAX CALL zzip_entry_ffile ;undefined zzip_entry_ffile() TEST RAX,RAX JZ LAB_001027dc MOV RBP,RAX MOV RBX,RSP JMP LAB_001027bb ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001027a8: MOVSXD RSI,EAX MOV RCX,R12 MOV EDX,0x1 MOV RDI,RBX CALL .plt:<EXTERNAL>::fwrite ;size_t fwrite(void * __ptr, size_t _... LAB_001027bb: MOV RCX,RBP MOV EDX,0x1 MOV ESI,0x400 MOV RDI,RBX CALL zzip_entry_fread ;undefined zzip_entry_fread() TEST EAX,EAX JG LAB_001027a8 MOV RDI,RBP CALL zzip_entry_fclose ;undefined zzip_entry_fclose() LAB_001027dc: MOV RAX,qword ptr [RSP + local_20+0x428] SUB RAX,qword ptr FS:[0x28] JNZ LAB_001027fb ADD RSP,0x410 POP RBX POP RBP POP R12 RET LAB_001027fb: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_cat() ;local_40 undefined8 -40 ;local_44 undefined4 -44 PUSH R15
static void unzzip_cat_file(FILE* disk, char* name, FILE* out) { ZZIP_ENTRY_FILE* file = zzip_entry_ffile (disk, name); if (file) { char buffer[1024]; int len; while (0 < (len = zzip_entry_fread (buffer, 1024, 1, file))) fwrite (buffer, len, 1, out); zzip_entry_fclose (file); } }
int zfile_write_entry(zfile_t *file, FILE *fp) { FILE *fp; FILE *fp; FILE *fp; fp = zfile_read_entry(file, fp); if (fp == NULL) return 0; fp = zfile_entry_read(fp, fp); if (fp == NULL) return 0; fclose(fp); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_big_entry_fprint() ;local_20 undefined8 -20 PUSH R12 MOV R12,RSI XOR ESI,ESI PUSH RBP PUSH RBX SUB RSP,0x410 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x428],RAX XOR EAX,EAX CALL zzip_entry_fopen ;undefined zzip_entry_fopen() TEST RAX,RAX JZ LAB_0010274c MOV RBP,RAX MOV RBX,RSP JMP LAB_0010272b ?? 0Fh ?? 1Fh ?? 00h LAB_00102718: MOVSXD RSI,EAX MOV RCX,R12 MOV EDX,0x1 MOV RDI,RBX CALL .plt:<EXTERNAL>::fwrite ;size_t fwrite(void * __ptr, size_t _... LAB_0010272b: MOV RCX,RBP MOV EDX,0x1 MOV ESI,0x400 MOV RDI,RBX CALL zzip_entry_fread ;undefined zzip_entry_fread() TEST EAX,EAX JG LAB_00102718 MOV RDI,RBP CALL zzip_entry_fclose ;undefined zzip_entry_fclose() LAB_0010274c: MOV RAX,qword ptr [RSP + local_20+0x428] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010276b ADD RSP,0x410 POP RBX POP RBP POP R12 RET LAB_0010276b: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_cat_file() ;local_20 undefined8 -20 PUSH R12
static void unzzip_big_entry_fprint(ZZIP_ENTRY* entry, FILE* out) { ZZIP_ENTRY_FILE* file = zzip_entry_fopen (entry, 0); if (file) { char buffer[1024]; int len; while (0 < (len = zzip_entry_fread (buffer, 1024, 1, file))) { DBG2("entry read %i", len); fwrite (buffer, len, 1, out); } DBG2("entry done %s", strerror(errno)); zzip_entry_fclose (file); } else { DBG2("could not open entry: %s", strerror(errno)); } }
int z_file_entry_write(FILE *fp, FILE *fp) { FILE *fp; FILE *fp; FILE *fp; fp = z_file_entry_read(fp, fp); if (fp == NULL) return 0; fp = z_file_entry_read(fp, fp); if (fp == NULL) return 0; z_file_entry_delete(fp); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_show_list() JMP unzzip_list.constprop.0 ?? 66h f
int unzzip_show_list (int argc, char ** argv) { return unzzip_list(argc, argv, 0); }
static int list_show(struct list *list, int argc, char **argv) { return list_show(list, argc, argv); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_long_list() JMP unzzip_list.constprop.0 ?? 66h f
int unzzip_long_list (int argc, char ** argv) { return unzzip_list(argc, argv, 1); }
static int list_long(struct list *list, const char *name, const char *value) { return list_long(list, name, value); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_entry_feof() MOV EAX,0x1 TEST RDI,RDI JZ LAB_00103a54 XOR EAX,EAX CMP qword ptr [RDI + 0x30],0x0 SETZ AL LAB_00103a54: RET ?? 66h f
int zzip_entry_feof(ZZIP_ENTRY_FILE * file) { return! file ||! file->avail; }
int z_z_entry_entry_z(z_entry_t *z_entry) { if (!z_entry) return 0; return z_entry->z_entry_z; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_entry_fclose() PUSH RBP TEST RDI,RDI JZ LAB_00103a23 CMP qword ptr [RDI + 0x38],0x0 MOV RBP,RDI JNZ LAB_00103a18 LAB_00103a00: MOV RDI,qword ptr [RBP + 0x20] CALL zzip_entry_free ;undefined zzip_entry_free() MOV RDI,RBP CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) XOR EAX,EAX POP RBP RET ?? 0Fh ?? 1Fh ?? 00h LAB_00103a18: LEA RDI,[RDI + 0x48] CALL .plt:<EXTERNAL>::inflateEnd ;undefined inflateEnd() JMP LAB_00103a00 LAB_00103a23: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x16 MOV EAX,0xffffffff POP RBP RET ?? 66h f
int zzip_entry_fclose(ZZIP_ENTRY_FILE * file) { if (! file) { errno = EINVAL; return EOF; } if (file->compressed) inflateEnd(&file->zlib); zzip_entry_free(file->entry); free(file); return 0; }
int zz_entry_free (z_entry_t *z_entry) { if (z_entry == NULL) return (-1); z_entry_free (z_entry->z_entry); z_entry_free (z_entry); return (0); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_entry_ffile() SUB RSP,0x8 XOR ECX,ECX XOR EDX,EDX CALL zzip_entry_findfile ;undefined zzip_entry_findfile() TEST RAX,RAX JZ LAB_00103843 MOV RDI,RAX MOV ESI,0x1 ADD RSP,0x8 JMP zzip_entry_fopen ;undefined zzip_entry_fopen() LAB_00103843: XOR EAX,EAX POP RDX RET ?? 66h f
zzip__new__ ZZIP_ENTRY_FILE * zzip_entry_ffile(FILE * disk, char *filename) { ZZIP_ENTRY *entry = zzip_entry_findfile(disk, filename, 0, 0); if (! entry) { return 0; /* EBADMSG */ } return zzip_entry_fopen(entry, 1); }
int zfile_entry_entry_find_file (zfile_entry_t *entry) { zfile_entry_entry_t *entry; entry = zfile_entry_find_entry (entry, NULL, 0); if (!entry) return 0; return zfile_entry_entry_find_file (entry, 0, entry); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_entry_findmatch() PUSH R14 PUSH R13 PUSH R12 PUSH RBP PUSH RBX TEST RSI,RSI JZ LAB_001035b8 MOV R9,RDI TEST RDI,RDI JZ LAB_001035b8 MOV RBP,RSI MOV RDI,RDX MOV RBX,RCX MOV R13D,R8D TEST RDX,RDX JZ LAB_00103598 CALL zzip_entry_findnext ;undefined zzip_entry_findnext() MOV R12,RAX TEST RBX,RBX JZ LAB_001035a8 LAB_0010353b: TEST R12,R12 JZ LAB_001035d7 MOV RDI,R12 CALL zzip_entry_strdup_name ;undefined zzip_entry_strdup_name() MOV R14,RAX TEST RAX,RAX JZ LAB_001035d2 MOV RDI,RBP MOV EDX,R13D MOV RSI,RAX CALL RBX MOV RDI,R14 TEST EAX,EAX JNZ LAB_00103580 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_0010356b: POP RBX MOV RAX,R12 POP RBP POP R12 POP R13 POP R14 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00103580: CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV RDI,R12 CALL zzip_entry_findnext ;undefined zzip_entry_findnext() MOV R12,RAX JMP LAB_0010353b ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103598: MOV RDI,R9 CALL zzip_entry_findfirst ;undefined zzip_entry_findfirst() MOV R12,RAX TEST RBX,RBX JNZ LAB_0010353b LAB_001035a8: MOV RBX,qword ptr [-><EXTERNAL>::fnmatch] ;= 00107100 JMP LAB_0010353b ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001035b8: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R12D,R12D MOV dword ptr [RAX],0x16 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 POP R14 RET LAB_001035d2: XOR R12D,R12D JMP LAB_0010356b LAB_001035d7: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R12D,R12D MOV dword ptr [RAX],0x2 JMP LAB_0010356b ?? 66h f
zzip__new__ ZZIP_ENTRY * zzip_entry_findmatch(FILE * disk, char *filespec, ZZIP_ENTRY * _zzip_restrict entry, zzip_fnmatch_fn_t compare, int flags) { if (! filespec ||! disk) { errno = EINVAL; return 0; } if (! entry) entry = zzip_entry_findfirst(disk); else entry = zzip_entry_findnext(entry); if (! compare) compare = (zzip_fnmatch_fn_t) _zzip_fnmatch; for (; entry; entry = zzip_entry_findnext(entry)) { /* filenames within zip files are often not null-terminated! */ char *realname = zzip_entry_strdup_name(entry); if (! realname) { return 0; /* ENOMEM|EBADMSG */ } if (! compare(filespec, realname, flags)) { debug3("compare '%s' equal with zip '%s'", filespec, realname); free(realname); return entry; } else { debug3("compare '%s' not like zip '%s'", filespec, realname); free(realname); continue; } } errno = ENOENT; return 0; }
int z_entry_find_entry(z_entry_t *z_entry, const char *name, const char *name, const char *value) { z_entry_t *z_entry; z_entry_t *z_entry; z_entry = z_entry_find_entry(z_entry, name, value); if (z_entry == NULL) { return 0; } z_entry = z_entry_find_entry(z_entry, name); if (z_entry == NULL) { return 0; } if (z_entry == NULL) { return 0; } z_entry = z_entry_find_entry(z_entry, z_entry); if (z_entry == NULL) { return 0; } if (z_entry == NULL) { return 0; } z_entry = z_entry_find_entry(z_entry, z_entry); if (z_entry == NULL) { return 0; } if (z_entry == NULL) { return 0; } z_entry = z_entry_find_entry(z_entry, z_entry); if (z_entry == NULL) { return 0; } return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_entry_findfile() PUSH R13 PUSH R12 PUSH RBP PUSH RBX SUB RSP,0x8 TEST RSI,RSI JZ LAB_001034c0 MOV R8,RDI TEST RDI,RDI JZ LAB_001034c0 MOV RBP,RSI MOV RDI,RDX MOV RBX,RCX TEST RDX,RDX JZ LAB_001034a0 CALL zzip_entry_findnext ;undefined zzip_entry_findnext() MOV R12,RAX TEST RBX,RBX JZ LAB_001034b0 LAB_0010344a: TEST R12,R12 JZ LAB_001034e1 MOV RDI,R12 CALL zzip_entry_strdup_name ;undefined zzip_entry_strdup_name() MOV R13,RAX TEST RAX,RAX JZ LAB_001034dc MOV RDI,RBP MOV RSI,RAX CALL RBX MOV RDI,R13 TEST EAX,EAX JNZ LAB_00103488 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00103477: ADD RSP,0x8 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 RET ?? 0Fh ?? 1Fh ?? 00h LAB_00103488: CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV RDI,R12 CALL zzip_entry_findnext ;undefined zzip_entry_findnext() MOV R12,RAX JMP LAB_0010344a ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001034a0: MOV RDI,R8 CALL zzip_entry_findfirst ;undefined zzip_entry_findfirst() MOV R12,RAX TEST RBX,RBX JNZ LAB_0010344a LAB_001034b0: MOV RBX,qword ptr [-><EXTERNAL>::strcmp] ;= 00107108 JMP LAB_0010344a ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001034c0: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R12D,R12D MOV dword ptr [RAX],0x16 ADD RSP,0x8 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 RET LAB_001034dc: XOR R12D,R12D JMP LAB_00103477 LAB_001034e1: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R12D,R12D MOV dword ptr [RAX],0x2 JMP LAB_00103477 ?? 66h f
zzip__new__ ZZIP_ENTRY * zzip_entry_findfile(FILE * disk, char *filename, ZZIP_ENTRY * _zzip_restrict entry, zzip_strcmp_fn_t compare) { if (! filename ||! disk) { errno = EINVAL; return 0; } if (! entry) entry = zzip_entry_findfirst(disk); else entry = zzip_entry_findnext(entry); if (! compare) compare = (zzip_strcmp_fn_t) (strcmp); for (; entry; entry = zzip_entry_findnext(entry)) { /* filenames within zip files are often not null-terminated! */ char *realname = zzip_entry_strdup_name(entry); if (! realname) { return 0; /* ENOMEM|EBADMSG */ } if (! compare(filename, realname)) { free(realname); return entry; } else { free(realname); continue; } } errno = ENOENT; return 0; }
int z_file_entry_find_name (z_file_entry_t *entry, const char *name, const char *name, const char *name) { z_file_entry_t *entry; int ret; if (!name ||!name) return 0; entry = z_file_entry_find_entry (entry, name); if (!entry) return 0; ret = z_file_entry_find_name (entry, name, name); if (!ret) return 0; ret = z_file_entry_find_name (entry, entry); if (!ret) return 0; if (!ret) return 0; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_entry_findnext() PUSH RBP PUSH RBX SUB RSP,0x8 TEST RDI,RDI JZ LAB_001033d8 CMP byte ptr [RDI],0x50 MOV RBP,RDI JNZ LAB_001033b8 CMP byte ptr [RDI + 0x1],0x4b JNZ LAB_001033b8 CMP byte ptr [RDI + 0x2],0x1 JNZ LAB_001033b8 CMP byte ptr [RDI + 0x3],0x2 JNZ LAB_001033b8 MOVZX EDX,word ptr [RDI + 0x1e] MOVZX EAX,word ptr [RDI + 0x1c] ADD EAX,EDX MOVZX EDX,word ptr [RDI + 0x20] ADD EAX,EDX CDQE ADD RAX,qword ptr [RDI + 0x50] LEA RDX,[RAX + 0x5b] CMP RDX,qword ptr [RDI + 0x48] JGE LAB_001033b8 LEA RBX,[RAX + 0x2e] MOV RDI,qword ptr [RDI + 0x40] XOR EDX,EDX MOV RSI,RBX CALL .plt:<EXTERNAL>::fseek ;int fseek(FILE * __stream, long __of... CMP EAX,-0x1 JZ LAB_001033c3 MOV RCX,qword ptr [RBP + 0x40] MOV EDX,0x2e MOV ESI,0x1 MOV RDI,RBP CALL .plt:<EXTERNAL>::fread ;size_t fread(void * __ptr, size_t __... CMP RAX,0x2d JBE LAB_001033f0 CMP byte ptr [RBP],0x50 MOV qword ptr [RBP + 0x50],RBX JNZ LAB_001033b8 CMP byte ptr [RBP + 0x1],0x4b JNZ LAB_001033b8 CMP byte ptr [RBP + 0x2],0x1 JNZ LAB_001033b8 CMP byte ptr [RBP + 0x3],0x2 JNZ LAB_001033b8 MOV RDI,RBP CALL prescan_entry ;undefined prescan_entry() MOV EBX,EAX MOV RAX,RBP TEST EBX,EBX JZ LAB_001033cd CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],EBX JMP LAB_001033c3 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001033b8: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x4a LAB_001033c3: MOV RDI,RBP CALL zzip_entry_free ;undefined zzip_entry_free() XOR EAX,EAX LAB_001033cd: ADD RSP,0x8 POP RBX POP RBP RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_001033d8: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV dword ptr [RAX],0x16 XOR EAX,EAX JMP LAB_001033cd ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001033f0: MOV RDI,qword ptr [RBP + 0x40] CALL .plt:<EXTERNAL>::ferror ;int ferror(FILE * __stream) CMP EAX,0x1 SBB EBX,EBX CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) AND EBX,0xfffffffc ADD EBX,0x9 MOV dword ptr [RAX],EBX JMP LAB_001033c3 ?? 0Fh
zzip__new__ ZZIP_ENTRY * zzip_entry_findnext(ZZIP_ENTRY * _zzip_restrict entry) { if (! entry) { errno = EINVAL; return entry; } if (! zzip_disk_entry_check_magic(entry)) goto error_EBADMSG; ___ zzip_off_t seek = entry->headseek + zzip_disk_entry_sizeto_end(disk_(entry)); if (seek + (zzip_off_t) sizeof(*disk_(entry)) > entry->disksize) goto error_EBADMSG; if (fseeko(entry->diskfile, seek, SEEK_SET) == -1) goto error; /* EBADF */ if (fread(disk_(entry), 1, sizeof(*disk_(entry)), entry->diskfile) < sizeof(*disk_(entry))) { errno = ferror(entry->diskfile)? EBADF : EIO; goto error; } entry->headseek = seek; if (! zzip_disk_entry_check_magic(entry)) goto error_EBADMSG; ___ int err = prescan_entry(entry); if (err) { errno = err; goto error; } return entry; ____; error_EBADMSG: errno = EBADMSG; error: zzip_entry_free(entry); return 0; ____; }
static int zscan_entry_next (zscan_entry_t *zscan) { zscan_entry_t *zscan = zscan->zscan_entry; if (!zscan->zscan_entry) return 0; zscan->zscan_entry = zscan->zscan_entry; if (!zscan->zscan_entry) return 0; zscan->zscan_entry = zscan->zscan_entry; if (zscan->zscan_entry) { zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; zscan->zscan_entry = zscan->zscan_entry; } return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined prescan_entry() TEST RDI,RDI JZ LAB_00102cc0 PUSH R12 PUSH RBP PUSH RBX MOVZX EAX,word ptr [RDI + 0x1e] MOV RBX,RDI MOVZX EBP,word ptr [RDI + 0x1c] ADD EBP,EAX MOVZX EAX,word ptr [RDI + 0x20] MOV RDI,qword ptr [RDI + 0x30] ADD EBP,EAX MOVSXD RBP,EBP CMP qword ptr [RBX + 0x38],RBP JLE LAB_00102ca0 LAB_00102c79: MOV RCX,qword ptr [RBX + 0x40] MOV RDX,RBP MOV ESI,0x1 CALL .plt:<EXTERNAL>::fread ;size_t fread(void * __ptr, size_t __... MOV R8,RAX XOR EAX,EAX CMP RBP,R8 JZ LAB_00102c9b CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) MOV EAX,dword ptr [RAX] LAB_00102c9b: POP RBX POP RBP POP R12 RET LAB_00102ca0: LEA R12,[RBP + 0x1] MOV RSI,R12 CALL .plt:<EXTERNAL>::realloc ;void * realloc(void * __ptr, size_t... MOV RDI,RAX TEST RAX,RAX JZ LAB_00102cc6 MOV qword ptr [RBX + 0x30],RAX MOV qword ptr [RBX + 0x38],R12 JMP LAB_00102c79 ?? 66h f ?? 90h LAB_00102cc0: MOV EAX,0x16 RET LAB_00102cc6: MOV EAX,0xc JMP LAB_00102c9b ?? 0Fh
static int prescan_entry(ZZIP_ENTRY * entry) { if (! entry) return EINVAL; ___ zzip_off_t tailsize = zzip_disk_entry_sizeof_tails(disk_(entry)); if (tailsize + 1 > entry->tailalloc) { char *newtail = realloc(entry->tail, tailsize + 1); if (! newtail) return ENOMEM; entry->tail = newtail; entry->tailalloc = tailsize + 1; } # ifdef SIZE_MAX /* from stdint.h */ if ((unsigned long long)(tailsize) > (unsigned long long)(SIZE_MAX)) { debug3("tailsize %llu bigger than sizemax %llu", (long long)(tailsize), (long long)(SIZE_MAX)); return EFBIG; } # endif ___ zzip_size_t readsize = fread(entry->tail, 1, tailsize, entry->diskfile); /* name + comment + extras */ if ((zzip_off_t)readsize!= tailsize) { debug1("read to data"); return errno; } else { return 0; } ____; ____; }
static int read_scan_entry(FILE *fp) { FILE *fp; int ret; fp = malloc(sizeof(FILE)); if (fp == NULL) return -1; ret = write(fp, fp); if (ret < 0) return ret; fp->pos = fp->pos; fp->pos = fp->pos; fp->pos = fp->pos; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_entry_strdup_name() ;local_20 undefined8 -20 ;local_2e undefined2 -2e PUSH R12 PUSH RBP PUSH RBX SUB RSP,0x30 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x48],RAX XOR EAX,EAX TEST RDI,RDI JZ LAB_00102ef0 MOVZX EBP,word ptr [RDI + 0x1c] MOV RBX,RDI TEST RBP,RBP JZ LAB_00102e98 LEA RDI,[RBP + 0x1] CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV R12,RAX TEST RAX,RAX JZ LAB_00102e72 MOV RSI,qword ptr [RBX + 0x30] MOV RDX,RBP MOV RDI,RAX CALL .plt:<EXTERNAL>::memcpy ;void * memcpy(void * __dest, void *... MOV byte ptr [R12 + RBP*0x1],0x0 LAB_00102e72: MOV RAX,qword ptr [RSP + local_20+0x48] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00102f33 ADD RSP,0x30 MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102e98: MOV RSI,RSP CALL zzip_entry_fread_file_header ;undefined zzip_entry_fread_file_head... TEST RAX,RAX JZ LAB_00102ee0 MOVZX EBP,word ptr [RSP + local_2e+0x48] TEST RBP,RBP JZ LAB_00102ee0 LEA RDI,[RBP + 0x1] CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV R12,RAX TEST RAX,RAX JZ LAB_00102e72 MOV RCX,qword ptr [RBX + 0x40] MOV RDX,RBP MOV ESI,0x1 MOV RDI,RAX CALL .plt:<EXTERNAL>::fread ;size_t fread(void * __ptr, size_t __... CMP RBP,RAX JA LAB_00102f08 MOV byte ptr [R12 + RAX*0x1],0x0 JMP LAB_00102e72 LAB_00102ee0: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R12D,R12D MOV dword ptr [RAX],0x4a JMP LAB_00102e72 LAB_00102ef0: CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) XOR R12D,R12D MOV dword ptr [RAX],0x16 JMP LAB_00102e72 ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102f08: MOV RDI,qword ptr [RBX + 0x40] CALL .plt:<EXTERNAL>::ferror ;int ferror(FILE * __stream) CMP EAX,0x1 SBB EBX,EBX CALL .plt:<EXTERNAL>::__errno_location ;int * __errno_location(void) AND EBX,0xfffffffc MOV RDI,R12 XOR R12D,R12D ADD EBX,0x9 MOV dword ptr [RAX],EBX CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) JMP LAB_00102e72 LAB_00102f33: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr [RAX + RAX*0x1]
zzip__new__ char * zzip_entry_strdup_name(ZZIP_ENTRY * entry) { if (! entry) { errno = EINVAL; return 0; } ___ zzip_size_t len; if ((len = zzip_disk_entry_namlen(disk_(entry)))) { char *name = malloc(len + 1); if (! name) { return 0; /* ENOMEM */ } memcpy(name, entry->tail, len); name[len] = '\0'; return name; } ___ auto struct zzip_file_header header; if (zzip_entry_fread_file_header(entry, &header) && (len = zzip_file_header_namlen(&header))) { char *name = malloc(len + 1); if (! name) { return 0; /* ENOMEM */ } ___ zzip_size_t n = fread(name, 1, len, entry->diskfile); if (n < len) { errno = ferror(entry->diskfile)? EBADF : EIO; free (name); return 0; } name[n] = '\0'; return name; ____; } errno = EBADMSG; return 0; ____; ____; }
static int file_header_entry_header_header(const char *file_name) { FILE *f; FILE *f; FILE *f; int ret; f = fopen(file_name, "rb"); if (!f) return 0; f = malloc(sizeof(FILE)); if (!f) return 0; f->file_name = malloc(sizeof(FILE)); if (!f->file_name) return 0; f->file_name = malloc(sizeof(FILE)); if (!f->file_name) return 0; f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); if (!f->file_name) return 0; f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); f->file_name = malloc(sizeof(FILE)); if (!f->file_name) return 0; return ret; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() ;local_30 undefined8 -30 PUSH R13 PUSH R12 PUSH RBP PUSH RBX SUB RSP,0x28 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_30+0x48],RAX XOR EAX,EAX CMP EDI,0x1 JLE LAB_00102283 MOV RBP,qword ptr [RSI + 0x8] MOV R13D,EDI MOV RBX,RSI LEA RSI,[.rodata:s_--help_00105004] ;= "--help" MOV RDI,RBP CALL .plt.got:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JZ LAB_00102283 LEA RSI,[.rodata:s_--version_0010500b] ;= "--version" MOV RDI,RBP CALL .plt.got:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JZ LAB_00102291 LEA EAX,[R13 + -0x2] LEA R12,[RBX + 0x8] LEA R13,[RBX + RAX*0x8 + 0x10] MOV RBX,RSP NOP dword ptr [RAX + RAX*0x1] LAB_00102200: MOV RDI,qword ptr [R12] XOR ESI,ESI CALL zzip_open ;undefined zzip_open() MOV RBP,RAX TEST RAX,RAX JNZ LAB_00102233 JMP LAB_00102278 ?? 0Fh ?? 1Fh ?? 00h LAB_00102218: MOV RCX,qword ptr [.bss:stdout] MOVSXD RDX,EAX MOV ESI,0x1 MOV RDI,RBX MOV byte ptr [RSP + RDX*0x1],0x0 CALL .plt:<EXTERNAL>::fwrite ;size_t fwrite(void * __ptr, size_t _... LAB_00102233: MOV EDX,0x10 MOV RSI,RBX MOV RDI,RBP CALL zzip_read ;undefined zzip_read() TEST EAX,EAX JG LAB_00102218 CMP EAX,-0x1 JZ LAB_00102278 LAB_0010224c: ADD R12,0x8 CMP R12,R13 JNZ LAB_00102200 LAB_00102255: MOV RAX,qword ptr [RSP + local_30+0x48] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010229f ADD RSP,0x28 XOR EAX,EAX POP RBX POP RBP POP R12 POP R13 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00102278: MOV RDI,qword ptr [R12] CALL .plt:<EXTERNAL>::perror ;void perror(char * __s) JMP LAB_0010224c LAB_00102283: LEA RDI,[.rodata:s__zzcat_<file>..._-_prints_the_fi_00105018] ;= " zzcat <file>... \n - prints the... CALL .plt:<EXTERNAL>::puts ;int puts(char * __s) JMP LAB_00102255 LAB_00102291: LEA RDI,[.rodata:s_./bins/zzcat.c_version_zziplib_0_00105100] ;= "./bins/zzcat.c version zziplib 0.... CALL .plt:<EXTERNAL>::puts ;int puts(char * __s) JMP LAB_00102255 LAB_0010229f: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP word ptr CS:[RAX + RAX*0x1]
int main (int argc, char ** argv) { int argn; if (argc <= 1 ||! strcmp (argv[1], "--help")) { printf (usage); return 0; } if (! strcmp (argv[1], "--version")) { printf (__FILE__ " version " ZZIP_PACKAGE_NAME " " ZZIP_PACKAGE_VERSION "\n"); return 0; } for (argn=1; argn < argc; argn++) { ZZIP_FILE* fp = zzip_open (argv[argn], O_RDONLY|O_BINARY); if (! fp) { perror (argv[argn]); continue; }else{ char buf[17]; int n; /* read chunks of 16 bytes into buf and print them to stdout */ while (0 < (n = zzip_read(fp, buf, 16))) { buf[n] = '\0'; # ifdef STDOUT_FILENO write (STDOUT_FILENO, buf, n); # else fwrite (buf, 1, n, stdout); # endif } if (n == -1) perror (argv[argn]); } } return 0; }
int main(int argc, char **argv) { int i; char *s; if (argc!= 2) { printf("Usage: %s\n", argv[0]); return 1; } for (i = 0; i < argc; i++) { s = argv[i]; if (!s) { printf("Usage: %s\n", argv[i]); return 1; } } if (!s) { printf("Usage: %s\n", argv[i]); return 1; } if (!s) { printf("Usage: %s\n", argv[i]); return 0; } if (!s) { printf("Usage: %s\n", argv[i]); return 1; } printf("Usage: %s\n", argv[i]); return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined unzzip_cat_file() ;local_20 undefined8 -20 PUSH R12 MOV R12,RDX XOR EDX,EDX PUSH RBP PUSH RBX SUB RSP,0x410 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x428],RAX XOR EAX,EAX MOV RBX,RSP CALL zzip_file_open ;undefined zzip_file_open() MOV RBP,RAX TEST RAX,RAX JNZ LAB_0010273b JMP LAB_00102757 ?? 0Fh ?? 1Fh ?? 00h LAB_00102728: MOVSXD RDX,EAX MOV RCX,R12 MOV ESI,0x1 MOV RDI,RBX CALL .plt:<EXTERNAL>::fwrite ;size_t fwrite(void * __ptr, size_t _... LAB_0010273b: MOV EDX,0x400 MOV RSI,RBX MOV RDI,RBP CALL zzip_file_read ;undefined zzip_file_read() TEST EAX,EAX JG LAB_00102728 MOV RDI,RBP CALL zzip_file_close ;undefined zzip_file_close() LAB_00102757: MOV RAX,qword ptr [RSP + local_20+0x428] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00102776 ADD RSP,0x410 POP RBX POP RBP POP R12 RET LAB_00102776: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr [RAX + RAX*0x1]
static void unzzip_cat_file(ZZIP_DIR* disk, char* name, FILE* out) { ZZIP_FILE* file = zzip_file_open (disk, name, 0); if (file) { char buffer[1024]; int len; while (0 < (len = zzip_file_read (file, buffer, 1024))) { fwrite (buffer, 1, len, out); } zzip_file_close (file); } }
static int file_read_file(FILE *fp, const char *filename) { FILE *fp; FILE *fp; FILE *fp; fp = fopen(filename, "rb"); if (!fp) return 0; file_read_file(fp, fp, fp); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined xor_read() PUSH RBX MOV RBX,RSI CALL .plt:read ;ssize_t read(int __fd, void * __buf,... TEST RAX,RAX JLE LAB_0010248b MOVZX ECX,byte ptr [.bss:xor_value] ;=?? MOV RSI,RBX LEA RDX,[RBX + RAX*0x1] NOP dword ptr [RAX] LAB_00102480: XOR byte ptr [RSI],CL ADD RSI,0x1 CMP RSI,RDX JNZ LAB_00102480 LAB_0010248b: POP RBX RET ?? 0Fh
static zzip_ssize_t xor_read (int f, void* p, zzip_size_t l) { zzip_ssize_t r = read(f, p, l); zzip_ssize_t x; char* q; for (x=0, q=p; x < r; x++) q[x] ^= xor_value; return r; }
static void read_int(char *buf, size_t len) { size_t i; for (i = 0; i < len; i++) read(buf, buf + i); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __zzip_set64() MOV qword ptr [RDI],RSI RET ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _fini() SUB RSP,0x8
void __zzip_set64(unsigned char *s, uint64_t v) { /* *INDENT-OFF* */ s[0] = (unsigned char) (v); v >>= 8; s[1] = (unsigned char) (v); v >>= 8; s[2] = (unsigned char) (v); v >>= 8; s[3] = (unsigned char) (v); v >>= 8; s[4] = (unsigned char) (v); v >>= 8; s[5] = (unsigned char) (v); v >>= 8; s[6] = (unsigned char) (v); v >>= 8; s[7] = (unsigned char) (v); /* *INDENT-ON* */ }
void __set64(const char *s, size_t len) { memset(s, 0, len); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __zzip_set16() MOV word ptr [RDI],SI RET ?? 66h f
void __zzip_set16(unsigned char *s, uint16_t v) { #if defined __ZZIP_SET16 return __ZZIP_SET16(s, v); #else /* *INDENT-OFF* */ s[0] = (unsigned char) (v); v >>= 8; s[1] = (unsigned char) (v); /* *INDENT-ON* */ #endif }
void __set16(unsigned char *dst, unsigned char *dst) { *dst = (unsigned char *) dst; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __zzip_set32() MOV dword ptr [RDI],ESI RET ?? 66h f
void __zzip_set32(unsigned char *s, uint32_t v) { #if defined __ZZIP_SET32 return __ZZIP_SET32(s, v); #else /* *INDENT-OFF* */ s[0] = (unsigned char) (v); v >>= 8; s[1] = (unsigned char) (v); v >>= 8; s[2] = (unsigned char) (v); v >>= 8; s[3] = (unsigned char) (v); /* *INDENT-ON* */ #endif }
void __set32(unsigned char *p, unsigned int len) { p[0] = (unsigned char) len; p[1] = (unsigned char) len; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __zzip_get64() MOV RAX,qword ptr [RDI] RET ?? 66h f
uint64_t __zzip_get64(unsigned char *s) { #ifdef __GNUC__ /* *INDENT-OFF* */ register uint64_t v = s[7]; v <<= 8; v |= s[6]; v <<= 8; v |= s[5]; v <<= 8; v |= s[4]; v <<= 8; v |= s[3]; v <<= 8; v |= s[2]; v <<= 8; v |= s[1]; v <<= 8; v |= s[0]; return v; /* *INDENT-ON* */ #else return ((uint64_t) s[7] << 56) | ((uint64_t) s[6] << 48) | ((uint64_t) s[5] << 40) | ((uint64_t) s[4] << 32) | ((uint64_t) s[3] << 24) | ((uint64_t) s[2] << 16) | ((uint64_t) s[1] << 8) | ((uint64_t) s[0]); #endif }
static uint64_t __get_ip(const void *p) { uint64_t *ip = (uint64_t *)p; uint64_t *ip = (uint64_t *)p; return ip[0]; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __zzip_get16() MOVZX EAX,word ptr [RDI] RET ?? 66h f
uint16_t __zzip_get16(unsigned char *s) { #if defined __ZZIP_GET16 return __ZZIP_GET16(s); #else return ((uint16_t) s[1] << 8) | ((uint16_t) s[0]); #endif }
uint16_t __get16(const struct sockaddr *in) { return in[0]; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined __zzip_get32() MOV EAX,dword ptr [RDI] RET ?? 66h f
uint32_t __zzip_get32(unsigned char *s) { #if defined __ZZIP_GET32 return __ZZIP_GET32(s); #else return ((uint32_t) s[3] << 24) | ((uint32_t) s[2] << 16) | ((uint32_t) s[1] << 8) | ((uint32_t) s[0]); #endif }
unsigned int __get32(const unsigned char *buf) { return buf[0]; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_fstat() ;local_10 undefined8 -10 ;local_78 undefined8 -78 PUSH RBP MOV RBP,RSI SUB RSP,0xa0 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_10+0xa8],RAX XOR EAX,EAX CMP qword ptr [RDI],0x0 JZ LAB_00104108 MOV RAX,qword ptr [RSP + local_10+0xa8] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00104150 ADD RSP,0xa0 POP RBP JMP .plt:LAB_00102120 ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00104108: MOV EDI,dword ptr [RDI + 0x8] MOV RSI,RSP CALL .plt:<EXTERNAL>::fstat ;int fstat(int __fd, stat * __buf) MOV R8D,EAX MOV EAX,0xffffffff TEST R8D,R8D JS LAB_00104134 MOV RAX,qword ptr [RSP + local_78+0xa8] MOV dword ptr [RBP],0x0 MOV dword ptr [RBP + 0x8],EAX MOV dword ptr [RBP + 0x4],EAX XOR EAX,EAX LAB_00104134: MOV RDX,qword ptr [RSP + local_10+0xa8] SUB RDX,qword ptr FS:[0x28] JNZ LAB_00104150 ADD RSP,0xa0 POP RBP RET LAB_00104150: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP word ptr CS:[RAX + RAX*0x1]
int zzip_fstat(ZZIP_FILE * file, ZZIP_STAT * zs) { if (ZZIP_file_real(file)) { struct stat st; if (fstat(file->fd, &st) < 0) return -1; zs->st_size = st.st_size; zs->d_csize = st.st_size; zs->d_compr = 0; return 0; } else { return zzip_file_stat(file, zs); } }
static int zbuf_z(struct zbuf *zbuf) { struct zbuf_zbuf *zbuf = zbuf->zbuf; if (zbuf->fd < 0) { return -1; } if (zbuf->fd < 0) { zbuf->fd = -1; return 0; } return zbuf->fd; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_file_stat() TEST RDI,RDI JZ LAB_001040b9 MOVD XMM0,dword ptr [RDI + 0xc] MOVD XMM1,dword ptr [RDI + 0x28] MOV RAX,qword ptr [RDI + 0x20] MOV qword ptr [RSI + 0x10],0x0 PUNPCKLDQ XMM0,XMM1 MOV dword ptr [RSI + 0x8],EAX XOR EAX,EAX MOVQ qword ptr [RSI],XMM0 RET LAB_001040b9: MOV EAX,0xffffffff RET ?? 90h
int zzip_file_stat(ZZIP_FILE * file, ZZIP_STAT * zs) { if (! file) return -1; zs->d_compr = file->method; zs->d_csize = file->csize; zs->st_size = file->usize; zs->d_name = 0; return 0; }
int zfile_stat_file_stat(zfile_stat_file_t *file, zfile_stat_t *stat) { if (!file) return -1; file->file = file; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_dir_stat() PUSH R15 MOV R15,RDI PUSH R14 MOV R14,RDX PUSH R13 PUSH R12 MOV R12,RSI PUSH RBP PUSH RBX SUB RSP,0x8 MOV RBX,qword ptr [RDI + 0x28] TEST CH,0x4 JZ LAB_00104050 MOV R13,qword ptr [-><EXTERNAL>::strcasecmp] ;= 00109008 OR CH,0x10 LAB_00103f8e: TEST RBX,RBX JZ LAB_00104068 AND CH,0x2 JZ LAB_0010403c MOV RDI,R12 MOV ESI,0x2f CALL .plt:<EXTERNAL>::strrchr ;char * strrchr(char * __s, int __c) LEA RDX,[RAX + 0x1] TEST RAX,RAX CMOVNZ R12,RDX JMP LAB_00103fd0 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00103fc0: MOVZX EAX,word ptr [RBX + 0x10] TEST AX,AX JZ LAB_00104068 ADD RBX,RAX LAB_00103fd0: LEA RBP,[RBX + 0x15] MOV ESI,0x2f MOV RDI,RBP CALL .plt:<EXTERNAL>::strrchr ;char * strrchr(char * __s, int __c) MOV RSI,R12 TEST RAX,RAX LEA RDI,[RAX + 0x1] CMOVZ RDI,RBP CALL R13=>EXTERNAL:<EXTERNAL>::strcasecmp ;int strcasecmp(char * __s1, char * _... TEST EAX,EAX JNZ LAB_00103fc0 LAB_00103ff6: MOVZX EAX,byte ptr [RBX + 0x14] MOVD XMM1,dword ptr [RBX + 0x4] MOVD XMM0,EAX PUNPCKLDQ XMM0,XMM1 MOVQ qword ptr [R14],XMM0 MOV EAX,dword ptr [RBX] MOV qword ptr [R14 + 0x10],RBP MOV dword ptr [R14 + 0x8],EAX ADD RSP,0x8 XOR EAX,EAX POP RBX POP RBP POP R12 POP R13 POP R14 POP R15 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104030: MOVZX EAX,word ptr [RBX + 0x10] TEST AX,AX JZ LAB_00104068 ADD RBX,RAX LAB_0010403c: LEA RBP,[RBX + 0x15] MOV RSI,R12 MOV RDI,RBP CALL R13=>EXTERNAL:<EXTERNAL>::strcasecmp ;int strcasecmp(char * __s1, char * _... TEST EAX,EAX JNZ LAB_00104030 JMP LAB_00103ff6 ?? 90h LAB_00104050: TEST CH,0x10 JNZ LAB_00104084 MOV R13,qword ptr [-><EXTERNAL>::strcmp] ;= 001090a0 JMP LAB_00103f8e ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00104068: MOV dword ptr [R15 + 0x4],0xffffefe4 ADD RSP,0x8 MOV EAX,0xffffffff POP RBX POP RBP POP R12 POP R13 POP R14 POP R15 RET LAB_00104084: MOV R13,qword ptr [-><EXTERNAL>::strcasecmp] ;= 00109008 JMP LAB_00103f8e ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzip_file_stat() TEST RDI,RDI
int zzip_dir_stat(ZZIP_DIR * dir, zzip_char_t * name, ZZIP_STAT * zs, int flags) { struct zzip_dir_hdr *hdr = dir->hdr0; int (*cmp) (zzip_char_t *, zzip_char_t *); if (flags & ZZIP_CASEINSENSITIVE) flags |= ZZIP_CASELESS; cmp = (flags & ZZIP_CASELESS)? strcasecmp : strcmp; if (! hdr) { dir->errcode = ZZIP_ENOENT; return -1; } if (flags & ZZIP_IGNOREPATH) { char *n = strrchr(name, '/'); if (n) name = n + 1; } while (1) { register char *hdr_name = hdr->d_name; if (flags & ZZIP_IGNOREPATH) { register char *n = strrchr(hdr_name, '/'); if (n) hdr_name = n + 1; } if (! cmp(hdr_name, name)) break; if (! hdr->d_reclen) { dir->errcode = ZZIP_ENOENT; return -1; } hdr = (struct zzip_dir_hdr *) ((char *) hdr + hdr->d_reclen); } zs->d_compr = hdr->d_compr; zs->d_csize = hdr->d_csize; zs->st_size = hdr->d_usize; zs->d_name = hdr->d_name; return 0; }
static int file_stat(const char *path, const char *path, struct stat *stat) { struct stat buf; struct stat buf; if (!path ||!path) return 0; buf = stat(path, &buf); if (!buf) return 0; if (stat(path, &buf)!= 0) return 0; if (stat(buf, &buf)!= 0) return 0; if (stat(buf, &buf)!= 0) return 0; if (stat(buf, &buf)!= 0) return 0; buf->len = buf->len; buf->len = buf->len; buf->len = buf->len; buf->len = buf->len; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() XOR EAX,EAX RET ?? 66h f
int main(void) { #if HAVE_WINDOWS_H /* Only for debugging purposes */ AllocConsole(); fprintf(stderr, "About to call LoadLibraryA()\n"); LoadLibraryA("whatever"); fprintf(stderr, "Finished calling LoadLibraryA()\n"); getchar(); #endif return EXIT_SUCCESS; }
int main(int argc, char **argv) { return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() PUSH RBX LEA RBX,[.bss:buf] JMP LAB_0010106b ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00101060: MOV EDX,EAX SHL EDX,0x14 MOVSXD RDX,EDX MOV byte ptr [RBX + RDX*0x1]=>.bss:buf,AL LAB_0010106b: MOV RDI,qword ptr [.bss:stdin] CALL .plt:<EXTERNAL>::getc ;int getc(FILE * __stream) CMP EAX,-0x1 JNZ LAB_00101060 XOR EAX,EAX POP RBX RET ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _start() ;local_10 undefined8 -10 XOR EBP,EBP
int main(void) { int ch; while ((ch = getc(stdin))!= EOF) buf[ch * 1024 * 1024] = ch; return EXIT_SUCCESS; }
int main (int argc, char **argv) { FILE *fp; fp = fopen (argv, "r"); if (fp == NULL) return -1; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() PUSH RBX NOP dword ptr [RAX] LAB_00101068: MOV RDI,qword ptr [.bss:stdin] CALL .plt:<EXTERNAL>::getc ;int getc(FILE * __stream) MOV EBX,EAX CMP EAX,-0x1 JZ LAB_001010aa MOV EDI,EBX SHL EBX,0xa SHL EDI,0x14 ADD EDI,0x1 MOVSXD RDI,EDI CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOVSXD RCX,EBX XOR EDX,EDX NOP dword ptr [RAX + RAX*0x1] LAB_00101098: MOV byte ptr [RAX],DL ADD EDX,0x1 ADD RAX,RCX CMP EDX,0x400 JNZ LAB_00101098 JMP LAB_00101068 LAB_001010aa: XOR EAX,EAX POP RBX RET ?? 66h f
int main(void) { int ch; while ((ch = getc(stdin))!= EOF) { /* Mark as volatile to prevent the compiler from removing tmp */ volatile char *tmp = malloc(1 + ch * 1024 * 1024); for (int i = 0; i < 1024; i++) tmp[ch * 1024 * i] = i; } return EXIT_SUCCESS; }
int main(int argc, char **argv) { int i; for (i = 0; i < argc; i++) { argv[i] = '\0'; } for (i = 0; i < argc; i++) { argv[i] = argv[i]; } return i; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() PUSH RBX XOR ESI,ESI LEA RDI,[.rodata:s_/etc/hosts_00102004] ;= "/etc/hosts" XOR EAX,EAX CALL .plt:<EXTERNAL>::open ;int open(char * __file, int __oflag,... MOV EDI,0x1e MOV EBX,EAX CALL .plt:<EXTERNAL>::sysconf ;long sysconf(int __name) MOV R8D,EBX XOR R9D,R9D MOV ECX,0x8002 LEA RSI,[RAX + RAX*0x1] MOV EDX,0x1 XOR EDI,EDI CALL .plt:<EXTERNAL>::mmap ;void * mmap(void * __addr, size_t __... XOR EAX,EAX POP RBX RET ?? 0Fh
int main(void) { #if defined _SC_PAGE_SIZE && defined MAP_POPULATE int fd = open("/etc/hosts", O_RDONLY); mmap(0, sysconf(_SC_PAGE_SIZE) * 2, PROT_READ, MAP_PRIVATE | MAP_POPULATE, fd, 0); #endif return EXIT_SUCCESS; }
int main(int argc, char **argv) { int fd = open(NULL, O_RDONLY); int fd = open(fd, O_RDONLY | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK |NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK | O_NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOCK |NONBLOC
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() PUSH R12 XOR R12D,R12D PUSH RBX LEA RBX,[.rodata:lut.0] SUB RSP,0x8 JMP LAB_0010108c ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00101078: MOV EDX,EAX SHR AL,0x4 AND EDX,0xf AND EAX,0xf MOV EAX,dword ptr [RBX + RAX*0x4]=>.rodata:lut.0 ADD EAX,dword ptr [RBX + RDX*0x4]=>.rodata:lut.0 ADD R12D,EAX LAB_0010108c: MOV RDI,qword ptr [.bss:stdin] CALL .plt:<EXTERNAL>::getc ;int getc(FILE * __stream) CMP EAX,-0x1 JNZ LAB_00101078 MOV EDX,R12D LEA RSI,[.rodata:DAT_00102004] ;= 25h % MOV EDI,0x1 XOR EAX,EAX CALL .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() ADD RSP,0x8 XOR EAX,EAX POP RBX POP R12 RET ?? 0Fh
int main(void) { int total = 0, ch; while ((ch = getc(stdin))!= EOF) total += countones((uint8_t)ch); printf("%i\n", total); return EXIT_SUCCESS; }
int main(int argc, char **argv) { int i; for (i = 0; i < argc; i++) { printf("%s", argv[i]); } return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined main() SUB RSP,0x8 JMP LAB_0010107e ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00101070: MOV dword ptr [.bss:buf],0x1 TEST EAX,EAX JNZ LAB_001010a0 LAB_0010107e: MOV RDI,qword ptr [.bss:stdin] CALL .plt:<EXTERNAL>::getc ;int getc(FILE * __stream) CMP EAX,-0x1 JNZ LAB_00101070 XOR EAX,EAX ADD RSP,0x8 RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001010a0: MOV EDI,0x8 CALL .plt:<EXTERNAL>::raise ;int raise(int __sig) JMP LAB_0010107e ?? 0Fh
int main(void) { int ch; while ((ch = getc(stdin))!= EOF) { buf[0] = 1 /!ch; if (ch) raise(SIGFPE); /* Needed on OS X... sigh. */ } return EXIT_SUCCESS; }
int main(void) { int ret; ret = close(0); if (ret == -1) return ret; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined merge_regex() ;local_20 undefined8 -20 PUSH R12 MOV R12,RDI MOV RDI,RSI PUSH RBP PUSH RBX MOV RBX,RSI SUB RSP,0x50 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x68],RAX XOR EAX,EAX CALL .plt:<EXTERNAL>::strlen ;size_t strlen(char * __s) MOV RBP,RAX TEST R12,R12 JZ LAB_00103ec0 MOV RDI,R12 CALL .plt:<EXTERNAL>::strlen ;size_t strlen(char * __s) MOV RDI,R12 LEA RSI,[RBP + RAX*0x1 + 0x2] CALL .plt:<EXTERNAL>::realloc ;void * realloc(void * __ptr, size_t... MOV RDI,RAX MOV R12,RAX CALL .plt:<EXTERNAL>::strlen ;size_t strlen(char * __s) MOV R8,RBX MOV ESI,0x1 LEA RCX,[.rodata:DAT_00108079] ;= 7Ch | LEA RDI,[R12 + RAX*0x1 + -0x1] MOV RDX,-0x1 XOR EAX,EAX CALL .plt:<EXTERNAL>::__sprintf_chk ;undefined __sprintf_chk() LAB_00103e84: MOV RBP,RSP MOV EDX,0x1 MOV RSI,R12 MOV RDI,RBP CALL .plt:<EXTERNAL>::regcomp ;int regcomp(regex_t * __preg, char *... TEST EAX,EAX JNZ LAB_00103ef0 MOV RDI,RBP CALL .plt:<EXTERNAL>::regfree ;void regfree(regex_t * __preg) LAB_00103ea3: MOV RAX,qword ptr [RSP + local_20+0x68] SUB RAX,qword ptr FS:[0x28] JNZ LAB_00103efd ADD RSP,0x50 MOV RAX,R12 POP RBX POP RBP POP R12 RET ?? 90h LAB_00103ec0: LEA RDI,[RAX + 0x3] CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV R8,RBX MOV ESI,0x1 LEA RCX,[.rodata:DAT_0010807e] ;= 28h ( MOV R12,RAX MOV RDI,RAX MOV RDX,-0x1 XOR EAX,EAX CALL .plt:<EXTERNAL>::__sprintf_chk ;undefined __sprintf_chk() JMP LAB_00103e84 ?? 66h f ?? 90h LAB_00103ef0: MOV RDI,R12 XOR R12D,R12D CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) JMP LAB_00103ea3 LAB_00103efd: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
static char *merge_regex(char *regex, char *string) { if (regex) { regex = realloc(regex, strlen(regex) + strlen(string) + 1 + 1); sprintf(regex + strlen(regex) - 1, "|%s)", string); } else { regex = malloc(1 + strlen(string) + 1 + 1); sprintf(regex, "(%s)", string); } regex_t optre; if (regcomp(&optre, regex, REG_EXTENDED)!= 0) { free(regex); return NULL; } regfree(&optre); return regex; }
char * regex_realloc(const char *s, const char *s) { char *ptr; size_t len; if (!s) return NULL; ptr = realloc(s, strlen(s) + 1); if (ptr == NULL) return NULL; len = strlen(s) + 1; ptr[len] = '\0'; ptr[len] = '\0'; free(ptr); return ptr; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined merge_file() PUSH R15 PUSH R14 PUSH R13 MOV R13,RDI MOV RDI,RSI PUSH R12 PUSH RBP MOV RBP,RSI PUSH RBX SUB RSP,0x8 CALL .plt:<EXTERNAL>::strlen ;size_t strlen(char * __s) LEA RDI,[RAX + RAX*0x1 + 0x7] CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOVZX EBX,byte ptr [RBP] MOV dword ptr [RAX],0x2f7c5e28 MOV R14,RAX LEA R15,[RAX + 0x5] MOV byte ptr [RAX + 0x4],0x29 TEST BL,BL JZ LAB_00103f90 LEA R12,[.rodata:s_^.[$()|*+?{\_00108083] ;= "^.[$()|*+?{\\" NOP word ptr CS:[RAX + RAX*0x1] LAB_00103f60: MOVSX ESI,BL MOV RDI=>.rodata:s_^.[$()|*+?{\_00108083,R12 ;= "^.[$()|*+?{\\" CALL .plt:<EXTERNAL>::strchr ;char * strchr(char * __s, int __c) MOV R8,RAX MOV RAX,R15 TEST R8,R8 JZ LAB_00103f7e MOV byte ptr [R15],0x5c ADD RAX,0x1 LAB_00103f7e: ADD RBP,0x1 MOV byte ptr [RAX],BL LEA R15,[RAX + 0x1] MOVZX EBX,byte ptr [RBP] TEST BL,BL JNZ LAB_00103f60 LAB_00103f90: MOV EAX,0x24 MOV RSI,R14 MOV RDI,R13 MOV word ptr [R15],AX CALL merge_regex ;undefined merge_regex() MOV RDI,R14 MOV R12,RAX CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) ADD RSP,0x8 MOV RAX,R12 POP RBX POP RBP POP R12 POP R13 POP R14 POP R15 RET ?? 66h f
static char *merge_file(char *regex, char *file) { char *newfile = malloc(5 + 2 * strlen(file) + 1 + 1); char *tmp = newfile; *tmp++ = '('; *tmp++ = '^'; *tmp++ = '|'; *tmp++ = '/'; *tmp++ = ')'; while (*file) { if (strchr("^.[$()|*+?{\\", *file)) *tmp++ = '\\'; *tmp++ = *file++; } *tmp++ = '$'; *tmp++ = '\0'; tmp = merge_regex(regex, newfile); free(newfile); return tmp; }
static char * file_regex(const char *s, const char *s) { char *p; size_t len = strlen(s); size_t len = strlen(s) + 1; char *p = s + len; p[len] = '\0'; p[len] = '\0'; p[len] = '\0'; return p; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_destroy_opts() PUSH RBP MOV RBP,RDI PUSH RBX SUB RSP,0x8 MOV R8,qword ptr [RDI + 0xc0] TEST R8,R8 JZ LAB_00104c76 MOV EAX,dword ptr [RDI + 0xb0] TEST EAX,EAX JLE LAB_00104c6e XOR EBX,EBX NOP dword ptr [RAX] LAB_00104c48: LEA RAX,[RBX + RBX*0x8] MOV RDI,qword ptr [R8 + RAX*0x8 + 0x40] TEST RDI,RDI JZ LAB_00104c62 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV R8,qword ptr [RBP + 0xc0] LAB_00104c62: ADD RBX,0x1 CMP dword ptr [RBP + 0xb0],EBX JG LAB_00104c48 LAB_00104c6e: MOV RDI,R8 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00104c76: ADD RSP,0x8 MOV RDI,RBP POP RBX POP RBP JMP .plt:<EXTERNAL>::free ;void free(void * __ptr) ?? 66h f
void zzuf_destroy_opts(zzuf_opts_t *opts) { if (opts->child) { for (int i = 0; i < opts->maxchild; ++i) if (opts->child[i].newargv) free(opts->child[i].newargv); free(opts->child); } free(opts); }
void z_destroy(z_t *z) { int i; if (z == NULL) return; for (i = 0; i < z->num_entries; i++) z_destroy(z->entries[i]); free(z->entries); free(z); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_create_opts() PUSH R12 MOV EDI,0xc8 CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOVSD XMM0,qword ptr [.rodata:DAT_00109590] ;= 3F70624DD2F1A9FCh MOV dword ptr [RAX],0x0 MOV R12,RAX MOV qword ptr [RAX + 0x18],0x0 MOV qword ptr [RAX + 0x20],0x0 MOV qword ptr [RAX + 0x28],0x0 MOV qword ptr [RAX + 0x30],0x0 MOV qword ptr [RAX + 0x38],0x0 MOV qword ptr [RAX + 0x40],0x0 MOV qword ptr [RAX + 0x48],0x0 MOV RAX,0x100000000 MOV qword ptr [R12 + 0x50],RAX MOV RAX,-0x100000000 MOV qword ptr [R12 + 0x68],0x0 MOV qword ptr [R12 + 0x70],0x0 MOV qword ptr [R12 + 0x78],RAX MOV dword ptr [R12 + 0x84],0x400 MOVSD qword ptr [R12 + 0x58],XMM0 MOVSD qword ptr [R12 + 0x60],XMM0 CALL zzuf_time ;undefined zzuf_time() MOV dword ptr [R12 + 0x80],0xffffffff MOV qword ptr [R12 + 0x88],RAX MOV RAX,R12 MOV qword ptr [R12 + 0x90],0x0 MOV qword ptr [R12 + 0x98],-0x1 MOV qword ptr [R12 + 0xa0],0x0 MOV qword ptr [R12 + 0xa8],0x0 MOV qword ptr [R12 + 0xb0],0x1 MOV qword ptr [R12 + 0xb8],0x1 MOV qword ptr [R12 + 0xc0],0x0 POP R12 RET ?? 66h f
zzuf_opts_t *zzuf_create_opts(void) { zzuf_opts_t *opts = malloc(sizeof(zzuf_opts_t)); opts->opmode = OPMODE_PRELOAD; opts->fuzzing = opts->bytes = opts->list = opts->ports = NULL; opts->allow = NULL; opts->protect = opts->refuse = NULL; opts->seed = DEFAULT_SEED; opts->endseed = DEFAULT_SEED + 1; opts->minratio = opts->maxratio = DEFAULT_RATIO; opts->b_quiet = 0; opts->b_md5 = 0; opts->b_hex = 0; opts->b_checkexit = 0; opts->b_verbose = 0; opts->maxbytes = -1; opts->maxmem = DEFAULT_MEM; opts->starttime = zzuf_time(); opts->maxtime = 0; opts->maxusertime = -1; opts->maxcpu = -1; opts->delay = 0; opts->lastlaunch = 0; opts->maxchild = 1; opts->nchild = 0; opts->maxcrashes = 1; opts->crashes = 0; opts->child = NULL; return opts; }
struct zbar_zbar *zbar_zbar_create(void) { struct zbar_zbar *zbar; struct zbar_zbar *zbar; zbar = malloc(sizeof(struct zbar_zbar)); zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->zbar = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; zbar->z = NULL; return zbar; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_time() ;local_10 undefined8 -10 ;local_20 undefined8 -20 ;local_28 undefined8 -28 SUB RSP,0x28 XOR ESI,ESI MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_10+0x28],RAX XOR EAX,EAX MOV RDI,RSP CALL .plt:<EXTERNAL>::gettimeofday ;int gettimeofday(timeval * __tv, __t... IMUL RAX,qword ptr [RSP]=>local_28,0xf4240 ADD RAX,qword ptr [RSP + local_20+0x28] MOV RDX,qword ptr [RSP + local_10+0x28] SUB RDX,qword ptr FS:[0x28] JNZ LAB_00104cd0 ADD RSP,0x28 RET LAB_00104cd0: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP word ptr CS:[RAX + RAX*0x1]
int64_t zzuf_time(void) { #if defined HAVE_GETTIMEOFDAY struct timeval tv; gettimeofday(&tv, NULL); return (int64_t)tv.tv_sec * 1000000 + tv.tv_usec; #else static zzuf_mutex_t mutex = 0; static unsigned long int prev = 0; static uint64_t tv_base = 0; zzuf_mutex_lock(&mutex); unsigned long int tv_msec = GetTickCount(); if (tv_msec < prev) tv_base += 0x100000000LL; /* We wrapped */ prev = tv_msec; zzuf_mutex_unlock(&mutex); return (tv_base + tv_msec) * 1000; #endif }
time_t time_now (void) { struct timeval tv; gettimeofday (&tv, NULL); return tv.tv_sec; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_destroy_md5() PUSH R12 LEA R12,[RSI + 0x18] PUSH RBP MOV RBP,RSI PUSH RBX MOV EAX,dword ptr [RSI + 0x10] MOV RBX,RDI SHR EAX,0x3 AND EAX,0x3f MOV EDX,EAX ADD RDX,R12 MOV byte ptr [RDX],0x80 LEA RDI,[RDX + 0x1] MOV EDX,0x3f SUB EDX,EAX CMP EDX,0x7 JA LAB_00105df0 TEST EDX,EDX JZ LAB_00105dc2 XOR EAX,EAX LAB_00105db5: MOV ECX,EAX ADD EAX,0x1 MOV byte ptr [RDI + RCX*0x1],0x0 CMP EAX,EDX JC LAB_00105db5 LAB_00105dc2: PXOR XMM0,XMM0 MOV RSI,R12 MOV RDI,RBP CALL transform ;undefined transform() MOVUPS xmmword ptr [RBP + 0x18],XMM0 MOV qword ptr [R12 + 0x30],0x0 MOVUPS xmmword ptr [R12 + 0x10],XMM0 MOVUPS xmmword ptr [R12 + 0x20],XMM0 JMP LAB_00105dfe ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00105df0: MOV EDX,0x37 XOR ESI,ESI SUB EDX,EAX CALL .plt:<EXTERNAL>::memset ;void * memset(void * __s, int __c, s... LAB_00105dfe: MOV RAX,qword ptr [RBP + 0x10] MOV RDI,RBP MOV RSI,R12 MOV qword ptr [RBP + 0x50],RAX CALL transform ;undefined transform() MOVDQU XMM1,xmmword ptr [RBP] MOV RDI,RBP MOVUPS xmmword ptr [RBX],XMM1 POP RBX POP RBP POP R12 JMP .plt:<EXTERNAL>::free ;void free(void * __ptr) ?? 66h f
void zzuf_destroy_md5(uint8_t *digest, zzuf_md5sum_t *ctx) { unsigned count = (ctx->bits[0] >> 3) & 0x3F; uint8_t *p = (uint8_t *)ctx->in + count; *p++ = 0x80; count = 64 - 1 - count; if (count < 8) { memset(p, 0, count); swapwords(ctx->in, 64 / 4); transform(ctx->buf, ctx->in); memset(ctx->in, 0, 56); } else memset(p, 0, count - 8); swapwords(ctx->in, 56 / 4); memcpy(ctx->in + 56 / 4, ctx->bits, 8); transform(ctx->buf, ctx->in); swapwords(ctx->buf, 16 / 4); memcpy(digest, ctx->buf, 16); free(ctx); }
void md5_destroy(md5_context_t *ctx, const uint8_t *buf, size_t len) { memset(ctx, 0, len); memset(ctx, 0, len); memset(ctx, 0, len); memset(ctx, 0, len); memset(ctx, 0, len); memset(ctx, 0, len); memset(ctx, 0, len); memset(ctx, 0, len); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_create_md5() SUB RSP,0x8 MOV EDI,0x118 CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV RDX,-0x1032547698badcff MOV RCX,0x1032547698badcfe MOV qword ptr [RAX],RDX MOV qword ptr [RAX + 0x8],RCX MOV qword ptr [RAX + 0x10],0x0 ADD RSP,0x8 RET ?? 66h f
zzuf_md5sum_t *zzuf_create_md5(void) { zzuf_md5sum_t *ctx = malloc(sizeof(zzuf_md5sum_t)); ctx->buf[0] = 0x67452301; ctx->buf[1] = 0xefcdab89; ctx->buf[2] = 0x98badcfe; ctx->buf[3] = 0x10325476; ctx->bits[0] = 0; ctx->bits[1] = 0; return ctx; }
void *md5_create_md5(void) { md5_md5_t *md5; md5 = malloc(sizeof(md5_md5_t)); if (!md5) return NULL; md5->md5 = malloc(sizeof(md5_md5_t)); md5->md5 = malloc(sizeof(md5_md5_t)); md5->md5 = malloc(sizeof(md5_md5_t)); return (md5); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_destroy_hex() PUSH RBP MOV RDX,qword ptr [RDI + 0x20] MOV RBP,RDI MOV RSI,RDX AND ESI,0xf JNZ LAB_00106040 LAB_00106010: LEA RSI,[.rodata:s_%08x_0010966f] ;= "%08x\n" MOV EDI,0x1 XOR EAX,EAX CALL .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() MOV RDI,RBP CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) MOV RDI,qword ptr [.bss:stdout] POP RBP JMP .plt:<EXTERNAL>::fflush ;int fflush(FILE * __stream) ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00106040: CALL print_hex ;undefined print_hex() MOV RDX,qword ptr [RBP + 0x20] JMP LAB_00106010 ?? 0Fh
void zzuf_destroy_hex(zzuf_hexdump_t *ctx) { /* Print the last line, if non-empty */ if (ctx->count & 15) print_hex(ctx, (unsigned)(ctx->count & 15)); /* Print the last offset */ printf("%08x\n", (uint32_t)ctx->count); free(ctx); fflush(stdout); }
static void print_destroy (const char *name) { if (name) printf ("%s\n", name); else printf ("%s\n", name); free (name); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zz_hex_add() PUSH R15 MOV R15,RDI PUSH R14 MOV R14,RSI PUSH R13 PUSH R12 MOV R12D,EDX PUSH RBP PUSH RBX SUB RSP,0x8 MOV EBP,dword ptr [RDI + 0x20] AND EBP,0xf TEST EDX,EDX JNZ LAB_00105f9d JMP LAB_00105fe3 ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00105f98: TEST R12D,R12D JZ LAB_00105fe3 LAB_00105f9d: MOV EBX,0x10 MOV EDI,EBP MOV RSI,R14 SUB EBX,EBP CMP EBX,R12D CMOVA EBX,R12D ADD RDI,R15 MOV R13D,EBX ADD EBP,EBX SUB R12D,EBX MOV RDX,R13 ADD R14,R13 CALL .plt:<EXTERNAL>::memcpy ;void * memcpy(void * __dest, void *... ADD qword ptr [R15 + 0x20],R13 CMP EBP,0x10 JNZ LAB_00105f98 MOV ESI,0x10 MOV RDI,R15 XOR EBP,EBP CALL print_hex ;undefined print_hex() TEST R12D,R12D JNZ LAB_00105f9d LAB_00105fe3: MOV RDI,qword ptr [.bss:stdout] ADD RSP,0x8 POP RBX POP RBP POP R12 POP R13 POP R14 POP R15 JMP .plt:<EXTERNAL>::fflush ;int fflush(FILE * __stream) ?? 0Fh
void zz_hex_add(zzuf_hexdump_t *ctx, uint8_t *buf, unsigned len) { unsigned buffered_len = (unsigned)(ctx->count & 15); while (len > 0) { /* Copy as many bytes as possible into our data buffer */ unsigned to_copy = 16 - buffered_len; if (to_copy > len) to_copy = len; memcpy(ctx->current_line + buffered_len, buf, to_copy); buffered_len += to_copy; buf += to_copy; len -= to_copy; ctx->count += to_copy; /* If the buffer is full, print it */ if (buffered_len == 16) { print_hex(ctx, 16); buffered_len = 0; } } fflush(stdout); }
void print_stream(struct stream *s, unsigned char *buf, int len) { int i; for (i = 0; i < len; i++) { if (s->buf[i]!= '\0') print_buf(s, buf, len); else print_buf(s, buf, len); } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_create_hex() SUB RSP,0x8 MOV EDI,0x28 CALL .plt:<EXTERNAL>::malloc ;void * malloc(size_t __size) MOV qword ptr [RAX + 0x20],0x0 ADD RSP,0x8 RET ?? 0Fh
zzuf_hexdump_t *zzuf_create_hex(void) { zzuf_hexdump_t *ctx = malloc(sizeof(zzuf_hexdump_t)); ctx->count = 0; return ctx; }
z_z_t * z_z_z_create(void) { z_z_t *z = malloc(sizeof(z_z_t)); z->z = NULL; return z; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_rand() MOV RCX,qword ptr [.data:ctx] ;= 0000000000000001h MOV EDI,EDI MOV RDX,-0x5bd04ca444395227 MOV RAX,RCX MUL RDX SHR RDX,0xd IMUL RAX,RDX,0x31e5 IMUL RDX,RDX,-0xb14 SUB RCX,RAX IMUL RAX,RCX,0x41a7 ADD RAX,RDX TEST RAX,RAX LEA RDX,[RAX + 0x7fffffff] CMOVLE RAX,RDX XOR EDX,EDX MOV qword ptr [.data:ctx],RAX ;= 0000000000000001h DIV RDI MOV EAX,EDX RET ?? 66h f
uint32_t zzuf_rand(uint32_t max) { /* Could be better, but do we care? */ long hi = ctx / 12773L; long lo = ctx % 12773L; long x = 16807L * lo - 2836L * hi; if (x <= 0) x += 0x7fffffffL; return (ctx = x) % (unsigned long)max; }
void zrand_rand(void) { zrand_t zrand; zrand = zrand; zrand = zrand; zrand = zrand; zrand = zrand; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_srand() XOR EDI,0x12345678 MOV EAX,EDI MOV qword ptr [.data:ctx],RAX ;= 0000000000000001h RET ;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_rand() MOV RCX,qword ptr [.data:ctx] ;= 0000000000000001h
void zzuf_srand(uint32_t seed) { ctx = (seed ^ 0x12345678); }
static int zrand_rand(void) { zrand = zrand; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_isinrange() TEST RSI,RSI JZ LAB_001062a0 MOV RAX,qword ptr [RSI + 0x8] TEST RAX,RAX JZ LAB_001062a6 NOP LAB_00106280: MOV RDX,qword ptr [RSI] CMP RDX,RDI JG LAB_00106292 CMP RDX,RAX JZ LAB_001062a0 CMP RDI,RAX JL LAB_001062a0 LAB_00106292: MOV RAX,qword ptr [RSI + 0x18] ADD RSI,0x10 TEST RAX,RAX JNZ LAB_00106280 RET LAB_001062a0: MOV EAX,0x1 RET LAB_001062a6: XOR EAX,EAX RET ?? 0Fh
int _zz_isinrange(int64_t value, int64_t const *ranges) { int64_t const *r; if (!ranges) return 1; for (r = ranges; r[1]; r += 2) if (value >= r[0] && (r[0] == r[1] || value < r[1])) return 1; return 0; }
int _in_range(const struct in *in, const struct in *in) { int i; for (i = 0; in[i]; i++) if (in[i] == in[i]) return 1; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_getfuzz() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106d88: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106d88 XOR R8D,R8D TEST EDI,EDI JS LAB_00106dc8 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106dc8 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RAX,dword ptr [RAX + RDI*0x4] CMP EAX,-0x1 JZ LAB_00106dc8 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] LEA R8,[RAX + 0x20] LAB_00106dc8: MOV dword ptr [.bss:fds_mutex],0x0 MOV RAX,R8 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 0Fh
fuzz_context_t *_zz_getfuzz(int fd) { fuzz_context_t *ret = NULL; zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { ret = &files[fds[fd]].fuzz; } zzuf_mutex_unlock(&fds_mutex); return ret; }
int _get_lock(void) { int i; for (i = 0; i < _files_count; i++) { if (files[i] == NULL) { return 0; } } return -1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_getfuzzed() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106d08: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106d08 XOR R8D,R8D TEST EDI,EDI JS LAB_00106d66 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106d66 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RAX,dword ptr [RAX + RDI*0x4] CMP EAX,-0x1 JZ LAB_00106d66 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] MOV RDX,qword ptr [RAX + 0x10] MOV RCX,qword ptr [RAX + 0x18] CMP RDX,RCX JL LAB_00106d66 MOVSXD RSI,dword ptr [RAX + 0xc] MOV RAX,RSI ADD RSI,RCX ADD EAX,ECX SUB EAX,EDX CMP RDX,RSI CMOVL R8D,EAX LAB_00106d66: MOV dword ptr [.bss:fds_mutex],0x0 MOV EAX,R8D LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
int _zz_getfuzzed(int fd) { int ret = 0; zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { if (files[fds[fd]].pos >= files[fds[fd]].already_pos && files[fds[fd]].pos < files[fds[fd]].already_pos + files[fds[fd]].already_fuzzed) ret = (int)(files[fds[fd]].already_fuzzed + files[fds[fd]].already_pos - files[fds[fd]].pos); } zzuf_mutex_unlock(&fds_mutex); return ret; }
int _get_files(int argc, char **argv) { int i; for (i = 0; i < argc; i++) { if (argv[i] == argv[i]) { argv[i] = argv[i]; argv[i] = 0; } } return i; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_setfuzzed() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106c98: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106c98 TEST EDI,EDI JS LAB_00106ce2 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106ce2 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RAX,dword ptr [RAX + RDI*0x4] CMP EAX,-0x1 JZ LAB_00106ce2 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] MOV RDX,qword ptr [RAX + 0x10] CMP RDX,qword ptr [RAX + 0x18] JZ LAB_00106cf3 LAB_00106cdb: MOV qword ptr [RAX + 0x18],RDX MOV dword ptr [RAX + 0xc],ESI LAB_00106ce2: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET LAB_00106cf3: CMP dword ptr [RAX + 0xc],ESI JGE LAB_00106ce2 JMP LAB_00106cdb ?? 66h f
void _zz_setfuzzed(int fd, int count) { zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { /* FIXME: what if we just slightly advanced? */ if (files[fds[fd]].pos!= files[fds[fd]].already_pos || count > files[fds[fd]].already_fuzzed) { #if defined LIBZZUF debug2("setfuzzed(%i, %i)", fd, count); #endif files[fds[fd]].already_pos = files[fds[fd]].pos; files[fds[fd]].already_fuzzed = count; } } zzuf_mutex_unlock(&fds_mutex); }
void _set_files(int fd) { int i; if (fd >= 0) return; _mutex_lock(&mutex); _mutex_unlock(&mutex); _mutex_unlock(&mutex); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_addpos() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106c38: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106c38 TEST EDI,EDI JS LAB_00106c75 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106c75 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RAX,dword ptr [RAX + RDI*0x4] CMP EAX,-0x1 JZ LAB_00106c75 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] ADD qword ptr [RAX + 0x10],RSI LAB_00106c75: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
void _zz_addpos(int fd, int64_t off) { zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { files[fds[fd]].pos += off; } zzuf_mutex_unlock(&fds_mutex); }
void _add_files(int fd) { int i; if (fd >= 0) return; for (i = 0; i < fd; i++) { if (files[i] == fd) return; } files[i] = 0; files[i] = 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_setpos() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106bd8: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106bd8 TEST EDI,EDI JS LAB_00106c15 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106c15 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RAX,dword ptr [RAX + RDI*0x4] CMP EAX,-0x1 JZ LAB_00106c15 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] MOV qword ptr [RAX + 0x10],RSI LAB_00106c15: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
void _zz_setpos(int fd, int64_t pos) { zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { files[fds[fd]].pos = pos; } zzuf_mutex_unlock(&fds_mutex); }
void _set_mutex_lock(int fd) { int i; if (fd < 0) return; for (i = 0; i < fd; i++) { if (fd[i] == fd) break; fd[i] = -1; } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_getpos() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106b78: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106b78 XOR EAX,EAX TEST EDI,EDI JS LAB_00106bb7 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106bb7 MOV RDX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RDX,dword ptr [RDX + RDI*0x4] CMP EDX,-0x1 JZ LAB_00106bb7 IMUL RDX,RDX,0x450 ADD RDX,qword ptr [.bss:files] MOV RAX,qword ptr [RDX + 0x10] LAB_00106bb7: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 0Fh
int64_t _zz_getpos(int fd) { int64_t ret = 0; zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { ret = files[fds[fd]].pos; } zzuf_mutex_unlock(&fds_mutex); return ret; }
int _get_mutex_lock(void) { int i; for (i = 0; i < _mutex_count; i++) { if (_mutex[i] == 0) { return i; } } return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_isactive() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106b18: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106b18 MOV EAX,0x1 TEST EDI,EDI JS LAB_00106b59 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106b59 MOV RDX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RDX,dword ptr [RDX + RDI*0x4] CMP EDX,-0x1 JZ LAB_00106b59 IMUL RDX,RDX,0x450 ADD RDX,qword ptr [.bss:files] MOV EAX,dword ptr [RDX + 0x8] LAB_00106b59: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
int _zz_isactive(int fd) { int ret = 1; zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { ret = files[fds[fd]].active; } zzuf_mutex_unlock(&fds_mutex); return ret; }
void _is_active(void) { int i; for (i = 0; i < _active_active; i++) { if (active_active[i] == 0) { active_active[i] = 0; active_active[i] = 0; } } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_islocked() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106ab8: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106ab8 TEST EDI,EDI JS LAB_00106af4 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106af4 MOV RDX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RDX,dword ptr [RDX + RDI*0x4] CMP EDX,-0x1 JZ LAB_00106af4 IMUL RDX,RDX,0x450 ADD RDX,qword ptr [.bss:files] MOV EAX,dword ptr [RDX + 0x4] LAB_00106af4: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
int _zz_islocked(int fd) { int ret = 0; zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { if (fd == -1) ret = create_lock; else ret = files[fds[fd]].locked; } zzuf_mutex_unlock(&fds_mutex); return ret; }
void _is_files(void) { int i; for (i = 0; i < _is_files; i++) { if (_is_files[i]) { _is_files[i] = 0; _is_files[i] = 0; } } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_unlock() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106a58: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106a58 TEST EDI,EDI JS LAB_00106a95 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106a95 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RAX,dword ptr [RAX + RDI*0x4] CMP EAX,-0x1 JZ LAB_00106a95 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] SUB dword ptr [RAX + 0x4],0x1 LAB_00106a95: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
void _zz_unlock(int fd) { zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { if (fd == -1) --create_lock; else --files[fds[fd]].locked; } zzuf_mutex_unlock(&fds_mutex); }
void _lock_unlock(void) { int i; for (i = 0; i < pthread_mutex_lock(&lock_mutex); i++) { if (lock_mutex[i] == NULL) { lock_mutex[i] = 0; break; } } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_lockfd() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_001069f8: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_001069f8 TEST EDI,EDI JS LAB_00106a35 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106a35 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI MOVSXD RAX,dword ptr [RAX + RDI*0x4] CMP EAX,-0x1 JZ LAB_00106a35 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] ADD dword ptr [RAX + 0x4],0x1 LAB_00106a35: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
void _zz_lockfd(int fd) { zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { if (fd == -1) ++create_lock; else ++files[fds[fd]].locked; } zzuf_mutex_unlock(&fds_mutex); }
void _lock_lock(void) { int i; for (i = 0; i < _mutex_lock; i++) { if (lock[i] == -1) { lock[i] = 0; lock[i] = 0; } } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_unregister() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_00106988: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_00106988 TEST EDI,EDI JS LAB_001069d0 CMP dword ptr [.bss:maxfd],EDI JLE LAB_001069d0 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI LEA RDX,[RAX + RDI*0x4] MOVSXD RAX,dword ptr [RDX] CMP EAX,-0x1 JZ LAB_001069d0 IMUL RAX,RAX,0x450 ADD RAX,qword ptr [.bss:files] MOV dword ptr [RAX],0x0 MOV dword ptr [RDX],0xffffffff LAB_001069d0: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
void _zz_unregister(int fd) { zzuf_mutex_lock(&fds_mutex); if (fd >= 0 && fd < maxfd && fds[fd]!= -1) { files[fds[fd]].managed = 0; #if defined HAVE_FGETLN if (files[fds[fd]].fuzz.tmp) free(files[fds[fd]].fuzz.tmp); #endif fds[fd] = -1; } zzuf_mutex_unlock(&fds_mutex); }
void _unregister_unregister_unregister(void) { int i; for (i = 0; i < _unregister_mutex; i++) { if (_unregister_mutex[i]) { _unregister_mutex[i] = -1; _unregister_mutex[i] = -1; _unregister_mutex[i] = -1; _unregister_mutex[i] = -1; } } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_iswatched() ;local_res0 undefined8 0 MOV EDX,0x1 NOP dword ptr [RAX] LAB_001066f8: MOV EAX,EDX XCHG dword ptr [.bss:fds_mutex],EAX TEST EAX,EAX JNZ LAB_001066f8 TEST EDI,EDI JS LAB_00106724 CMP dword ptr [.bss:maxfd],EDI JLE LAB_00106724 MOV RAX,qword ptr [.bss:fds] MOVSXD RDI,EDI CMP dword ptr [RAX + RDI*0x4],-0x1 SETNZ AL MOVZX EAX,AL LAB_00106724: MOV dword ptr [.bss:fds_mutex],0x0 LOCK OR qword ptr [RSP]=>local_res0,0x0 RET ?? 66h f
int _zz_iswatched(int fd) { int ret = 0; zzuf_mutex_lock(&fds_mutex); if (fd < 0 || fd >= maxfd || fds[fd] == -1) goto early_exit; ret = 1; early_exit: zzuf_mutex_unlock(&fds_mutex); return ret; }
void _is_watch(int n) { if (n < 0) return; watch_mutex_lock(&watch_mutex); watch_mutex_unlock(&watch_mutex); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_mustwatchw() MOV EAX,0x1 RET ?? 66h f
int _zz_mustwatchw(wchar_t const *file) { #if defined HAVE_REGWEXEC if (has_include && regwexec(&re_include, file, 0, NULL, 0) == REG_NOMATCH) return 0; /* not included: ignore */ if (has_exclude && regwexec(&re_exclude, file, 0, NULL, 0)!= REG_NOMATCH) return 0; /* excluded: ignore */ #else (void)file; #endif return 1; /* default */ }
static int _watch_watch(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_mustwatch() MOV EDX,dword ptr [.bss:has_include] PUSH RBP MOV RBP,RDI TEST EDX,EDX JNZ LAB_00106690 MOV EAX,dword ptr [.bss:has_exclude] TEST EAX,EAX JNZ LAB_001066bb LAB_00106688: MOV EAX,0x1 LAB_0010668d: POP RBP RET ?? 90h LAB_00106690: XOR R8D,R8D MOV RSI,RDI XOR ECX,ECX XOR EDX,EDX LEA RDI,[.bss:re_include] CALL .plt:<EXTERNAL>::regexec ;int regexec(regex_t * __preg, char *... MOV R8D,EAX XOR EAX,EAX CMP R8D,0x1 JZ LAB_0010668d MOV EAX,dword ptr [.bss:has_exclude] TEST EAX,EAX JZ LAB_00106688 LAB_001066bb: XOR R8D,R8D XOR ECX,ECX XOR EDX,EDX MOV RSI,RBP LEA RDI,[.bss:re_exclude] CALL .plt:<EXTERNAL>::regexec ;int regexec(regex_t * __preg, char *... POP RBP CMP EAX,0x1 SETZ AL MOVZX EAX,AL RET ?? 0Fh
int _zz_mustwatch(char const *file) { #if defined HAVE_REGEXEC if (has_include && regexec(&re_include, file, 0, NULL, 0) == REG_NOMATCH) return 0; /* not included: ignore */ if (has_exclude && regexec(&re_exclude, file, 0, NULL, 0)!= REG_NOMATCH) return 0; /* excluded: ignore */ #else (void)file; #endif return 1; /* default */ }
bool _has_watch(const char *name) { if (!watch_has_watch(watch_watch, name)) return false; if (!watch_has_watch(watch_watch, name)) return false; return true; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_fd_fini() SUB RSP,0x8 MOV EDX,dword ptr [.bss:has_include] TEST EDX,EDX JNZ LAB_00106660 LAB_001065ee: MOV EAX,dword ptr [.bss:has_exclude] TEST EAX,EAX JNZ LAB_00106650 LAB_001065f8: MOV RDI,qword ptr [.bss:files] LEA RAX,[.bss:static_files] CMP RDI,RAX JZ LAB_00106610 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00106610: MOV RDI,qword ptr [.bss:fds] LEA RAX,[.bss:static_fds] CMP RDI,RAX JZ LAB_00106628 CALL .plt:<EXTERNAL>::free ;void free(void * __ptr) LAB_00106628: MOV RDI,qword ptr [.bss:list] LEA RAX,[.bss:static_list] CMP RDI,RAX JZ LAB_00106648 ADD RSP,0x8 JMP .plt:<EXTERNAL>::free ;void free(void * __ptr) ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00106648: ADD RSP,0x8 RET ?? 0Fh ?? 1Fh ?? 00h LAB_00106650: LEA RDI,[.bss:re_exclude] CALL .plt:<EXTERNAL>::regfree ;void regfree(regex_t * __preg) JMP LAB_001065f8 ?? 66h f ?? 90h LAB_00106660: LEA RDI,[.bss:re_include] CALL .plt:<EXTERNAL>::regfree ;void regfree(regex_t * __preg) JMP LAB_001065ee ?? 66h f
void _zz_fd_fini(void) { for (int i = 0; i < maxfd; ++i) { if (!files[fds[i]].managed) continue; /* XXX: What are we supposed to do? If filedescriptors weren't * closed properly, there's a leak, but it's not our problem. */ } #if defined HAVE_REGEX_H if (has_include) regfree(&re_include); if (has_exclude) regfree(&re_exclude); #endif if (files!= static_files) free(files); if (fds!= static_fds) free(fds); if (list!= static_list) free(list); }
void free_has_files() { if (has_files) free(has_files); if (has_files) free(has_files); if (has_files) free(has_files); if (has_files) free(has_files); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_fd_init() LEA RAX,[.bss:static_files] MOV qword ptr [.bss:files],RAX LEA RDX,[RAX + 0x8a00]=>.bss:files NOP dword ptr [RAX] LAB_00106568: ; FWD[2,0]: 0010c740,0010cb90 MOV dword ptr [RAX]=>.bss:static_files,0x0 ADD RAX,0x450 CMP RDX,RAX JNZ LAB_00106568 PCMPEQD XMM0,XMM0 LEA RAX,[.bss:static_fds] MOV dword ptr [.bss:nfiles],0x20 MOV qword ptr [.bss:fds],RAX MOV dword ptr [.bss:maxfd],0x20 MOVAPS xmmword ptr [.bss:static_fds],XMM0 MOVAPS xmmword ptr [.bss:static_fds[16]],XMM0 MOVAPS xmmword ptr [.bss:static_fds[32]],XMM0 MOVAPS xmmword ptr [.bss:static_fds[48]],XMM0 MOVAPS xmmword ptr [.bss:static_fds[64]],XMM0 MOVAPS xmmword ptr [.bss:static_fds[80]],XMM0 MOVAPS xmmword ptr [.bss:static_fds[96]],XMM0 MOVAPS xmmword ptr [.bss:static_fds[112]],XMM0 RET ?? 0Fh
void _zz_fd_init(void) { /* We start with 32 file descriptors. This is to reduce the number of * calls to malloc() that we do, so we get better chances that memory * corruption errors are reproducible */ files = static_files; for (nfiles = 0; nfiles < 32; ++nfiles) files[nfiles].managed = 0; fds = static_fds; for (maxfd = 0; maxfd < 32; ++maxfd) fds[maxfd] = -1; }
void _files_init (void) { static int i; for (i = 0; i < sizeof (files_files); i++) { files_files[i] = 0; files_files[i] = 0; } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_set_auto_increment() MOV dword ptr [.bss:autoinc],0x1 RET ?? 0Fh
void zzuf_set_auto_increment(void) { autoinc = 1; }
void z_set_z_z(void) { z_z = 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_get_ratio() ;local_20 undefined8 -20 ;local_38 undefined1[16] -38 ;local_40 undefined8 -40 ;local_48 undefined8 -48 PUSH RBP PUSH RBX SUB RSP,0x38 MOVDQA XMM0,xmmword ptr [.rodata:DAT_001096b0] MOVSD XMM1,qword ptr [.data:maxratio] ;= 3F70624DD2F1A9FCh MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_20+0x48],RAX XOR EAX,EAX MOVAPS xmmword ptr [RSP + local_38[0]+0x48],XMM0 MOVSD XMM0,qword ptr [.data:minratio] ;= 3F70624DD2F1A9FCh UCOMISD XMM0,XMM1 JP LAB_001064a0 JNZ LAB_001064a0 MOV RAX,qword ptr [RSP + local_20+0x48] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010652e ADD RSP,0x38 POP RBX POP RBP RET ?? 66h f ?? 2Eh . ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001064a0: MOV EBX,dword ptr [.bss:seed] MOVSD qword ptr [RSP + local_40+0x48],XMM1 MOV EAX,EBX AND EAX,0xf MOVZX EBP,byte ptr [RSP + RAX*0x1 + 0x10] CALL .plt:<EXTERNAL>::log ;double log(double __x) MOVSD XMM1,qword ptr [RSP + local_40+0x48] MOVSD qword ptr [RSP]=>local_48,XMM0 SHL EBP,0xc MOVAPD XMM0,XMM1 CALL .plt:<EXTERNAL>::log ;double log(double __x) MOVSD XMM2,qword ptr [RSP]=>local_48 MOV RAX,qword ptr [RSP + local_20+0x48] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010652e MOV EAX,EBX PXOR XMM1,XMM1 SUBSD XMM0,XMM2 MOV EDX,EBX SHL EAX,0x4 SAR EDX,0x4 AND AX,0xf00 AND DX,0xf0 SHR BX,0xc OR EAX,EDX OR EAX,EBX OR EAX,EBP MOVZX EAX,AX CVTSI2SD XMM1,EAX MULSD XMM0,XMM1 DIVSD XMM0,qword ptr [.rodata:DAT_001096a0] ADDSD XMM0,XMM2 ADD RSP,0x38 POP RBX POP RBP JMP .plt:LAB_00102350 LAB_0010652e: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
double zzuf_get_ratio(void) { uint8_t const shuffle[16] = { 0, 12, 2, 10, 14, 8, 15, 7, 9, 13, 3, 6, 4, 1, 11, 5 }; uint16_t rate; double min, max, cur; if (minratio == maxratio) return minratio; /* this also takes care of 0.0 */ rate = shuffle[seed & 0xf] << 12; rate |= (seed & 0xf0) << 4; rate |= (seed & 0xf00) >> 4; rate |= (seed & 0xf000) >> 12; min = log(minratio); max = log(maxratio); cur = min + (max - min) * rate / 0xffff; return exp(cur); }
double log_max(double x) { double z; double z; z = log(x); z = log(z); z = log(z); z = log(z); return z; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_set_ratio() PXOR XMM2,XMM2 MOV EDX,0x0 UCOMISD XMM0,XMM2 SETNP AL CMOVNZ EAX,EDX TEST AL,AL JZ LAB_00106380 UCOMISD XMM1,XMM2 SETNP AL CMOVNZ EAX,EDX TEST AL,AL JZ LAB_00106380 MOV qword ptr [.data:minratio],0x0 ;= 3F70624DD2F1A9FCh MOV qword ptr [.data:maxratio],0x0 ;= 3F70624DD2F1A9FCh RET ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00106380: MOVSD XMM2,qword ptr [.rodata:DAT_00109690] ;= 3DA5FD7FE1796495h COMISD XMM2,XMM0 JBE LAB_001063c0 COMISD XMM2,XMM1 MOVSD qword ptr [.data:minratio],XMM2 ;= 3F70624DD2F1A9FCh JA LAB_00106400 MOVSD XMM3,qword ptr [.rodata:DAT_00109698] ;= 4014000000000000h MOVAPD XMM0,XMM2 LAB_001063a8: COMISD XMM1,XMM3 JBE LAB_001063e4 MOVSD qword ptr [.data:maxratio],XMM3 ;= 3F70624DD2F1A9FCh RET ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001063c0: MOVSD XMM3,qword ptr [.rodata:DAT_00109698] ;= 4014000000000000h COMISD XMM0,XMM3 JA LAB_00106410 COMISD XMM2,XMM1 MOVSD qword ptr [.data:minratio],XMM0 ;= 3F70624DD2F1A9FCh JA LAB_00106428 MINSD XMM3,XMM1 MOVAPD XMM1,XMM3 LAB_001063e4: COMISD XMM0,XMM1 MOVSD qword ptr [.data:maxratio],XMM1 ;= 3F70624DD2F1A9FCh JBE LAB_00106430 LAB_001063f2: MOVSD qword ptr [.data:maxratio],XMM0 ;= 3F70624DD2F1A9FCh RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00106400: MOVSD qword ptr [.data:maxratio],XMM2 ;= 3F70624DD2F1A9FCh RET ?? 0Fh ?? 1Fh ?? 80h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00106410: COMISD XMM2,XMM1 MOVSD qword ptr [.data:minratio],XMM3 ;= 3F70624DD2F1A9FCh MOVAPD XMM0,XMM3 JA LAB_001063f2 JMP LAB_001063a8 ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00106428: MOVAPD XMM1,XMM2 JMP LAB_001063e4 ?? 66h f ?? 90h LAB_00106430: RET ?? 66h f
void zzuf_set_ratio(double r0, double r1) { if (r0 == 0.0 && r1 == 0.0) { maxratio = minratio = 0.0; return; } minratio = r0 < MIN_RATIO? MIN_RATIO : r0 > MAX_RATIO? MAX_RATIO : r0; maxratio = r1 < MIN_RATIO? MIN_RATIO : r1 > MAX_RATIO? MAX_RATIO : r1; if (maxratio < minratio) maxratio = minratio; }
void setmaxmax(double x, double y, double z, double z) { if (z >= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0.0 && z <= 0
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_set_seed() MOV dword ptr [.bss:seed],EDI RET ?? 66h f
void zzuf_set_seed(int32_t s) { seed = s; }
void z_set_z(int z) { z = z; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_list() SUB RSP,0x8 LEA RSI,[.bss:static_list] CALL _zz_allocrange ;undefined _zz_allocrange() MOV qword ptr [.bss:list],RAX ADD RSP,0x8 RET ?? 0Fh
void _zz_list(char const *fdlist) { list = _zz_allocrange(fdlist, static_list); }
void _list_alloc(void) { alloc_range = list_alloc(); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_exclude_pattern() SUB RSP,0x8 MOV RSI,RDI MOV EDX,0x1 LEA RDI,[.bss:re_exclude] CALL .plt:<EXTERNAL>::regcomp ;int regcomp(regex_t * __preg, char *... TEST EAX,EAX JNZ LAB_00106306 MOV dword ptr [.bss:has_exclude],0x1 LAB_00106306: ADD RSP,0x8 RET ?? 0Fh
void zzuf_exclude_pattern(char const *regex) { #if defined HAVE_REGEX_H if (regcomp(&re_exclude, regex, REG_EXTENDED) == 0) has_exclude = 1; #else (void)regex; #endif }
int z_has_int(const char *s) { if (!s) return 1; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_include_pattern() SUB RSP,0x8 MOV RSI,RDI MOV EDX,0x1 LEA RDI,[.bss:re_include] CALL .plt:<EXTERNAL>::regcomp ;int regcomp(regex_t * __preg, char *... TEST EAX,EAX JNZ LAB_001062d6 MOV dword ptr [.bss:has_include],0x1 LAB_001062d6: ADD RSP,0x8 RET ?? 0Fh
void zzuf_include_pattern(char const *regex) { #if defined HAVE_REGEX_H if (regcomp(&re_include, regex, REG_EXTENDED) == 0) has_include = 1; #else (void)regex; #endif }
static int z_has_ex(const char *name) { if (has_ex) return 1; return 0; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_refuse_range() MOV RSI,RDI LEA RDI,[.bss:refuse] JMP add_char_range ;undefined add_char_range() ?? 90h
void zzuf_refuse_range(char const *list) { add_char_range(refuse, list); }
void zref_add_range(char *name) { zref_add_range(range, name); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_protect_range() MOV RSI,RDI LEA RDI,[.bss:protect] JMP add_char_range ;undefined add_char_range() ?? 90h
void zzuf_protect_range(char const *list) { add_char_range(protect, list); }
void add_range_range(char *s) { add_range_range(range_range, s); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_bytes() SUB RSP,0x8 LEA RSI,[.bss:static_ranges] CALL _zz_allocrange ;undefined _zz_allocrange() MOV qword ptr [.bss:ranges],RAX ADD RSP,0x8 RET ?? 0Fh
void _zz_bytes(char const *list) { /* TODO: free(ranges) if ranges!= static_ranges */ ranges = _zz_allocrange(list, static_ranges); }
void _alloc_range(void) { alloc_range = _alloc_range; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_fuzzing() PUSH RBP LEA RSI,[.rodata:DAT_001096c0] ;= 78h x MOV RBP,RDI CALL .plt:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JNZ LAB_00107020 MOV dword ptr [.bss:fuzzing],0x0 LAB_0010701e: POP RBP RET LAB_00107020: LEA RSI,[.rodata:s_set_001096c4+2] ;= "set" MOV RDI,RBP CALL .plt:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JNZ LAB_00107040 MOV dword ptr [.bss:fuzzing],0x1 POP RBP RET ?? 90h LAB_00107040: LEA RSI,[.rodata:s_unset_001096c4] ;= "unset" MOV RDI,RBP CALL .plt:<EXTERNAL>::strcmp ;int strcmp(char * __s1, char * __s2) TEST EAX,EAX JNZ LAB_0010701e MOV dword ptr [.bss:fuzzing],0x2 POP RBP RET ?? 90h
extern void _zz_fuzzing(char const *mode) { if (!strcmp(mode, "xor")) fuzzing = FUZZING_XOR; else if (!strcmp(mode, "set")) fuzzing = FUZZING_SET; else if (!strcmp(mode, "unset")) fuzzing = FUZZING_UNSET; }
void _unset_unset(const char *name) { if (strcmp(name, "unset") == 0) _unset = 1; else if (strcmp(name, "unset") == 0) _unset = 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined print_list() MOV RDX,qword ptr [RDI] TEST RDX,RDX JZ LAB_00102919 PUSH R14 LEA R14,[.rodata:spaces.0] PUSH R13 LEA R13,[.rodata:DAT_00105008] ;= 25h % PUSH R12 LEA R12,[.rodata:DAT_00105004] ;= 20h PUSH RBP LEA RBP,[.rodata:s_%s_0010535f+5] ;= "%s\n" PUSH RBX MOV RBX,RDI JMP LAB_001028d7 ?? 0Fh ?? 1Fh ?? 00h LAB_001028b8: MOV RDX,qword ptr [RBX + 0x10] MOV RSI=>.rodata:s_%s_0010535f+5,RBP ;= "%s\n" MOV EDI,0x1 XOR EAX,EAX ADD RBX,0x18 CALL .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() MOV RDX,qword ptr [RBX] TEST RDX,RDX JZ LAB_00102910 LAB_001028d7: MOV RCX,qword ptr [RBX + 0x8] MOV RSI=>.rodata:DAT_00105004,R12 ;= 20h MOV EDI,0x1 XOR EAX,EAX CALL .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() CDQE CMP RAX,0x1f JA LAB_001028b8 LEA RDX,[RAX + R14*0x1] MOV RSI=>.rodata:DAT_00105008,R13 ;= 25h % MOV EDI,0x1 XOR EAX,EAX CALL .plt:<EXTERNAL>::__printf_chk ;undefined __printf_chk() JMP LAB_001028b8 ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_00102910: POP RBX POP RBP POP R12 POP R13 POP R14 RET LAB_00102919: RET ?? 66h f
static void print_list(char const **list) { static char const spaces[] = " "; while (*list) { size_t len = printf(" %s%s", list[0], list[1]); if (len < strlen(spaces)) printf("%s", spaces + len); printf("%s\n", list[2]); list += 3; } }
void print_list(struct list *list) { size_t i; for (i = 0; list[i]; i++) { printf("%s\n", list[i]); } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined make_fmt() PUSH R13 MOV R13,RDX PUSH R12 MOV R12,RSI PUSH RBP PUSH RBX MOV RBX,RDI MOV RDI,RSI SUB RSP,0x8 CALL .plt:<EXTERNAL>::strlen ;size_t strlen(char * __s) MOV RDI,RBX MOV RSI,R12 MOV RBP,RAX LEA RDX,[RAX + -0x1] MOVZX EAX,byte ptr [R12 + RAX*0x1 + -0x1] MOV byte ptr [RBX + 0x401],AL CALL .plt:<EXTERNAL>::memcpy ;void * memcpy(void * __dest, void *... MOV byte ptr [RBX + RBP*0x1 + -0x1],0x25 MOV byte ptr [RBX + RBP*0x1],0x63 MOV byte ptr [RBX + RBP*0x1 + 0x1],0x0 MOVZX ECX,byte ptr [RBX] TEST CL,CL JZ LAB_001029b0 MOV RDI,RBX XOR ESI,ESI NOP dword ptr [RAX + RAX*0x1] LAB_00102978: MOV RAX,RDI CMP CL,0x25 JNZ LAB_00102987 ADD RAX,0x1 ADD ESI,0x1 LAB_00102987: MOVZX ECX,byte ptr [RAX + 0x1] LEA RDI,[RAX + 0x1] TEST CL,CL JNZ LAB_00102978 LAB_00102993: MOV dword ptr [R13],ESI ADD RSP,0x8 MOV EAX,0x1 POP RBX POP RBP POP R12 POP R13 RET ?? 66h f ?? 0Fh ?? 1Fh ?? 84h ?? 00h ?? 00h ?? 00h ?? 00h ?? 00h LAB_001029b0: XOR ESI,ESI JMP LAB_00102993 ?? 66h f
static int make_fmt(struct parser *p, char const *fmt, int *nitems) { int ret = 0; size_t len = strlen(fmt); p->lastch = fmt[len - 1]; memcpy(p->tmpfmt, fmt, len - 1); p->tmpfmt[len - 1] = '%'; p->tmpfmt[len] = 'c'; p->tmpfmt[len + 1] = '\0'; for (char const *tmp = p->tmpfmt; *tmp; ++tmp) if (*tmp == '%') ++tmp, ++ret; *nitems = ret; return 1; }
char * make_string(char *s, const char *s) { size_t len = strlen(s); char *p = s; size_t i; for (i = 0; i < len; i++) { p[i] = s[i]; p[i] = '\0'; p[i] = '\0'; } return s; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined libzzuf_fini() PUSH RBX MOV RBX,qword ptr [->g_libzzuf_ready] ;= 001152e0 MOV EAX,dword ptr [RBX]=>.bss:g_libzzuf_ready ;=?? TEST EAX,EAX JNZ LAB_00103670 POP RBX RET LAB_00103670: CALL .plt:<EXTERNAL>::getpid ;__pid_t getpid(void) LEA RDI,[.rodata:s_libzzuf_finishing_for_PID_%li_001100e3] ;= "libzzuf finishing for PID %li" MOVSXD RSI,EAX XOR EAX,EAX CALL .plt:zzuf_debug ;undefined zzuf_debug(undefined param... CALL .plt:_zz_fd_fini ;undefined _zz_fd_fini() CALL .plt:_zz_network_fini ;undefined _zz_network_fini() MOV dword ptr [RBX]=>.bss:g_libzzuf_ready,0x0 ;=?? POP RBX RET ?? 0Fh
void libzzuf_fini(void) { if (!g_libzzuf_ready) return; debug("libzzuf finishing for PID %li", (long int)getpid()); _zz_fd_fini(); _zz_network_fini(); g_libzzuf_ready = 0; }
static void _ready (void) { if (g_ready!= 0) { g_ready = 0; g_ready = 0; } else { g_ready = 0; g_ready = 0; } }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_debug2(undefined param_1, undefined param_2, undefined param_3, undefined param_4, undefined param_5, undefined param_6, undefined1 param_7) ;param_1 undefined DIL ;param_2 undefined SIL ;param_3 undefined DL ;param_4 undefined CL ;param_5 undefined R8B ;param_6 undefined R9B ;param_7 undefined1 8 ;local_18 undefined1[16] -18 ;local_28 undefined1[16] -28 ;local_38 undefined1[16] -38 ;local_48 undefined1[16] -48 ;local_58 undefined1[16] -58 ;local_68 undefined1[16] -68 ;local_78 undefined1[16] -78 ;local_88 undefined1[16] -88 ;local_90 undefined8 -90 ;local_98 undefined8 -98 ;local_a0 undefined8 -a0 ;local_a8 undefined8 -a8 ;local_b0 undefined8 -b0 ;local_b8 undefined1 -b8 ;local_c0 undefined8 -c0 ;local_c8 undefined8 -c8 ;local_d0 undefined8 -d0 ;local_d4 undefined4 -d4 ;local_d8 undefined4 -d8 SUB RSP,0xd8 MOV qword ptr [RSP + local_b0+0xd8],param_2 MOV qword ptr [RSP + local_a8+0xd8],param_3 MOV qword ptr [RSP + local_a0+0xd8],param_4 MOV qword ptr [RSP + local_98+0xd8],param_5 MOV qword ptr [RSP + local_90+0xd8],param_6 TEST AL,AL JZ LAB_001050bb MOVAPS xmmword ptr [RSP + local_88[0]+0xd8],XMM0 MOVAPS xmmword ptr [RSP + local_78[0]+0xd8],XMM1 MOVAPS xmmword ptr [RSP + local_68[0]+0xd8],XMM2 MOVAPS xmmword ptr [RSP + local_58[0]+0xd8],XMM3 MOVAPS xmmword ptr [RSP + local_48[0]+0xd8],XMM4 MOVAPS xmmword ptr [RSP + local_38[0]+0xd8],XMM5 MOVAPS xmmword ptr [RSP + local_28[0]+0xd8],XMM6 MOVAPS xmmword ptr [RSP + local_18[0]+0xd8],XMM7 LAB_001050bb: MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_c0+0xd8],RAX XOR EAX,EAX LEA RAX=>param_7,[RSP + 0xe0] MOV dword ptr [RSP]=>local_d8,0x8 MOV qword ptr [RSP + local_d0+0xd8],RAX LEA RAX=>local_b8,[RSP + 0x20] MOV qword ptr [RSP + local_c8+0xd8],RAX MOV RAX,qword ptr [->g_debug_level] ;= 001152dc MOV dword ptr [RSP + local_d4+0xd8],0x30 CMP dword ptr [RAX]=>.bss:g_debug_level,0x1 ;=?? JLE LAB_00105105 MOV param_2,RSP CALL mydebug ;undefined mydebug() LAB_00105105: MOV RAX,qword ptr [RSP + local_c0+0xd8] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010511d ADD RSP,0xd8 RET LAB_0010511d: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
void zzuf_debug2(char const *format,...) { va_list args; va_start(args, format); if (g_debug_level >= 2) mydebug(format, args); va_end(args); }
void debug_level(int level, const char *fmt,...) { va_list ap; va_start(ap, fmt); debug_level(level, fmt, ap); va_end(ap); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined zzuf_debug(undefined param_1, undefined param_2, undefined param_3, undefined param_4, undefined param_5, undefined param_6, undefined1 param_7) ;param_1 undefined DIL ;param_2 undefined SIL ;param_3 undefined DL ;param_4 undefined CL ;param_5 undefined R8B ;param_6 undefined R9B ;param_7 undefined1 8 ;local_18 undefined1[16] -18 ;local_28 undefined1[16] -28 ;local_38 undefined1[16] -38 ;local_48 undefined1[16] -48 ;local_58 undefined1[16] -58 ;local_68 undefined1[16] -68 ;local_78 undefined1[16] -78 ;local_88 undefined1[16] -88 ;local_90 undefined8 -90 ;local_98 undefined8 -98 ;local_a0 undefined8 -a0 ;local_a8 undefined8 -a8 ;local_b0 undefined8 -b0 ;local_b8 undefined1 -b8 ;local_c0 undefined8 -c0 ;local_c8 undefined8 -c8 ;local_d0 undefined8 -d0 ;local_d4 undefined4 -d4 ;local_d8 undefined4 -d8 SUB RSP,0xd8 MOV qword ptr [RSP + local_b0+0xd8],param_2 MOV qword ptr [RSP + local_a8+0xd8],param_3 MOV qword ptr [RSP + local_a0+0xd8],param_4 MOV qword ptr [RSP + local_98+0xd8],param_5 MOV qword ptr [RSP + local_90+0xd8],param_6 TEST AL,AL JZ LAB_00104feb MOVAPS xmmword ptr [RSP + local_88[0]+0xd8],XMM0 MOVAPS xmmword ptr [RSP + local_78[0]+0xd8],XMM1 MOVAPS xmmword ptr [RSP + local_68[0]+0xd8],XMM2 MOVAPS xmmword ptr [RSP + local_58[0]+0xd8],XMM3 MOVAPS xmmword ptr [RSP + local_48[0]+0xd8],XMM4 MOVAPS xmmword ptr [RSP + local_38[0]+0xd8],XMM5 MOVAPS xmmword ptr [RSP + local_28[0]+0xd8],XMM6 MOVAPS xmmword ptr [RSP + local_18[0]+0xd8],XMM7 LAB_00104feb: MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_c0+0xd8],RAX XOR EAX,EAX LEA RAX=>param_7,[RSP + 0xe0] MOV dword ptr [RSP]=>local_d8,0x8 MOV qword ptr [RSP + local_d0+0xd8],RAX LEA RAX=>local_b8,[RSP + 0x20] MOV qword ptr [RSP + local_c8+0xd8],RAX MOV RAX,qword ptr [->g_debug_level] ;= 001152dc MOV dword ptr [RSP + local_d4+0xd8],0x30 MOV EAX=>.bss:g_debug_level,dword ptr [RAX] ;=?? TEST EAX,EAX JLE LAB_00105036 MOV param_2,RSP CALL mydebug ;undefined mydebug() LAB_00105036: MOV RAX,qword ptr [RSP + local_c0+0xd8] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010504e ADD RSP,0xd8 RET LAB_0010504e: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP dword ptr CS:[RAX + RAX*0x1]
void zzuf_debug(char const *format,...) { va_list args; va_start(args, format); if (g_debug_level >= 1) mydebug(format, args); va_end(args); }
int log_level(const char *fmt,...) { va_list ap; int ret; va_start(ap, fmt); ret = log_level(fmt, ap); va_end(ap); return ret; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_sys_init() ;local_10 undefined8 -10 ;local_38 undefined8 -38 SUB RSP,0x38 MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_10+0x38],RAX XOR EAX,EAX CMP qword ptr [->__asan_init_v3],0x0 ;= 001c50e8 JZ LAB_001052d8 LAB_001052be: MOV RAX,qword ptr [RSP + local_10+0x38] SUB RAX,qword ptr FS:[0x28] JNZ LAB_0010530a ADD RSP,0x38 RET ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_001052d8: MOV RDI=>EXTERNAL:<EXTERNAL>::fprintf,qword ptr [-><EXTERNAL>::fprintf] ;= 001c50a0 ;=?? MOV RSI,RSP CALL .plt:<EXTERNAL>::dladdr ;undefined dladdr() TEST EAX,EAX JZ LAB_001052be MOV RDI,qword ptr [RSP]=>local_38 MOV ESI,0x2 CALL .plt:<EXTERNAL>::dlopen ;undefined dlopen() TEST RAX,RAX JZ LAB_001052be MOV RDX,qword ptr [->_zz_dl_lib] ;= 001152a0 MOV qword ptr [RDX]=>.data:_zz_dl_lib,RAX ;= FFFFFFFFFFFFFFFFh JMP LAB_001052be LAB_0010530a: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP
void _zz_sys_init(void) { #if defined HAVE_WINDOWS_H insert_funcs(); #elif HAVE_DLFCN_H &&!__APPLE__ /* If glibc is recent enough, we use dladdr() to get its address. This * way we are sure that the symbols we load are the most recent version, * or we may get weird problems. We choose fileno as a random symbol to * get, because we know we don't divert it. */ #if HAVE_DLADDR && (__GNUC__ || __clang__) /* XXX: for some reason we conflict with libasan. We would like to avoid * RTLD_NEXT because it causes problems with versioned symbols. However, * if we do that, libasan enters infinite recursion. So we just disable * this workaround if libasan is detected. * If we don’t do this, here’s a program that crashes when fuzzed: * echo 'int main() {}' | gcc -xc -g -ggdb -fsanitize=address - */ if (&__asan_init_v3 == NULL) # endif { # if HAVE_DLADDR Dl_info di; if (dladdr(&fprintf, &di)!= 0) { void *lib = dlopen(di.dli_fname, RTLD_NOW); if (lib) _zz_dl_lib = lib; } # endif } #else /* Nothing to do on our platform */ #endif }
static int _liblib_init(void) { struct _lib_lib_data *lib_data = _lib_data; struct _lib_data *lib_data = NULL; if (lib_data == NULL) return 0; lib_data = (struct _lib_data *)lib_data; if (lib_data == NULL) { return 0; } lib_lib_init(lib_data); return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_hostwatched() ;local_10 undefined8 -10 ;local_28 undefined1[16] -28 ; 00105659 ;local_2c undefined4 -2c PUSH RBX SUB RSP,0x30 MOV RBX,qword ptr [.bss:allow] ;=?? MOV RAX,qword ptr FS:[0x28] MOV qword ptr [RSP + local_10+0x38],RAX XOR EAX,EAX TEST RBX,RBX JZ LAB_00105620 PXOR XMM0,XMM0 LEA RSI=>local_28,[RSP + 0x10] LEA RDX=>local_2c,[RSP + 0xc] MOV dword ptr [RSP + local_2c+0x38],0x10 MOVAPS xmmword ptr [RSP + local_28[0]+0x38],XMM0 CALL .plt:<EXTERNAL>::getsockname ;int getsockname(int __fd, sockaddr *... TEST EAX,EAX JNZ LAB_00105688 MOV ECX,dword ptr [RSP + local_28[4]+0x38] TEST ECX,ECX JZ LAB_00105688 MOV EAX,dword ptr [RBX] XOR EDX,EDX TEST EAX,EAX JNZ LAB_00105615 JMP LAB_00105688 ?? 66h f ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00105608: LEA EAX,[RDX + 0x1] MOV RDX,RAX MOV EAX,dword ptr [RBX + RAX*0x4] TEST EAX,EAX JZ LAB_00105688 LAB_00105615: CMP EAX,ECX JNZ LAB_00105608 LAB_00105619: MOV EAX,0x1 JMP LAB_0010568a LAB_00105620: MOV RBX,qword ptr [.bss:deny] ;=?? TEST RBX,RBX JZ LAB_00105619 PXOR XMM0,XMM0 LEA RSI=>local_28,[RSP + 0x10] LEA RDX=>local_2c,[RSP + 0xc] MOV dword ptr [RSP + local_2c+0x38],0x10 MOVAPS xmmword ptr [RSP + local_28[0]+0x38],XMM0 CALL .plt:<EXTERNAL>::getsockname ;int getsockname(int __fd, sockaddr *... MOV R8D,EAX MOV EAX,0x1 TEST R8D,R8D JNZ LAB_0010568a MOV ECX,dword ptr [RSP + local_28[4]+0x38] TEST ECX,ECX JZ LAB_00105619 MOV EAX,dword ptr [RBX] TEST EAX,EAX JZ LAB_00105619 XOR EDX,EDX JMP LAB_0010567d ?? 0Fh ?? 1Fh ?? 44h D ?? 00h ?? 00h LAB_00105670: LEA EAX,[RDX + 0x1] MOV RDX,RAX MOV EAX,dword ptr [RBX + RAX*0x4] TEST EAX,EAX JZ LAB_00105619 LAB_0010567d: CMP ECX,EAX JNZ LAB_00105670 NOP dword ptr [RAX] LAB_00105688: XOR EAX,EAX LAB_0010568a: MOV RDX,qword ptr [RSP + local_10+0x38] SUB RDX,qword ptr FS:[0x28] JNZ LAB_001056a0 ADD RSP,0x30 POP RBX RET LAB_001056a0: CALL .plt:<EXTERNAL>::__stack_chk_fail ;undefined __stack_chk_fail() NOP word ptr CS:[RAX + RAX*0x1]
int _zz_hostwatched(int sock) { #if defined HAVE_SYS_SOCKET_H || defined (HAVE_WINDOWS_H) int watch = 1; unsigned int ip; if (!allow &&!deny) return 1; ip = get_socket_ip(sock); if (allow) watch = host_in_list(ip, allow); else if (deny && host_in_list(ip, deny)) watch = 0; return watch; #else return 0; #endif }
int _host_host(int fd) { int fd; struct timeval tv; struct timeval tv; struct timeval tv; memset(&tv, 0, sizeof(tv)); tv.tv_sec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = 0; tv.tv_usec = tv.tv_usec; tv.tv_usec = tv.tv_usec; tv.tv_usec = tv.tv_usec; tv.tv_usec = tv.tv_usec; tv.tv_usec = tv.tv_usec; tv.tv_usec = tv.tv_usec; tv.tv_usec = tv.tv_usec; if (tv.tv_usec == 0) return 0; return 1; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_portwatched() MOV RSI,qword ptr [.bss:ports] ;=?? TEST RSI,RSI JZ LAB_00105598 MOVSXD RDI,EDI JMP .plt:_zz_isinrange ;undefined _zz_isinrange() ?? 0Fh ?? 1Fh ?? 40h @ ?? 00h LAB_00105598: MOV EAX,0x1 RET ?? 66h f
int _zz_portwatched(int port) { #if defined HAVE_SYS_SOCKET_H || defined (HAVE_WINDOWS_H) if (!ports) return 1; return _zz_isinrange(port, ports); #else return 0; #endif }
int _is_port(int port) { return _is_port(port); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_ports() SUB RSP,0x8 LEA RSI,[.bss:static_ports] ;=?? CALL .plt:_zz_allocrange ;undefined _zz_allocrange() MOV qword ptr [.bss:ports],RAX ;=?? ADD RSP,0x8 RET ?? 0Fh
void _zz_ports(char const *portlist) { #if defined HAVE_SYS_SOCKET_H || defined (HAVE_WINDOWS_H) ports = _zz_allocrange(portlist, static_ports); #endif }
void _alloc_range(void) { range = _range; }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_deny() SUB RSP,0x8 LEA RSI,[.bss:static_deny] ;=?? CALL create_host_list ;undefined create_host_list() MOV qword ptr [.bss:deny],RAX ;=?? ADD RSP,0x8 RET ?? 0Fh
void _zz_deny(char const *denylist) { #if defined HAVE_SYS_SOCKET_H || defined (HAVE_WINDOWS_H) deny = create_host_list(denylist, static_deny); #endif }
static void create_host_list(void) { host_list = create_host_list(); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_allow() SUB RSP,0x8 LEA RSI,[.bss:static_allow] ;=?? CALL create_host_list ;undefined create_host_list() MOV qword ptr [.bss:allow],RAX ;=?? ADD RSP,0x8 RET ?? 0Fh
void _zz_allow(char const *allowlist) { #if defined HAVE_SYS_SOCKET_H || defined (HAVE_WINDOWS_H) allow = create_host_list(allowlist, static_allow); #endif }
void create_host_list(void) { create_host_list(host_list); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_network_fini() SUB RSP,0x8 MOV RDI,qword ptr [.bss:ports] ;=?? LEA RAX,[.bss:static_ports] ;=?? CMP RDI,RAX JZ LAB_001054dc CALL .plt:free ;void free(void * __ptr) LAB_001054dc: MOV RDI,qword ptr [.bss:allow] ;=?? LEA RAX,[.bss:static_allow] ;=?? CMP RDI,RAX JZ LAB_001054f4 CALL .plt:free ;void free(void * __ptr) LAB_001054f4: MOV RDI,qword ptr [.bss:deny] ;=?? LEA RAX,[.bss:static_deny] ;=?? CMP RDI,RAX JZ LAB_00105510 ADD RSP,0x8 JMP .plt:free ;void free(void * __ptr) LAB_00105510: ADD RSP,0x8 RET ?? 66h f
void _zz_network_fini(void) { #if defined HAVE_SYS_SOCKET_H || defined (HAVE_WINDOWS_H) if (ports!= static_ports) free(ports); if (allow!= static_allow) free(allow); if (deny!= static_deny) free(deny); #endif #if defined HAVE_WINSOCK2_H WSACleanup(); /* LATER: handle error */ #endif }
void _free(void) { if (free) free(free); if (free) free(free); }
;************************************************************************************************************************************************************ ;* FUNCTION * ;************************************************************************************************************************************************************ ;undefined _zz_network_init() RET ?? 66h f
void _zz_network_init(void) { #ifdef HAVE_WINSOCK2_H WSADATA wsa_data; WSAStartup(MAKEWORD(2,2), &wsa_data); /* LATER: handle error */ #endif }
static void _giggle_tls_init (Giggletls *tls) { }