Function at 0x401b30
Capabilities:
Write file on windows

Disassembly:
mov eax, dword [0x40c990]
sub esp, 0x28
test eax, eax
jne 0x401b55
mov eax, dword [0x40c948]
cmp dword [eax + 0x5c], 0
jne 0x401b4e
mov eax, 8
jmp 0x401b51
mov eax, dword [eax + 0x34]
test eax, eax
je 0x401b5d
xor al, al
add esp, 0x28
ret 4
push ebp
mov ebp, dword [0x40c964]
test ebp, ebp
jge 0x401b6a
neg ebp
mov eax, dword [0x40c960]
push ebx
push esi
lea esi, [ebp + 1]
imul esi, eax
push esi
mov dword [esp + 0x28], ebp
mov dword [esp + 0x18], eax
call sub.MSVCR90.dll_void____cdecl_operator_new_unsigned_int_
mov ebx, eax
add esp, 4
mov dword [esp + 0x28], ebx
test ebx, ebx
jne 0x401bbb
push esi
mov esi, dword [0x40c948]
push str.Compression_buffer_allocation_of__u_bytes_failed._n
call fcn.004074a0
add esp, 8
pop esi
pop ebx
mov dword [0x40c990], 0x2d
xor al, al
pop ebp
add esp, 0x28
ret 4
lea eax, [ebx + ebp]
mov dword [esp + 0x1c], eax
xor eax, eax
push edi
mov edi, dword [esp + 0x3c]
xor esi, esi
cmp ebp, eax
mov dword [esp + 0x14], esi
mov dword [esp + 0x24], edi
mov dword [esp + 0x34], eax
jle 0x401e6d
jmp 0x401be3
xor eax, eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x18]
xor ebp, ebp
test eax, eax
jle 0x401c9d
lea esp, [esp]
mov edx, dword [0x40c97c]
xor ecx, ecx
test edx, edx
jbe 0x401c40
mov eax, dword [0x40c98c]
inc eax
mov bl, byte [edi + 2]
cmp bl, byte [eax + 1]
jne 0x401c30
mov esi, dword [esp + 0x24]
mov bl, byte [esi + 1]
cmp bl, byte [eax]
jne 0x401c30
mov bl, byte [esi]
cmp bl, byte [eax - 1]
je 0x401cc5
inc ecx
add eax, 4
cmp ecx, edx
jb 0x401c12
mov ebx, dword [esp + 0x2c]
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
mov byte [eax + ebp], dl
xor al, al
add edi, 3
mov dword [esp + 0x24], edi
test al, al
jne 0x401c90
mov ecx, dword [esp + 0x34]
movzx edx, byte [edi - 3]
movzx eax, byte [edi - 2]
mov esi, dword [0x40c948]
sub edi, 3
push ebp
push ecx
movzx ecx, byte [edi + 2]
push edx
push eax
push ecx
push str.Unfound_RGB_color___4u_4u_4u__at_row__u_column__u._n
call fcn.004074a0
add esp, 0x18
add edi, 3
mov dword [0x40c990], 0x2e
mov dword [esp + 0x24], edi
mov eax, dword [esp + 0x18]
inc ebp
cmp ebp, eax
jl 0x401c00
xor ebp, ebp
test eax, eax
jle 0x401e2b
mov edx, dword [esp + 0x20]
mov al, byte [edx + ebp]
inc ebp
cmp ebp, dword [esp + 0x18]
mov byte [esp + 0x10], al
jl 0x401cdb
mov ecx, 1
mov byte [esp + 0x11], 0
jmp 0x401d1c
mov edx, dword [esp + 0x20]
mov ebx, dword [esp + 0x2c]
mov edi, dword [esp + 0x24]
mov byte [edx + ebp], cl
mov al, 1
jmp 0x401c49
mov edx, dword [esp + 0x20]
mov dl, byte [edx + ebp]
inc ebp
xor ecx, ecx
cmp ebp, dword [esp + 0x18]
mov byte [esp + 0x11], dl
jge 0x401d17
nop
cmp ecx, 0xfd
jge 0x401d17
mov edi, dword [esp + 0x20]
lea edx, [ecx + ebp]
mov dl, byte [edx + edi]
mov esi, ecx
and esi, 1
cmp dl, byte [esp + esi + 0x10]
jne 0x401d17
inc ecx
lea edx, [ecx + ebp]
cmp edx, dword [esp + 0x18]
jl 0x401cf0
add ebp, ecx
add ecx, 2
mov edx, dword [esp + 0x14]
shl al, 4
or al, byte [esp + 0x11]
mov byte [edx + ebx], cl
inc edx
mov dword [esp + 0x14], edx
mov byte [edx + ebx], al
inc edx
cmp ecx, 6
mov dword [esp + 0x14], edx
jg 0x401d4f
add dword [esp + 0x30], 2
add dword [esp + 0x1c], ecx
cmp ebp, dword [esp + 0x18]
jl 0x401ca7
mov edx, dword [esp + 0x1c]
mov esi, dword [esp + 0x30]
lea eax, [edx + 3]
shr eax, 2
lea eax, [eax + eax + 2]
cmp eax, esi
jae 0x401e13
lea eax, [edx - 3]
cmp eax, 0xfc
ja 0x401e13
mov eax, dword [esp + 0x14]
sub eax, esi
sub eax, 2
cmp ecx, 6
jg 0x401d88
add eax, 2
mov byte [eax + ebx], 0
inc eax
mov edi, ebp
sub edi, ecx
mov byte [eax + ebx], dl
xor esi, esi
inc eax
sub edi, edx
cmp dword [esp + 0x1c], esi
jbe 0x401de4
mov edx, dword [esp + 0x20]
add edi, edx
mov dl, byte [edi]
inc esi
mov dword [esp + 0x3c], esi
mov esi, dword [esp + 0x1c]
inc edi
cmp dword [esp + 0x3c], esi
jae 0x401dc0
mov bl, byte [edi]
mov byte [esp + 0x11], bl
inc edi
jmp 0x401dc5
mov byte [esp + 0x11], 0
mov esi, dword [esp + 0x2c]
shl dl, 4
or dl, byte [esp + 0x11]
inc eax
mov byte [eax + esi - 1], dl
mov esi, dword [esp + 0x3c]
inc esi
cmp esi, dword [esp + 0x1c]
jb 0x401da5
mov ebx, dword [esp + 0x2c]
mov edx, dword [esp + 0x1c]
and edx, 3
cmp edx, 1
je 0x401df5
cmp edx, 2
jne 0x401dfa
mov byte [eax + ebx], 0
inc eax
cmp ecx, 6
jle 0x401e0f
mov byte [eax + ebx], cl
mov ecx, dword [esp + 0x14]
mov dl, byte [ecx + ebx - 1]
inc eax
mov byte [eax + ebx], dl
inc eax
mov dword [esp + 0x14], eax
xor eax, eax
cmp ebp, dword [esp + 0x18]
mov dword [esp + 0x30], eax
mov dword [esp + 0x1c], eax
jl 0x401ca7
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x18]
add dword [esp + 0x20], eax
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x28]
inc eax
mov dword [esp + 0x34], eax
cmp eax, ecx
mov eax, dword [esp + 0x14]
mov byte [eax + ebx], 0
jne 0x401e53
inc eax
mov byte [eax + ebx], 1
jmp 0x401e58
inc eax
mov byte [eax + ebx], 0
inc eax
cmp dword [esp + 0x34], ecx
mov dword [esp + 0x14], eax
jl 0x401be1
mov ebp, dword [esp + 0x28]
mov esi, eax
mov edx, ebp
mov ebp, dword [esp + 0x18]
mov edi, esi
mov ecx, ebp
call fcn.00401870
test al, al
je 0x401ebd
mov ecx, dword [0x40c954]
push ecx
push 1
push esi
push ebx
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
cmp eax, 1
je 0x401ec9
push esi
mov esi, dword [0x40c948]
push str.Error_writing_BMP_output_file_of__u_bytes._n
call fcn.004074a0
push ebx
mov dword [0x40c990], 0x2f
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
add esp, 0xc
pop edi
pop esi
pop ebx
xor al, al
pop ebp
add esp, 0x28
ret 4
push ebx
call sub.MSVCR90.dll_void___cdecl_operator_delete_void__
mov edi, dword [esp + 0x2c]
mov esi, ebp
imul esi, edi
lea ecx, [esi + esi*2]
add ecx, ecx
add ecx, ecx
add ecx, ecx
shr ecx, 3
add esp, 4
test ecx, ecx
je 0x401f00
jmp 0x401ef0
mov eax, 0xcccccccd
mul ecx
shr edx, 3
mov ecx, edx
test ecx, ecx
jne 0x401ef0
mov edx, ebp
push edx
push edi
push esi
mov esi, dword [0x40c948]
push str.Total_pixels___u_____u_rows___u_columns__n
call fcn.004074a0
add esp, 0x10
pop edi
pop esi
pop ebx
mov al, 1
pop ebp
add esp, 0x28
ret 4