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

Disassembly:
mov eax, dword [esp + 4]
sub esp, 0x150
push ebx
push ebp
push esi
push edi
push 0x4c5ec0
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov ebp, eax
add esp, 8
test ebp, ebp
je 0x418e06
mov ebx, dword [sym.imp.MSVCRT.dll_fread]
push ebp
push 1
lea ecx, [esp + 0x58]
push 0xe
push ecx
call ebx
push ebp
push 1
lea edx, [esp + 0x40]
push 0x28
push edx
call ebx
mov ecx, dword [esp + 0x50]
mov esi, dword [esp + 0x4c]
add esp, 0x20
cmp ecx, esi
jle 0x418dfc
mov eax, ecx
cdq
idiv esi
test edx, edx
jne 0x418dfc
mov eax, ecx
cdq
idiv esi
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x38]
test eax, eax
jne 0x418dfc
push 0x428
call dword [sym.imp.MSVCRT.dll_malloc]
mov ecx, 0xa
lea esi, [esp + 0x2c]
mov edi, eax
add esp, 4
rep movsd dword es:[edi], dword [esi]
mov cx, word [esp + 0x36]
mov dword [esp + 0x20], eax
cmp cx, 1
jne 0x418c21
push ebp
mov dword [esp + 0x14], 2
push 2
add eax, 0x28
push 4
push eax
call ebx
mov cx, word [esp + 0x46]
add esp, 0x10
jmp 0x418c54
cmp cx, 8
jne 0x418c42
mov ecx, dword [eax + 0x20]
test ecx, ecx
mov dword [esp + 0x10], ecx
jne 0x418c3e
mov dword [esp + 0x10], 0x100
mov ecx, dword [esp + 0x10]
push ebp
push ecx
jmp 0x418c0f
cmp cx, 0x18
jne 0x418de0
mov dword [esp + 0x10], 0
mov ebx, dword [esp + 0x2c]
cmp cx, 1
jne 0x418c7d
test bl, 0x1f
je 0x418c69
inc ebx
test bl, 0x1f
jne 0x418c63
mov eax, ebx
imul eax, dword [esp + 0x30]
cdq
and edx, 7
add eax, edx
mov edi, eax
sar edi, 3
jmp 0x418c98
test bl, 3
je 0x418c88
inc ebx
test bl, 3
jne 0x418c82
mov edi, ebx
imul edi, dword [esp + 0x30]
cmp cx, 0x18
jne 0x418c98
lea edi, [edi + edi*2]
push edi
call dword [sym.imp.MSVCRT.dll_malloc]
push ebp
mov esi, eax
push edi
push 1
push esi
mov dword [esp + 0x38], esi
call dword [sym.imp.MSVCRT.dll_fread]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
mov eax, dword [esp + 0x44]
add esp, 0x18
imul ebx, eax
mov dword [esp + 0x30], eax
mov ax, word [esp + 0x36]
mov ebp, ebx
mov ebx, 1
cmp ax, bx
mov dword [esp + 0x14], esi
jne 0x418ce9
mov eax, ebp
cdq
and edx, 7
add eax, edx
sar eax, 3
mov ebp, eax
jmp 0x418cf3
cmp ax, 0x18
jne 0x418cf3
lea ebp, [ebp + ebp*2]
mov edi, dword [esp + 0x164]
push str..bmp
push edi
call dword [sym.imp.MSVCRT.dll_strstr]
add esp, 8
test eax, eax
je 0x418d15
sub eax, edi
mov dword [esp + 0x18], eax
jmp 0x418d23
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov dword [esp + 0x18], ecx
cmp dword [esp + 0x1c], ebx
jl 0x418dcb
mov edi, dword [sym.imp.MSVCRT.dll_fwrite]
mov eax, dword [esp + 0x164]
mov ecx, dword [esp + 0x18]
push ebx
push eax
push ecx
lea edx, [esp + 0x6c]
push str._.s__d.bmp
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
lea eax, [esp + 0x74]
push 0x4c5ec4
push eax
call dword [sym.imp.MSVCRT.dll_fopen]
mov esi, eax
add esp, 0x1c
test esi, esi
je 0x418e06
push esi
push 1
lea ecx, [esp + 0x58]
push 0xe
push ecx
call edi
push esi
push 1
lea edx, [esp + 0x40]
push 0x28
push edx
call edi
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x40]
push esi
push eax
add ecx, 0x28
push 4
push ecx
call edi
mov edx, dword [esp + 0x44]
push esi
push 1
push ebp
push edx
call edi
add esp, 0x40
push esi
call dword [sym.imp.MSVCRT.dll_fclose]
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
add esp, 4
add edx, ebp
inc ebx
mov dword [esp + 0x14], edx
cmp ebx, eax
jle 0x418d33
mov esi, dword [esp + 0x24]
push esi
call dword [sym.imp.MSVCRT.dll_free]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x150
ret
push eax
call dword [sym.imp.MSVCRT.dll_free]
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x150
ret
push ebp
call dword [sym.imp.MSVCRT.dll_fclose]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x150
ret