Function at 0x6d845d29
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x68
push esi
xor esi, esi
cmp ebx, esi
push edi
jne 0x6d845d69
push 1
push esi
push esi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
mov dword [ebp - 4], eax
lea eax, [ebp - 0x10]
push eax
push 0xe
lea eax, [ebp - 0x40]
push eax
push dword [ebp + 8]
mov dword [ebp - 0x10], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x10], 0xe
je 0x6d845d84
jmp 0x6d846001
mov eax, dword [ebx + 8]
mov esi, dword [ebx + 4]
add esi, eax
lea edi, [ebp - 0x40]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov dword [ebp - 4], eax
add eax, 0xe
movsw word es:[edi], word [esi]
mov dword [ebx + 8], eax
xor esi, esi
cmp word [ebp - 0x40], 0x4d42
je 0x6d845da9
cmp ebx, esi
mov dword [ebp - 0x36], esi
jne 0x6d845da3
push esi
push esi
push dword [ebp - 4]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x6d845dad
mov eax, dword [ebp - 4]
mov dword [ebx + 8], eax
cmp ebx, esi
jne 0x6d845dcf
push esi
lea eax, [ebp - 0x10]
push eax
push 0x28
lea eax, [ebp - 0x68]
push eax
push dword [ebp + 8]
mov dword [ebp - 0x10], esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x10], 0x28
je 0x6d845de7
jmp 0x6d846001
mov eax, dword [ebx + 8]
mov esi, dword [ebx + 4]
add esi, eax
push 0xa
pop ecx
lea edi, [ebp - 0x68]
add eax, 0x28
rep movsd dword es:[edi], dword [esi]
mov dword [ebx + 8], eax
xor esi, esi
mov eax, dword [ebp - 0x48]
cmp eax, esi
jne 0x6d845dfd
cmp word [ebp - 0x5a], 8
ja 0x6d845dfd
mov cl, byte [ebp - 0x5a]
xor eax, eax
inc eax
shl eax, cl
mov dword [ebp - 8], eax
mov eax, dword [ebp - 0x68]
cmp eax, 0xc
mov dword [ebp - 0x20], eax
jne 0x6d845e6b
lea esi, [ebp - 0x68]
lea edi, [ebp - 0x30]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movzx eax, word [ebp - 0x2c]
mov ecx, dword [ebp - 0x26]
mov dword [ebp - 0x64], eax
movzx eax, word [ebp - 0x2a]
mov dword [ebp - 0x60], eax
mov ax, word [ebp - 0x28]
mov word [ebp - 0x5c], ax
xor eax, eax
inc eax
xor esi, esi
shl eax, cl
cmp ebx, esi
mov dword [ebp - 0x68], 0x28
mov word [ebp - 0x5a], cx
mov dword [ebp - 0x58], esi
mov dword [ebp - 0x54], esi
mov dword [ebp - 0x50], esi
mov dword [ebp - 0x4c], esi
mov dword [ebp - 0x48], eax
mov dword [ebp - 0x44], eax
jne 0x6d845e65
push 1
push esi
push 0xc
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x6d845e69
add dword [ebx + 8], 0xffffffe4
xor esi, esi
cmp dword [ebp - 0x54], esi
jne 0x6d845e8a
movzx eax, word [ebp - 0x5a]
imul eax, dword [ebp - 0x64]
add eax, 0x1f
shr eax, 3
and eax, 0x1ffffffc
imul eax, dword [ebp - 0x60]
mov dword [ebp - 0x54], eax
cmp dword [ebp - 0x48], esi
jne 0x6d845ea9
cmp word [ebp - 0x5a], 8
ja 0x6d845ea6
mov cl, byte [ebp - 0x5a]
xor eax, eax
inc eax
shl eax, cl
movzx eax, ax
mov dword [ebp - 0x48], eax
jmp 0x6d845ea9
mov dword [ebp - 0x48], esi
movzx eax, word [ebp - 8]
mov ecx, dword [ebp - 0x68]
mov dword [ebp - 0xc], eax
shl eax, 2
mov dword [ebp - 0x1c], eax
add eax, ecx
push eax
push 2
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp eax, esi
mov dword [ebp - 0x10], eax
je 0x6d846001
push eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
push 0xa
pop ecx
lea esi, [ebp - 0x68]
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [eax]
cmp ecx, 0x28
mov dword [ebp - 0x18], eax
jbe 0x6d845f4b
add ecx, 0xffffffd8
test ebx, ebx
jne 0x6d845f24
and dword [ebp - 0x14], ebx
push ebx
lea edx, [ebp - 0x14]
push edx
push ecx
add eax, 0x640
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
sub eax, 0x28
cmp dword [ebp - 0x14], eax
je 0x6d845f48
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GlobalFree]
jmp 0x6d846001
mov esi, dword [ebx + 4]
add esi, dword [ebx + 8]
mov edx, ecx
shr ecx, 2
lea edi, [eax + 0x640]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [eax]
sub ecx, 0x28
add dword [ebx + 8], ecx
jmp 0x6d845f4b
mov eax, dword [ebp - 0x18]
mov edi, dword [eax]
add edi, eax
xor eax, eax
cmp word [ebp - 8], ax
mov dword [ebp - 0x18], edi
je 0x6d846021
cmp dword [ebp - 0x20], 0xc
jne 0x6d845fe2
cmp ebx, eax
jne 0x6d845f8c
mov esi, dword [ebp - 0xc]
push 0
lea ecx, [ebp - 0x18]
push ecx
mov dword [ebp - 0x18], eax
lea eax, [esi + esi*2]
push eax
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [esi + esi*2]
cmp dword [ebp - 0x18], eax
je 0x6d845fb1
jmp 0x6d846001
mov eax, dword [ebp - 0xc]
mov esi, dword [ebx + 4]
add esi, dword [ebx + 8]
lea eax, [eax + eax*2]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add dword [ebx + 8], eax
mov edi, dword [ebp - 0x18]
mov esi, dword [ebp - 0xc]
dec esi
test esi, esi
jl 0x6d846021
and byte [ebp - 5], 0
lea eax, [edi + esi*2]
lea eax, [esi + eax + 1]
mov cl, byte [eax + 1]
mov byte [ebp - 6], cl
mov cl, byte [eax - 1]
mov byte [ebp - 8], cl
mov cl, byte [eax]
mov byte [ebp - 7], cl
mov ecx, dword [ebp - 8]
mov dword [edi + esi*4], ecx
dec esi
sub eax, 3
test esi, esi
jge 0x6d845fc1
jmp 0x6d846021
cmp ebx, eax
jne 0x6d846005
mov esi, dword [ebp - 0x1c]
push eax
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x18]
push eax
push esi
push edi
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [ebp - 0x18], esi
je 0x6d846021
xor eax, eax
jmp 0x6d84604e
mov eax, dword [ebp - 0x1c]
mov esi, dword [ebx + 4]
add esi, dword [ebx + 8]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
add dword [ebx + 8], eax
mov eax, dword [ebp - 0x36]
test eax, eax
je 0x6d846042
mov ecx, dword [ebp - 4]
add eax, ecx
test ebx, ebx
jne 0x6d84603f
push ebx
push ebx
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
jmp 0x6d846042
mov dword [ebx + 8], eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
mov eax, dword [ebp - 0x10]
pop edi
pop esi
leave
ret