Function at 0x4047e0
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
jne 0x404818
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret
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 0x4049f7
cmp byte [esp + 0x25], 0xd8
jne 0x4049f7
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.japi.dll__Init_JPEG_Decompressor_4
lea eax, [esp + 0x18]
lea ecx, [esp + 0x10]
push eax
lea edx, [esp + 0x18]
push ecx
push edx
push edi
call sub.japi.dll__Start_JPEG_Decompress_16
test eax, eax
jne 0x4048be
call sub.japi.dll__End_JPEG_Decompress_0
call sub.japi.dll__Close_JPEG_Decompressor_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]
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
push eax
push ecx
push edx
call fcn.004045f0
add esp, 0xc
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x24
ret
cmp dword [esp + 0x18], ebx
je 0x40490c
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.japi.dll__End_JPEG_Decompress_0
call sub.japi.dll__Close_JPEG_Decompressor_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 + 0x14]
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 + 0x10]
mov dword [esi + 0x14], edx
mov eax, dword [esp + 0x10]
mov dword [esi + 8], eax
mov ecx, dword [esp + 0x14]
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 0x404969
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 + 0x3c], eax
mov eax, dword [esp + 0x10]
xor ebx, ebx
test eax, eax
jle 0x4049a7
sub eax, ebx
mov edx, dword [esp + 0x3c]
dec eax
imul eax, edi
add eax, edx
push eax
call sub.japi.dll__Decompress_One_Line_4
mov eax, dword [esp + 0x10]
inc ebx
cmp ebx, eax
jl 0x40498c
call sub.japi.dll__End_JPEG_Decompress_0
call sub.japi.dll__Close_JPEG_Decompressor_0
mov eax, dword [esp + 0x3c]
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