Function at 0x404a60
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1bc
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov dword [ebp - 0x1b4], eax
mov dword [ebp - 0x1b8], edx
mov eax, dword [ebx + 4]
cdq
mov dword [ebp - 0x198], ecx
mov esi, eax
add esi, dword [ebx + 8]
mov ecx, edx
push edi
adc ecx, dword [ebx + 0xc]
add esi, 0xffffffff
push edx
push eax
adc ecx, 0xffffffff
mov dword [ebp - 0x1a4], ebx
push ecx
push esi
call fcn.0040b560
test byte [ebx], 0x21
mov ecx, eax
mov dword [ebp - 0x1a0], ecx
mov edx, 0x10
je 0x404ac8
mov edx, 0x20
xor edi, edi
mov dword [ebp - 0x1ac], edx
xor eax, eax
mov dword [ebp - 0x1b0], edi
mov dword [ebp - 0x19c], eax
xorps xmm0, xmm0
movdqu xmmword [ebp - 0x68], xmm0
test ecx, ecx
jle 0x4051a3
mov edi, edi
mov ecx, dword [ebx]
xorps xmm0, xmm0
mov dword [ebp - 0x28], 0
movdqu xmmword [ebp - 0x38], xmm0
test cl, 1
je 0x404c59
mov esi, dword [ebp - 0x198]
imul edx
push 0
add eax, 0x100
adc edx, 0
push edx
push eax
mov eax, dword [sym.imp.MSVCR120.dll__fseeki64]
push esi
call eax
push esi
push 1
lea eax, [ebp - 0x24]
xorps xmm0, xmm0
push 0x20
push eax
mov eax, dword [sym.imp.MSVCR120.dll_fread]
movdqu xmmword [ebp - 0x24], xmm0
movdqu xmmword [ebp - 0x14], xmm0
call eax
mov eax, dword [ebp + 0xc]
add esp, 0x20
cmp dword [eax + 4], 1
jg 0x404bcc
push dword [ebp - 0x10]
push dword [ebp - 0x14]
call fcn.0040a7c0
mov edi, dword [ebp - 0xc]
add esp, 8
mov esi, edi
mov dword [ebp - 0x18c], eax
mov ecx, edi
sar esi, 8
shr ecx, 0x18
and esi, 0xff00
movdqu xmm0, xmmword [ebp - 0x24]
or esi, ecx
mov dword [ebp - 0x194], edx
mov ecx, edi
and edi, 0xff00
shl ecx, 0x10
or ecx, edi
shl ecx, 8
or esi, ecx
mov ecx, dword [ebp - 8]
mov edi, ecx
mov eax, ecx
shr eax, 0x18
sar edi, 8
and edi, 0xff00
or edi, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shl eax, 8
or edi, eax
mov dword [ebp - 0x1b0], edi
movdqu xmmword [ebp - 0x38], xmm0
jmp 0x404df9
lea ecx, [ebp - 0x24]
call fcn.00404970
mov edi, eax
push dword [edi + 4]
push dword [edi]
call fcn.0040a7c0
mov ecx, dword [edi + 8]
mov esi, ecx
mov dword [ebp - 0x18c], eax
mov eax, ecx
shr eax, 0x18
sar esi, 8
and esi, 0xff00
mov dword [ebp - 0x194], edx
or esi, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
mov ecx, dword [edi + 0xc]
shl eax, 8
mov edx, ecx
or esi, eax
sar edx, 8
mov eax, ecx
and edx, 0xff00
shr eax, 0x18
or edx, eax
mov eax, ecx
shl eax, 0x10
and ecx, 0xff00
or eax, ecx
shl eax, 8
or edx, eax
push edi
mov dword [ebp - 0x1b0], edx
call dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete_void__]
movdqu xmm0, xmmword [ebp - 0x24]
add esp, 0xc
movdqu xmmword [ebp - 0x38], xmm0
jmp 0x404df9
test cl, 0x20
je 0x404d11
lea eax, [edi + edx]
cdq
mov esi, eax
mov ecx, edx
mov eax, dword [ebp - 0x19c]
cdq
push edx
push eax
push ecx
push esi
call fcn.0040b500
mov esi, eax
mov eax, edx
add esi, 0x100
push 0
adc eax, 0
push eax
push esi
push dword [ebp - 0x198]
mov dword [ebp - 0x194], eax
mov eax, dword [sym.imp.MSVCR120.dll__fseeki64]
call eax
push dword [ebp - 0x198]
lea eax, [ebp - 0x24]
xorps xmm0, xmm0
push 1
push 0x20
push eax
mov eax, dword [sym.imp.MSVCR120.dll_fread]
movdqu xmmword [ebp - 0x24], xmm0
movdqu xmmword [ebp - 0x14], xmm0
call eax
mov eax, dword [ebp - 0x14]
add esp, 0x20
movdqu xmm1, xmmword [ebp - 0x24]
add esi, 0x20
mov dword [ebp - 0x28], eax
movdqu xmm0, xmmword [ebp - 0x14]
adc dword [ebp - 0x194], 0
mov eax, dword [ebp - 0x1a0]
dec eax
mov dword [ebp - 0x18c], esi
pxor xmm0, xmm1
mov esi, dword [ebx + 4]
movdqu xmmword [ebp - 0x38], xmm1
movdqu xmmword [ebp - 0x38], xmm0
cmp dword [ebp - 0x19c], eax
jne 0x404df9
mov eax, esi
cdq
push edx
push eax
jmp 0x404de6
cdq
mov esi, eax
mov ecx, edx
mov eax, dword [ebp - 0x1ac]
push 0
push ecx
cdq
push esi
mov edi, edx
mov dword [ebp - 0x1a8], esi
mov ebx, eax
mov dword [ebp - 0x184], ecx
push edi
push ebx
call fcn.0040b500
mov esi, dword [ebp - 0x198]
add eax, 0x100
adc edx, 0
push edx
push eax
mov eax, dword [sym.imp.MSVCR120.dll__fseeki64]
push esi
call eax
push esi
push 1
lea eax, [ebp - 0x38]
push 0x10
push eax
mov eax, dword [sym.imp.MSVCR120.dll_fread]
call eax
mov esi, dword [ebp - 0x1a4]
add esp, 0x20
mov esi, dword [esi + 4]
mov eax, esi
cdq
mov dword [ebp - 0x188], eax
mov eax, dword [ebp - 0x1a0]
push edi
mov dword [ebp - 0x190], edx
cdq
push ebx
push edx
push eax
call fcn.0040b500
push dword [ebp - 0x190]
mov ebx, eax
mov edi, edx
push dword [ebp - 0x188]
push dword [ebp - 0x184]
push dword [ebp - 0x1a8]
call fcn.0040b500
add ebx, eax
mov eax, dword [ebp - 0x1a0]
adc edi, edx
add ebx, 0x100
mov dword [ebp - 0x18c], ebx
mov ebx, dword [ebp - 0x1a4]
adc edi, 0
dec eax
mov dword [ebp - 0x194], edi
cmp dword [ebp - 0x19c], eax
jne 0x404df9
push dword [ebp - 0x190]
push dword [ebp - 0x188]
push dword [ebx + 0xc]
push dword [ebx + 8]
call fcn.0040b5d0
mov ecx, eax
or ecx, edx
je 0x404df9
mov esi, eax
lea edi, [esi + 0xf]
and edi, 0xfffffff0
push edi
mov dword [ebp - 0x184], edi
call dword [sym.imp.MSVCR120.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
mov dword [ebp - 0x190], eax
push edi
call dword [sym.imp.MSVCR120.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
mov dword [ebp - 0x188], eax
push edi
push 0
push dword [ebp - 0x190]
call sub.MSVCR120.dll_memset
add esp, 0xc
push edi
push 0
push dword [ebp - 0x188]
call sub.MSVCR120.dll_memset
add esp, 0xc
xorps xmm0, xmm0
movdqu xmmword [ebp - 0x58], xmm0
movdqu xmmword [ebp - 0x48], xmm0
push 0
push dword [ebp - 0x194]
push dword [ebp - 0x18c]
push dword [ebp - 0x198]
call dword [sym.imp.MSVCR120.dll__fseeki64]
push dword [ebp - 0x198]
push 1
push edi
push dword [ebp - 0x190]
call dword [sym.imp.MSVCR120.dll_fread]
mov eax, dword [ebp + 0xc]
add esp, 0x20
xorps xmm0, xmm0
movdqu xmmword [ebp - 0x14], xmm0
cmp dword [eax + 4], 1
jg 0x404e9c
lea eax, [ebp - 0x14]
jmp 0x404e9f
add eax, 0x60
push 0x10
mov dword [ebp - 0x1a8], eax
call dword [sym.imp.MSVCR120.dll_void____cdecl_operator_new_unsigned_int_]
mov edx, dword [ebp - 0x19c]
mov edi, eax
mov eax, dword [ebp - 0x1a8]
movq xmm0, qword [eax]
movq qword [edi], xmm0
mov ecx, dword [eax + 8]
mov eax, edx
mov dword [edi + 8], ecx
mov ecx, edx
sar ecx, 0x18
mov byte [edi + 0xc], cl
mov ecx, edx
sar ecx, 0x10
mov byte [edi + 0xd], cl
lea ecx, [ebp - 0x180]
sar eax, 8
mov byte [edi + 0xf], dl
mov edx, dword [ebp - 0x1b4]
mov byte [edi + 0xe], al
call fcn.00401240
add esp, 4
lea eax, [ebp - 0x48]
mov edx, 1
lea ecx, [ebp - 0x180]
push eax
push edi
call fcn.00402290
add esp, 8
test byte [ebx], 0x10
je 0x404f47
mov edx, dword [ebp - 0x1b4]
push ecx
lea ecx, [ebp - 0x180]
call fcn.00401240
add esp, 4
lea eax, [ebp - 0x58]
mov edx, 1
lea ecx, [ebp - 0x180]
push eax
lea eax, [ebp - 0x48]
push eax
call fcn.00402290
add esp, 8
jmp 0x404f51
movdqu xmm0, xmmword [ebp - 0x48]
movdqu xmmword [ebp - 0x58], xmm0
mov ecx, dword [ebx]
mov eax, ecx
and al, 2
movsx edx, al
neg edx
sbb edx, edx
add edx, 2
test cl, 0x10
jne 0x404f6d
mov ecx, 2
jmp 0x404f7d
test cl, 0x20
mov eax, 4
mov ecx, 1
cmove ecx, eax
mov eax, dword [ebx]
test al, 8
je 0x404f8f
or edx, 0x10000000
or ecx, 0x10000000
test eax, eax
jns 0x404fb0
mov edi, dword [ebp - 0x184]
push edi
push dword [ebp - 0x190]
push dword [ebp - 0x188]
call sub.MSVCR120.dll_memcpy
add esp, 0xc
jmp 0x405004
mov eax, dword [ebp + 0xc]
cmp dword [eax + 4], 1
jg 0x404fbe
lea eax, [ebp - 0x68]
jmp 0x404fc1
add eax, 0x40
mov ebx, dword [ebp + 0xc]
lea edi, [ebp - 0x38]
push edi
lea edi, [ebp - 0x58]
push edi
mov edi, dword [ebp - 0x184]
push eax
lea eax, [ebp - 0x48]
push eax
push edi
push dword [ebp - 0x188]
xor eax, eax
cmp dword [ebx + 4], 4
push dword [ebp - 0x190]
sete al
push eax
call fcn.004045b0
mov ebx, dword [ebp - 0x1a4]
add esp, 0x20
test al, al
je 0x40516d
test byte [ebx], 1
je 0x4050f5
cmp dword [ebp - 0x1b0], 0
je 0x4050f5
mov eax, dword [ebx + 8]
push eax
mov dword [ebp - 0x184], eax
call dword [sym.imp.MSVCR120.dll_void____cdecl_operator_new_unsigned_int_]
add esp, 4
mov dword [ebp - 0x18c], eax
push dword [ebp - 0x184]
push 0
push eax
call sub.MSVCR120.dll_memset
add esp, 0xc
cmp byte [ebp + 0x14], 0
je 0x405058
push str.Decompressing_data..._n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
push dword [ebp - 0x184]
mov edx, dword [ebp - 0x188]
mov ecx, dword [ebp - 0x18c]
call fcn.00408d20
add esp, 4
mov dword [ebp - 0x184], eax
push dword [ebp - 0x1b8]
push 1
push eax
push dword [ebp - 0x18c]
call dword [sym.imp.MSVCR120.dll_fwrite]
add esp, 0x10
cmp byte [ebp + 0x14], 0
je 0x4050b9
push esi
push str.Compressed_block_size:__d_n
call dword [sym.imp.MSVCR120.dll_printf]
mov esi, dword [ebp - 0x184]
push esi
push str.Decompressed_block_size:__d_n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 0x10
jmp 0x4050bf
mov esi, dword [ebp - 0x184]
mov eax, esi
cdq
sub dword [ebx + 8], eax
mov eax, dword [ebx + 8]
sbb dword [ebx + 0xc], edx
or eax, dword [ebx + 0xc]
jne 0x4050e2
test esi, esi
js 0x405149
push str.EDAT_SDAT_successfully_decompressed__n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
push dword [ebp - 0x18c]
mov esi, dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete_void__]
call esi
add esp, 4
jmp 0x405113
push dword [ebp - 0x1b8]
push 1
push esi
push dword [ebp - 0x188]
call dword [sym.imp.MSVCR120.dll_fwrite]
mov esi, dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete_void__]
add esp, 0x10
push dword [ebp - 0x190]
call esi
add esp, 4
push dword [ebp - 0x188]
call esi
mov eax, dword [ebp - 0x19c]
add esp, 4
inc eax
mov dword [ebp - 0x19c], eax
cmp eax, dword [ebp - 0x1a0]
jge 0x4051a3
mov edx, dword [ebp - 0x1ac]
jmp 0x404af0
push str.EDAT_SDAT_decompression_failed__n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 4
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
cmp byte [ebp + 0x14], 0
je 0x40518d
push dword [ebp - 0x194]
push dword [ebp - 0x18c]
push str.WARNING:_Block_at_offset_0x_llx_has_invalid_hash__n
call dword [sym.imp.MSVCR120.dll_printf]
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040abe5
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040abe5
mov esp, ebp
pop ebp
ret