Function at 0x10097e80
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x28
push edi
mov edi, dword [esp + 0x30]
test edi, edi
jne 0x10097e94
lea eax, [edi + 1]
pop edi
add esp, 0x28
ret
push esi
mov esi, dword [esp + 0x38]
test esi, esi
je 0x10097edc
lea eax, [esp + 0x28]
push eax
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x18]
push edx
push esi
call sym.leptonlib.dll_pixGetDimensions
mov eax, dword [esp + 0x38]
add esp, 0x10
cmp eax, 1
je 0x10097ee7
cmp eax, 2
je 0x10097ee7
cmp eax, 4
je 0x10097ee7
cmp eax, 8
je 0x10097ee7
cmp eax, 0x10
je 0x10097ee7
cmp eax, 0x18
je 0x10097ee7
cmp eax, 0x20
je 0x10097ee7
pop esi
mov eax, 1
pop edi
add esp, 0x28
ret
push esi
call sym.leptonlib.dll_pixGetColormap
add esp, 4
test eax, eax
je 0x10097f01
push 3
push esi
call sym.leptonlib.dll_pixRemoveColormap
add esp, 8
jmp 0x10097f0a
push esi
call sym.leptonlib.dll_boxClone
add esp, 4
push ebx
push ebp
push eax
mov dword [esp + 0x28], eax
call sym.leptonlib.dll_numaGetRefcount
mov ebp, eax
mov eax, dword [esp + 0x28]
push eax
call sym.leptonlib.dll_pixGetData
mov ecx, dword [esp + 0x2c]
push ecx
mov esi, eax
call sym.leptonlib.dll_dpixGetRefcount
add esp, 0xc
mov ebx, eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x2c], 0
cmp ebp, 1
jne 0x10097fe1
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
push edx
push eax
push str.P4_n_Raw_PBM_file_written_by_leptonlib__www.leptonica.com__n_d__d_n
push edi
call dword [sym.imp.MSVCR90.dll_fprintf]
mov eax, dword [esp + 0x28]
add eax, 7
cdq
and edx, 7
add eax, edx
mov edi, eax
add esp, 0x10
sar edi, 3
cmp dword [esp + 0x14], 0
mov dword [esp + 0x1c], 0
jle 0x10098205
mov ebp, dword [sym.imp.MSVCR90.dll_fwrite]
lea ecx, [ebx*4]
mov dword [esp + 0x20], ecx
mov ebx, esi
lea esp, [esp]
xor esi, esi
test edi, edi
jle 0x10097fc9
push esi
push ebx
call sym.leptonlib.dll_l_getDataByte
mov edx, dword [esp + 0x44]
push edx
push 1
mov byte [esp + 0x23], al
lea eax, [esp + 0x23]
push 1
push eax
call ebp
inc esi
add esp, 0x18
cmp esi, edi
jl 0x10097fa6
mov eax, dword [esp + 0x1c]
add ebx, dword [esp + 0x20]
inc eax
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x1c], eax
jl 0x10097fa0
jmp 0x10098205
cmp ebp, 2
je 0x100980ef
cmp ebp, 4
je 0x100980ef
cmp ebp, 8
je 0x100980ef
cmp ebp, 0x10
je 0x100980ef
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
push ecx
push edx
push str.P6_n_Raw_PPM_file_written_by_leptonlib__www.leptonica.com__n_d__d_n255_n
push edi
call dword [sym.imp.MSVCR90.dll_fprintf]
add esp, 0x10
cmp dword [esp + 0x30], 0x18
jne 0x1009806c
mov edi, dword [esp + 0x18]
xor ebp, ebp
cmp dword [esp + 0x14], ebp
lea edi, [edi + edi*2]
jle 0x10098205
add ebx, ebx
add ebx, ebx
lea esp, [esp]
mov eax, dword [esp + 0x3c]
push eax
push edi
push 1
push esi
call dword [sym.imp.MSVCR90.dll_fwrite]
add esp, 0x10
cmp eax, edi
je 0x1009805e
mov dword [esp + 0x2c], 1
inc ebp
add esi, ebx
cmp ebp, dword [esp + 0x14]
jl 0x10098040
jmp 0x10098205
cmp dword [esp + 0x14], 0
mov dword [esp + 0x1c], 0
jle 0x10098205
mov ebx, dword [sym.imp.MSVCR90.dll_fwrite]
lea ebp, [esi + 2]
mov edi, dword [esp + 0x20]
test edi, edi
jle 0x100980d2
mov esi, ebp
mov cl, byte [esi + 1]
mov byte [esp + 0x28], cl
mov ecx, dword [esp + 0x3c]
mov dl, byte [esi]
push ecx
mov byte [esp + 0x2d], dl
mov al, byte [esi - 1]
push 3
lea edx, [esp + 0x30]
push 1
push edx
mov byte [esp + 0x3a], al
call ebx
add esp, 0x10
cmp eax, 3
je 0x100980c6
mov dword [esp + 0x2c], 1
add esi, 4
sub edi, 1
jne 0x10098092
mov edi, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
inc ecx
lea eax, [edi*4]
add ebp, eax
cmp ecx, dword [esp + 0x14]
mov dword [esp + 0x1c], ecx
jl 0x10098088
jmp 0x10098205
mov edx, dword [esp + 0x18]
mov ecx, ebp
mov eax, 1
shl eax, cl
mov ecx, dword [esp + 0x14]
dec eax
push eax
push ecx
push edx
push str.P5_n_Raw_PGM_file_written_by_leptonlib__www.leptonica.com__n_d__d_n_d_n
push edi
call dword [sym.imp.MSVCR90.dll_fprintf]
add esp, 0x14
cmp ebp, 0x10
je 0x100981a7
cmp dword [esp + 0x14], 0
mov dword [esp + 0x1c], 0
jle 0x10098205
lea eax, [ebx*4]
mov ebx, dword [sym.imp.MSVCR90.dll_fwrite]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
mov edi, esi
xor esi, esi
test eax, eax
jle 0x10098192
lea esp, [esp]
push esi
push edi
cmp ebp, 2
jne 0x1009815e
call sym.leptonlib.dll_l_getDataDibit
jmp 0x1009816f
cmp ebp, 4
jne 0x1009816a
call sym.leptonlib.dll_l_getDataQbit
jmp 0x1009816f
call sym.leptonlib.dll_l_getDataByte
mov ecx, dword [esp + 0x44]
add esp, 8
push ecx
push 1
lea edx, [esp + 0x1b]
push 1
push edx
mov byte [esp + 0x23], al
call ebx
mov eax, dword [esp + 0x28]
inc esi
add esp, 0x10
cmp esi, eax
jl 0x10098150
mov ecx, dword [esp + 0x1c]
add edi, dword [esp + 0x20]
inc ecx
cmp ecx, dword [esp + 0x14]
mov dword [esp + 0x1c], ecx
jl 0x10098146
jmp 0x10098205
xor ebp, ebp
cmp dword [esp + 0x14], ebp
jle 0x10098205
lea eax, [ebx*4]
mov ebx, dword [sym.imp.MSVCR90.dll_fwrite]
mov dword [esp + 0x20], eax
mov eax, dword [esp + 0x18]
mov edi, esi
xor esi, esi
test eax, eax
jle 0x100981fa
lea esp, [esp]
push esi
push edi
call sym.leptonlib.dll_l_getDataTwoBytes
mov edx, dword [esp + 0x44]
push edx
movzx ecx, ax
push 1
lea eax, [esp + 0x44]
push 2
push eax
mov dword [esp + 0x4c], ecx
call ebx
mov eax, dword [esp + 0x30]
inc esi
add esp, 0x18
cmp esi, eax
jl 0x100981d0
add edi, dword [esp + 0x20]
inc ebp
cmp ebp, dword [esp + 0x14]
jl 0x100981c6
lea ecx, [esp + 0x24]
push ecx
call sym.leptonlib.dll_pixDestroy
add esp, 4
pop ebp
xor eax, eax
cmp dword [esp + 0x28], eax
pop ebx
pop esi
setne al
pop edi
add esp, 0x28
ret