Function at 0x404770
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x40d04c]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, ecx
push edi
mov edi, dword [ebp + 8]
cmp dword [esi], 0
je 0x4047b4
lea eax, [esi + 0x1168]
push str.There_is_already_a_PK2_opened.
push eax
call section..text
add esp, 8
xor al, al
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040794a
mov esp, ebp
pop ebp
ret 4
push 0x40939c
push edi
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fopen_s]
mov eax, dword [esi]
add esp, 0xc
test eax, eax
jne 0x40480a
push 0x4093a0
push edi
lea eax, [esi + 0x1168]
push str.Could_not_open_the_file__
push eax
call section..text
add esp, 8
push eax
call section..text
add esp, 8
push eax
call section..text
add esp, 8
xor al, al
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040794a
mov esp, ebp
pop ebp
ret 4
push eax
push pe_nt_image_headers32
lea edi, [esi + 4]
push 1
push edi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fread]
add esp, 0x10
cmp eax, 0x100
je 0x40485c
push dword [esi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
push str.Could_not_read_in_the_PK2Header.
lea eax, [esi + 0x1168]
mov dword [esi], 0
push eax
call section..text
add esp, 0xc
xor al, al
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040794a
mov esp, ebp
pop ebp
ret 4
mov eax, dword [0x4093f4]
lea ecx, [ebp - 0x34]
xorps xmm0, xmm0
mov dword [ebp - 0x24], eax
mov al, byte [0x4093f8]
mov edx, 0x1a
movlpd qword [ebp - 0x1f], xmm0
movups xmm0, xmmword [str.JoyMax_File_Manager__n]
mov byte [ebp - 0x17], 0
mov byte [ebp - 0x20], al
movups xmmword [ebp - 0x34], xmm0
nop dword [eax + eax]
mov eax, dword [ecx]
cmp eax, dword [edi]
jne 0x4048a1
add ecx, 4
add edi, 4
sub edx, 4
jae 0x404890
mov al, byte [ecx]
cmp al, byte [edi]
jne 0x4048c8
mov al, byte [ecx + 1]
cmp al, byte [edi + 1]
jne 0x4048c8
cmp edx, 0xfffffffe
je 0x4048c4
mov al, byte [ecx + 2]
cmp al, byte [edi + 2]
jne 0x4048c8
mov al, byte [ecx + 3]
cmp al, byte [edi + 3]
jne 0x4048c8
xor eax, eax
jmp 0x4048cd
sbb eax, eax
or eax, 1
mov ecx, dword [esi]
push ecx
test eax, eax
je 0x4048e4
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
push str.Invalid_PK2_name.
jmp 0x404833
cmp dword [esi + 0x22], 0x1000002
je 0x4048fd
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
push str.Invalid_PK2_version.
jmp 0x404833
call fcn.00405370
add esp, 4
mov dword [esi + 0x108], eax
cmp byte [esi + 0x26], 0
mov dword [esi + 0x10c], edx
je 0x404969
push 0
push 0x10
lea eax, [ebp - 0x14]
xorps xmm0, xmm0
push eax
push 0
push 0x10
push str.Joymax_Pak_File
lea ecx, [esi + 0x110]
movups xmmword [ebp - 0x14], xmm0
call fcn.00403050
xorps xmm0, xmm0
mov dword [ebp - 9], 0
movq qword [ebp - 0x11], xmm0
lea edx, [esi + 0x27]
mov byte [ebp - 5], 0
lea ecx, [ebp - 0x14]
mov edi, 0xc
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40497d
add ecx, 4
add edx, 4
sub edi, 4
jae 0x404958
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
xor ecx, ebp
pop esi
call fcn.0040794a
mov esp, ebp
pop ebp
ret 4
push dword [esi]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
push str.Invalid_Blowfish_key.
jmp 0x404833