Function at 0x4045f0
Capabilities:
Read file on windows

Disassembly:
sub esp, 0x24
push ebx
mov eax, dword [esp + 0x30]
push ebp
push esi
xor ebx, ebx
push edi
push ebx
push 0x80
push 3
push ebx
push ebx
push closesocket
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [esp + 0x1c], edi
je 0x4046ce
lea ecx, [esp + 0x20]
push ebx
push ecx
lea edx, [esp + 0x2c]
push 4
push edx
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp byte [esp + 0x24], 0xff
jne 0x4047c3
cmp byte [esp + 0x25], 0xd8
jne 0x4047c3
push ebx
push ebx
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0x28
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebp, eax
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalLock]
push ebx
mov esi, eax
call sub.JAPI2.dll__Init_JPEG_Decompressor_IJG_4
lea eax, [esp + 0x18]
lea ecx, [esp + 0x3c]
push eax
lea edx, [esp + 0x14]
push ecx
push edx
push edi
call sub.JAPI2.dll__Start_JPEG_Decompress_IJG_16
test eax, eax
je 0x4046af
cmp dword [esp + 0x18], ebx
je 0x4046d8
mov eax, dword [0x422828]
push ebx
push 0x4210b4
mov ecx, dword [eax + 0x110]
push ecx
call dword [sym.imp.USER32.dll_GetFocus]
push eax
call dword [sym.imp.USER32.dll_MessageBoxA]
call sub.JAPI2.dll__End_JPEG_Decompress_IJG_0
call sub.JAPI2.dll__Close_JPEG_Decompressor_IJG_0
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
mov eax, dword [esp + 0x10]
mov word [esi + 0xc], 1
mov word [esi + 0xe], 0x18
lea edi, [eax + eax*2 + 3]
and edi, 0xfffc
mov edx, edi
imul edx, dword [esp + 0x3c]
mov dword [esi + 0x14], edx
mov eax, dword [esp + 0x3c]
mov dword [esi + 8], eax
mov ecx, dword [esp + 0x10]
mov dword [esi + 0x10], ebx
mov dword [esi + 0x20], ebx
mov dword [esi + 0x24], ebx
mov ebx, dword [esp + 0x40]
mov eax, 0xf61
mov dword [esi + 4], ecx
mov dword [esi], 0x28
mov dword [esi + 0x18], eax
mov dword [esi + 0x1c], eax
mov eax, dword [ebx]
test eax, eax
je 0x404735
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov edx, dword [esi + 0x14]
push edx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [ebx], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x3c]
xor ebx, ebx
test eax, eax
jle 0x404773
sub eax, ebx
mov edx, dword [esp + 0x14]
dec eax
imul eax, edi
add eax, edx
push eax
call sub.JAPI2.dll__Decompress_One_Line_IJG_4
mov eax, dword [esp + 0x3c]
inc ebx
cmp ebx, eax
jl 0x404758
call sub.JAPI2.dll__End_JPEG_Decompress_IJG_0
call sub.JAPI2.dll__Close_JPEG_Decompressor_IJG_0
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x38]
push 0
push esi
push eax
push 4
push esi
push ecx
call dword [sym.imp.GDI32.dll_CreateDIBitmap]
mov edx, dword [esp + 0x40]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov esi, eax
mov eax, dword [edx]
push eax
call edi
push ebp
call edi
push ebp
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x24
ret