Function at 0x4db54e
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
push edi
xor edi, edi
push edi
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x14]
mov esi, ecx
push eax
push dword [esi]
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x20], edi
call ebx
test eax, eax
je 0x4db7ad
cmp dword [ebp - 0x14], 0x464d522e
jne 0x4db7ad
push 1
push edi
mov edi, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0xe
push dword [esi]
call edi
push 0
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x14]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x4db7ad
cmp dword [ebp - 0x14], 0x504f5250
jne 0x4db7ad
push 1
push 0
push 0x26
push dword [esi]
call edi
push 0
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x24]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x4db7ad
push dword [ebp - 0x24]
call dword [sym.imp.WS2_32.dll_ntohl]
push 0
push 0
push eax
push dword [esi]
mov dword [ebp - 0x24], eax
call edi
cmp eax, 0xffffffff
je 0x4db7ad
push 0
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x14]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x4db7ad
cmp dword [ebp - 0x14], 0x41544144
jne 0x4db7ad
push 1
push 0
push 6
push dword [esi]
call edi
push 0
lea eax, [ebp - 0x10]
push eax
push 4
lea eax, [ebp - 0x18]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x4db7ad
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_ntohl]
push 1
push 0
push 6
push dword [esi]
mov dword [ebp - 0x18], eax
call edi
and dword [ebp - 0x1c], 0
cmp dword [ebp - 0x18], 0
jbe 0x4db795
cmp byte [0x550300], 0
jne 0x4db7ad
push 0
lea eax, [ebp - 0x10]
push eax
push 2
lea eax, [ebp - 0xc]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x4db7ad
push dword [ebp - 0xc]
call dword [sym.imp.WS2_32.dll_ntohs]
push 0
dec eax
dec eax
mov dword [ebp - 0xc], eax
lea eax, [ebp - 0x10]
push eax
push 2
lea eax, [ebp - 8]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x4db7ad
add dword [ebp - 0xc], 0xfffe
cmp word [ebp - 8], 0x200
jne 0x4db774
push 1
push 0
push 0x12
push dword [esi]
call edi
add dword [ebp - 0xc], 0xffee
push 0
lea eax, [ebp - 0x10]
push eax
push 2
lea eax, [ebp - 8]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x4db7ad
add dword [ebp - 0xc], 0xfffe
cmp word [ebp - 8], 0x2000
jne 0x4db774
mov ecx, dword [ebp + 8]
and dword [ebp - 0x30], 0
test ecx, ecx
lea eax, [esi + 4]
mov dword [ebp - 0x28], 1
mov dword [ebp - 0x38], eax
mov dword [ebp - 0x34], str.AD_RMF
je 0x4db728
mov eax, dword [ecx]
lea edx, [ebp - 0x38]
push edx
call dword [eax + 4]
push 1
push 0
push 0xffffffffffffffff
push dword [esi]
call edi
push 0
lea eax, [ebp - 0x2c]
push eax
push 1
lea eax, [ebp - 1]
push eax
push dword [esi]
mov byte [ebp - 1], 0
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4db759
xor eax, eax
inc eax
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x30], eax
jmp 0x4db764
and dword [ebp - 0x20], 0
mov dword [ebp - 0x30], SysReAllocStringLen
mov ecx, dword [ebp + 8]
test ecx, ecx
je 0x4db774
mov eax, dword [ecx]
lea edx, [ebp - 0x38]
push edx
call dword [eax + 8]
movzx eax, word [ebp - 0xc]
push 1
push 0
push eax
push dword [esi]
call edi
cmp eax, 0xffffffff
je 0x4db7ad
inc dword [ebp - 0x1c]
mov eax, dword [ebp - 0x1c]
cmp eax, dword [ebp - 0x18]
jb 0x4db66a
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x4db7a1
mov ecx, dword [ebp - 0x28]
mov dword [eax], ecx
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4db7ad
mov ecx, dword [ebp - 0x20]
mov dword [eax], ecx
pop edi
pop esi
pop ebx
leave
ret 0xc