Function at 0x401127
Capabilities:
Read file on windows

Disassembly:
jmp 0x401587
sub esp, 0x300
push ebx
push ebp
push esi
push edi
xor edi, edi
push edi
push 0x80000020
push 3
push edi
push 1
push 0x80000000
push 0xac5974
mov dword [0xa3260c], edi
mov dword [0xa32604], edi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebp, dword [esp + 0x314]
mov ebx, eax
mov eax, dword [0x6a131c]
push edi
shl ebp, 5
push edi
push dword [eax + ebp + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [0x6a131c]
xor esi, esi
cmp word [eax + ebp + 0x1c], di
jbe 0x40160d
movzx eax, si
push edi
push 0x9bd278
lea eax, [eax + eax*4]
push 0xa
lea eax, [esp + eax*2 + 0x4c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [0x6a131c]
inc esi
cmp si, word [eax + ebp + 0x1c]
jb 0x4015e6
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x6a131c]
add eax, ebp
mov cx, word [eax + 0x14]
mov word [0x8ba528], cx
mov ax, word [eax + 0x16]
mov word [0xac5732], ax
test byte [0x8ba528], 3
je 0x401644
inc cx
mov word [0x8ba528], cx
jmp 0x401630
imul ax, cx
push 0x428
push 0x42
mov dword [esp + 0x34], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalLock]
push eax
mov dword [esp + 0x2c], eax
call ebx
mov esi, eax
mov dword [esp + 0x38], esi
mov dword [esi], 0x28
movzx eax, word [0x8ba528]
mov dword [esi + 4], eax
movzx eax, word [0xac5732]
mov dword [esi + 8], eax
mov word [esi + 0xc], 1
mov word [esi + 0xe], 8
cmp dword [0xac5a48], edi
jne 0x4016de
push dword [0x996134]
call ebx
mov edi, 0x40dbc1
add eax, 5
mov cl, byte [eax - 1]
mov byte [edi + 1], cl
mov cl, byte [eax]
mov byte [edi], cl
mov cl, byte [eax + 1]
mov byte [edi - 1], cl
add edi, 4
add eax, 4
cmp edi, 0x40dfc1
jl 0x4016aa
push dword [0x996134]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov dword [0xac5a48], 1
mov eax, 0x40dbc0
lea ecx, [esi + 0x28]
mov edx, dword [eax]
add eax, 4
mov dword [ecx], edx
add ecx, 4
cmp eax, 0x40dfc0
jl 0x4016e6
movzx edi, word [esp + 0x2c]
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esp + 0x24], eax
call ebx
push edi
push 0x56
push eax
mov dword [esp + 0x28], eax
call sub.MSVCRT.dll_memset
mov eax, dword [0x6a131c]
and dword [esp + 0x20], 0
add esp, 0xc
cmp word [eax + ebp + 0x1c], 0
jbe 0x4018ad
jmp 0x40173a
mov ebx, dword [sym.imp.KERNEL32.dll_GlobalLock]
movzx eax, word [esp + 0x14]
mov ecx, dword [0x8eb2c0]
lea edi, [eax + eax*4]
shl edi, 1
movsx eax, word [esp + edi + 0x44]
lea eax, [eax + eax*2]
lea eax, [ecx + eax*4]
push eax
call fcn.004010a5
lea esi, [eax + eax*2]
mov eax, dword [0xac5220]
shl esi, 3
pop ecx
push dword [esi + eax + 4]
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esp + 0x34], eax
call ebx
push 0
push 0x80000020
push 3
push 0
push 1
push 0x80000000
push 0xac5974
mov ebx, eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ecx, dword [0xac5220]
push 0
push 0
mov dword [esp + 0x18], eax
push dword [esi + ecx]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [0xac5220]
push 0
push 0x9bd278
push dword [esi + eax + 4]
push ebx
push dword [esp + 0x20]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [esp + 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ax, word [ebx]
and dword [esp + 0x18], 0
test ax, ax
mov dword [esp + 0x3c], eax
jbe 0x40187c
lea eax, [ebx + 8]
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x10]
mov ecx, dword [eax]
mov al, byte [ecx + ebx]
cmp al, 0xff
je 0x401863
mov dx, word [0xac5732]
movzx ax, al
sub dx, ax
sub dx, word [esp + edi + 0x42]
inc ecx
movzx ax, byte [ecx + ebx]
inc ecx
inc ecx
test ax, ax
jbe 0x401860
movzx eax, ax
mov dword [esp + 0x24], eax
mov eax, dword [0x8ba528]
add edx, 0xffff
imul eax, edx
add ax, word [esp + edi + 0x40]
mov dword [esp + 0x34], edx
add eax, dword [esp + 0x18]
cmp ax, word [esp + 0x2c]
jae 0x401859
mov esi, dword [esp + 0x1c]
mov dl, byte [ecx + ebx]
movzx eax, ax
mov byte [eax + esi], dl
mov edx, dword [esp + 0x34]
inc ecx
dec dword [esp + 0x24]
jne 0x401826
inc ecx
jmp 0x4017f8
inc dword [esp + 0x18]
add dword [esp + 0x10], 4
mov ax, word [esp + 0x18]
cmp ax, word [esp + 0x3c]
jb 0x4017f2
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push dword [esp + 0x30]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
inc dword [esp + 0x14]
mov eax, dword [0x6a131c]
mov cx, word [esp + 0x14]
cmp cx, word [eax + ebp + 0x1c]
jb 0x401734
mov esi, dword [esp + 0x38]
push dword [0x57c358]
call dword [sym.imp.USER32.dll_GetDC]
push 0
push esi
push dword [esp + 0x24]
mov edi, eax
push 4
push esi
push edi
call dword [sym.imp.GDI32.dll_CreateDIBitmap]
push edi
mov ebx, eax
push dword [0x57c358]
call dword [sym.imp.USER32.dll_ReleaseDC]
push dword [esp + 0x28]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalUnlock]
call edi
push dword [esp + 0x28]
mov esi, dword [sym.imp.KERNEL32.dll_GlobalFree]
call esi
push dword [esp + 0x20]
call edi
push dword [esp + 0x20]
call esi
pop edi
pop esi
mov eax, ebx
pop ebp
pop ebx
add esp, 0x300
ret